diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt
index 74a1c2e2aef3..2d4879571505 100644
--- a/eng/versioning/version_client.txt
+++ b/eng/versioning/version_client.txt
@@ -206,6 +206,7 @@ com.azure.resourcemanager:azure-resourcemanager-digitaltwins;1.0.0-beta.1;1.0.0-
com.azure.resourcemanager:azure-resourcemanager-netapp;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-storagecache;1.0.0-beta.1;1.0.0-beta.2
com.azure.resourcemanager:azure-resourcemanager-redisenterprise;1.0.0-beta.1;1.0.0-beta.2
+com.azure.resourcemanager:azure-resourcemanager-dataprotection;1.0.0-beta.1;1.0.0-beta.1
# Unreleased dependencies: Copy the entry from above, prepend "unreleased_" and remove the current
# version. Unreleased dependencies are only valid for dependency versions.
diff --git a/pom.xml b/pom.xml
index 8069fdfba48a..fc7809c45152 100644
--- a/pom.xml
+++ b/pom.xml
@@ -586,6 +586,7 @@
sdk/core
sdk/cosmos
sdk/costmanagement
+ sdk/dataprotection
sdk/digitaltwins
sdk/eventgrid
sdk/eventhubs
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/CHANGELOG.md b/sdk/dataprotection/azure-resourcemanager-dataprotection/CHANGELOG.md
new file mode 100644
index 000000000000..36c1c113e4e8
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/CHANGELOG.md
@@ -0,0 +1,5 @@
+# Release History
+
+## 1.0.0-beta.1 (2021-02-25)
+
+- Azure Resource Manager DataProtection client library for Java. This package contains Microsoft Azure SDK for DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-2021-02-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/README.md b/sdk/dataprotection/azure-resourcemanager-dataprotection/README.md
new file mode 100644
index 000000000000..6e817dcfe91d
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/README.md
@@ -0,0 +1,99 @@
+# Azure Resource Manager DataProtection client library for Java
+
+Azure Resource Manager DataProtection client library for Java.
+
+This package contains Microsoft Azure SDK for DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-2021-02-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
+
+## We'd love to hear your feedback
+
+We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better.
+
+If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together.
+
+Thank you in advance for your collaboration. We really appreciate your time!
+
+## Documentation
+
+Various documentation is available to help you get started
+
+- [API reference documentation][docs]
+
+## Getting started
+
+### Prerequisites
+
+- [Java Development Kit (JDK)][jdk] with version 8 or above
+- [Azure Subscription][azure_subscription]
+
+### Adding the package to your product
+
+[//]: # ({x-version-update-start;com.azure.resourcemanager:azure-resourcemanager-dataprotection;current})
+```xml
+
+ com.azure.resourcemanager
+ azure-resourcemanager-dataprotection
+ 1.0.0-beta.1
+
+```
+[//]: # ({x-version-update-end})
+
+### Include the recommended packages
+
+Azure Management Libraries require a `TokenCredential` implementation for authentication and an `HttpClient` implementation for HTTP client.
+
+[Azure Identity][azure_identity] package and [Azure Core Netty HTTP][azure_core_http_netty] package provide the default implementation.
+
+### Authentication
+
+By default, Azure Active Directory token authentication depends on correct configure of following environment variables.
+
+- `AZURE_CLIENT_ID` for Azure client ID.
+- `AZURE_TENANT_ID` for Azure tenant ID.
+- `AZURE_CLIENT_SECRET` or `AZURE_CLIENT_CERTIFICATE_PATH` for client secret or client certificate.
+
+In addition, Azure subscription ID can be configured via environment variable `AZURE_SUBSCRIPTION_ID`.
+
+With above configuration, `azure` client can be authenticated by following code:
+
+```java
+AzureProfile profile = new AzureProfile(AzureEnvironment.AZURE);
+TokenCredential credential = new DefaultAzureCredentialBuilder()
+ .authorityHost(profile.getEnvironment().getActiveDirectoryEndpoint())
+ .build();
+DataProtectionManager manager = DataProtectionManager
+ .authenticate(credential, profile);
+```
+
+The sample code assumes global Azure. Please change `AzureEnvironment.AZURE` variable if otherwise.
+
+See [Authentication][authenticate] for more options.
+
+## Key concepts
+
+See [API design][design] for general introduction on design and key concepts on Azure Management Libraries.
+
+## Examples
+
+## Troubleshooting
+
+## Next steps
+
+## Contributing
+
+For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md).
+
+1. Fork it
+1. Create your feature branch (`git checkout -b my-new-feature`)
+1. Commit your changes (`git commit -am 'Add some feature'`)
+1. Push to the branch (`git push origin my-new-feature`)
+1. Create new Pull Request
+
+
+[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
+[docs]: https://azure.github.io/azure-sdk-for-java/
+[jdk]: https://docs.microsoft.com/java/azure/jdk/
+[azure_subscription]: https://azure.microsoft.com/free/
+[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity
+[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty
+[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md
+[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml b/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml
new file mode 100644
index 000000000000..a847df7d4e7e
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/pom.xml
@@ -0,0 +1,67 @@
+
+ 4.0.0
+
+ com.azure
+ azure-client-sdk-parent
+ 1.7.0
+ ../../parents/azure-client-sdk-parent
+
+
+ com.azure.resourcemanager
+ azure-resourcemanager-dataprotection
+ 1.0.0-beta.1
+ jar
+
+ Microsoft Azure SDK for DataProtection Management
+ This package contains Microsoft Azure SDK for DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-2021-02-preview. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
+ https://github.com/Azure/azure-sdk-for-java
+
+
+
+ The MIT License (MIT)
+ http://opensource.org/licenses/MIT
+ repo
+
+
+
+
+ https://github.com/Azure/azure-sdk-for-java
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ scm:git:git@github.com:Azure/azure-sdk-for-java.git
+ HEAD
+
+
+
+ microsoft
+ Microsoft
+
+
+
+ UTF-8
+
+
+
+
+ com.azure
+ azure-core
+ 1.13.0
+
+
+ com.azure
+ azure-core-management
+ 1.1.1
+
+
+
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ 0.8.5
+
+ true
+
+
+
+
+
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/DataProtectionManager.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/DataProtectionManager.java
new file mode 100644
index 000000000000..6387dbf71b0f
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/DataProtectionManager.java
@@ -0,0 +1,348 @@
+// 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;
+
+import com.azure.core.credential.TokenCredential;
+import com.azure.core.http.HttpClient;
+import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpPipelineBuilder;
+import com.azure.core.http.policy.AddDatePolicy;
+import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
+import com.azure.core.http.policy.HttpLogOptions;
+import com.azure.core.http.policy.HttpLoggingPolicy;
+import com.azure.core.http.policy.HttpPipelinePolicy;
+import com.azure.core.http.policy.HttpPolicyProviders;
+import com.azure.core.http.policy.RequestIdPolicy;
+import com.azure.core.http.policy.RetryPolicy;
+import com.azure.core.http.policy.UserAgentPolicy;
+import com.azure.core.management.profile.AzureProfile;
+import com.azure.core.util.Configuration;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.dataprotection.fluent.DataProtectionClient;
+import com.azure.resourcemanager.dataprotection.implementation.BackupInstancesImpl;
+import com.azure.resourcemanager.dataprotection.implementation.BackupPoliciesImpl;
+import com.azure.resourcemanager.dataprotection.implementation.BackupVaultsImpl;
+import com.azure.resourcemanager.dataprotection.implementation.DataProtectionClientBuilder;
+import com.azure.resourcemanager.dataprotection.implementation.ExportJobsImpl;
+import com.azure.resourcemanager.dataprotection.implementation.ExportJobsOperationResultsImpl;
+import com.azure.resourcemanager.dataprotection.implementation.JobOperationsImpl;
+import com.azure.resourcemanager.dataprotection.implementation.JobsImpl;
+import com.azure.resourcemanager.dataprotection.implementation.OperationResultsImpl;
+import com.azure.resourcemanager.dataprotection.implementation.OperationsImpl;
+import com.azure.resourcemanager.dataprotection.implementation.RecoveryPointOperationsImpl;
+import com.azure.resourcemanager.dataprotection.implementation.RecoveryPointsImpl;
+import com.azure.resourcemanager.dataprotection.implementation.ResourceProvidersImpl;
+import com.azure.resourcemanager.dataprotection.models.BackupInstances;
+import com.azure.resourcemanager.dataprotection.models.BackupPolicies;
+import com.azure.resourcemanager.dataprotection.models.BackupVaults;
+import com.azure.resourcemanager.dataprotection.models.ExportJobs;
+import com.azure.resourcemanager.dataprotection.models.ExportJobsOperationResults;
+import com.azure.resourcemanager.dataprotection.models.JobOperations;
+import com.azure.resourcemanager.dataprotection.models.Jobs;
+import com.azure.resourcemanager.dataprotection.models.OperationResults;
+import com.azure.resourcemanager.dataprotection.models.Operations;
+import com.azure.resourcemanager.dataprotection.models.RecoveryPointOperations;
+import com.azure.resourcemanager.dataprotection.models.RecoveryPoints;
+import com.azure.resourcemanager.dataprotection.models.ResourceProviders;
+import java.time.Duration;
+import java.time.temporal.ChronoUnit;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Objects;
+
+/** Entry point to DataProtectionManager. Open API 2.0 Specs for Azure Data Protection service. */
+public final class DataProtectionManager {
+ private BackupVaults backupVaults;
+
+ private OperationResults operationResults;
+
+ private ResourceProviders resourceProviders;
+
+ private Operations operations;
+
+ private BackupPolicies backupPolicies;
+
+ private BackupInstances backupInstances;
+
+ private RecoveryPoints recoveryPoints;
+
+ private RecoveryPointOperations recoveryPointOperations;
+
+ private Jobs jobs;
+
+ private JobOperations jobOperations;
+
+ private ExportJobs exportJobs;
+
+ private ExportJobsOperationResults exportJobsOperationResults;
+
+ private final DataProtectionClient clientObject;
+
+ private DataProtectionManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
+ Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ this.clientObject =
+ new DataProtectionClientBuilder()
+ .pipeline(httpPipeline)
+ .endpoint(profile.getEnvironment().getResourceManagerEndpoint())
+ .subscriptionId(profile.getSubscriptionId())
+ .defaultPollInterval(defaultPollInterval)
+ .buildClient();
+ }
+
+ /**
+ * Creates an instance of DataProtection service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the DataProtection service API instance.
+ */
+ public static DataProtectionManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+ return configure().authenticate(credential, profile);
+ }
+
+ /**
+ * Gets a Configurable instance that can be used to create DataProtectionManager with optional configuration.
+ *
+ * @return the Configurable instance allowing configurations.
+ */
+ public static Configurable configure() {
+ return new DataProtectionManager.Configurable();
+ }
+
+ /** The Configurable allowing configurations to be set. */
+ public static final class Configurable {
+ private final ClientLogger logger = new ClientLogger(Configurable.class);
+
+ private HttpClient httpClient;
+ private HttpLogOptions httpLogOptions;
+ private final List policies = new ArrayList<>();
+ private RetryPolicy retryPolicy;
+ private Duration defaultPollInterval;
+
+ private Configurable() {
+ }
+
+ /**
+ * Sets the http client.
+ *
+ * @param httpClient the HTTP client.
+ * @return the configurable object itself.
+ */
+ public Configurable withHttpClient(HttpClient httpClient) {
+ this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the logging options to the HTTP pipeline.
+ *
+ * @param httpLogOptions the HTTP log options.
+ * @return the configurable object itself.
+ */
+ public Configurable withLogOptions(HttpLogOptions httpLogOptions) {
+ this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Adds the pipeline policy to the HTTP pipeline.
+ *
+ * @param policy the HTTP pipeline policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withPolicy(HttpPipelinePolicy policy) {
+ this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null."));
+ return this;
+ }
+
+ /**
+ * Sets the retry policy to the HTTP pipeline.
+ *
+ * @param retryPolicy the HTTP pipeline retry policy.
+ * @return the configurable object itself.
+ */
+ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
+ this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null.");
+ return this;
+ }
+
+ /**
+ * Sets the default poll interval, used when service does not provide "Retry-After" header.
+ *
+ * @param defaultPollInterval the default poll interval.
+ * @return the configurable object itself.
+ */
+ public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
+ this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
+ if (this.defaultPollInterval.isNegative()) {
+ throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
+ }
+ return this;
+ }
+
+ /**
+ * Creates an instance of DataProtection service API entry point.
+ *
+ * @param credential the credential to use.
+ * @param profile the Azure profile for client.
+ * @return the DataProtection service API instance.
+ */
+ public DataProtectionManager authenticate(TokenCredential credential, AzureProfile profile) {
+ Objects.requireNonNull(credential, "'credential' cannot be null.");
+ Objects.requireNonNull(profile, "'profile' cannot be null.");
+
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder
+ .append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.dataprotection")
+ .append("/")
+ .append("1.0.0-beta.1");
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder
+ .append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
+ if (retryPolicy == null) {
+ retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
+ }
+ List policies = new ArrayList<>();
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
+ policies.add(new RequestIdPolicy());
+ HttpPolicyProviders.addBeforeRetryPolicies(policies);
+ policies.add(retryPolicy);
+ policies.add(new AddDatePolicy());
+ policies
+ .add(
+ new BearerTokenAuthenticationPolicy(
+ credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
+ HttpPolicyProviders.addAfterRetryPolicies(policies);
+ policies.add(new HttpLoggingPolicy(httpLogOptions));
+ HttpPipeline httpPipeline =
+ new HttpPipelineBuilder()
+ .httpClient(httpClient)
+ .policies(policies.toArray(new HttpPipelinePolicy[0]))
+ .build();
+ return new DataProtectionManager(httpPipeline, profile, defaultPollInterval);
+ }
+ }
+
+ /** @return Resource collection API of BackupVaults. */
+ public BackupVaults backupVaults() {
+ if (this.backupVaults == null) {
+ this.backupVaults = new BackupVaultsImpl(clientObject.getBackupVaults(), this);
+ }
+ return backupVaults;
+ }
+
+ /** @return Resource collection API of OperationResults. */
+ public OperationResults operationResults() {
+ if (this.operationResults == null) {
+ this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this);
+ }
+ return operationResults;
+ }
+
+ /** @return Resource collection API of ResourceProviders. */
+ public ResourceProviders resourceProviders() {
+ if (this.resourceProviders == null) {
+ this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this);
+ }
+ return resourceProviders;
+ }
+
+ /** @return Resource collection API of Operations. */
+ public Operations operations() {
+ if (this.operations == null) {
+ this.operations = new OperationsImpl(clientObject.getOperations(), this);
+ }
+ return operations;
+ }
+
+ /** @return Resource collection API of BackupPolicies. */
+ public BackupPolicies backupPolicies() {
+ if (this.backupPolicies == null) {
+ this.backupPolicies = new BackupPoliciesImpl(clientObject.getBackupPolicies(), this);
+ }
+ return backupPolicies;
+ }
+
+ /** @return Resource collection API of BackupInstances. */
+ public BackupInstances backupInstances() {
+ if (this.backupInstances == null) {
+ this.backupInstances = new BackupInstancesImpl(clientObject.getBackupInstances(), this);
+ }
+ return backupInstances;
+ }
+
+ /** @return Resource collection API of RecoveryPoints. */
+ public RecoveryPoints recoveryPoints() {
+ if (this.recoveryPoints == null) {
+ this.recoveryPoints = new RecoveryPointsImpl(clientObject.getRecoveryPoints(), this);
+ }
+ return recoveryPoints;
+ }
+
+ /** @return Resource collection API of RecoveryPointOperations. */
+ public RecoveryPointOperations recoveryPointOperations() {
+ if (this.recoveryPointOperations == null) {
+ this.recoveryPointOperations =
+ new RecoveryPointOperationsImpl(clientObject.getRecoveryPointOperations(), this);
+ }
+ return recoveryPointOperations;
+ }
+
+ /** @return Resource collection API of Jobs. */
+ public Jobs jobs() {
+ if (this.jobs == null) {
+ this.jobs = new JobsImpl(clientObject.getJobs(), this);
+ }
+ return jobs;
+ }
+
+ /** @return Resource collection API of JobOperations. */
+ public JobOperations jobOperations() {
+ if (this.jobOperations == null) {
+ this.jobOperations = new JobOperationsImpl(clientObject.getJobOperations(), this);
+ }
+ return jobOperations;
+ }
+
+ /** @return Resource collection API of ExportJobs. */
+ public ExportJobs exportJobs() {
+ if (this.exportJobs == null) {
+ this.exportJobs = new ExportJobsImpl(clientObject.getExportJobs(), this);
+ }
+ return exportJobs;
+ }
+
+ /** @return Resource collection API of ExportJobsOperationResults. */
+ public ExportJobsOperationResults exportJobsOperationResults() {
+ if (this.exportJobsOperationResults == null) {
+ this.exportJobsOperationResults =
+ new ExportJobsOperationResultsImpl(clientObject.getExportJobsOperationResults(), this);
+ }
+ return exportJobsOperationResults;
+ }
+
+ /**
+ * @return Wrapped service client DataProtectionClient providing direct access to the underlying auto-generated API
+ * implementation, based on Azure REST API.
+ */
+ public DataProtectionClient serviceClient() {
+ return this.clientObject;
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupInstancesClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupInstancesClient.java
new file mode 100644
index 000000000000..fabb386014b4
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupInstancesClient.java
@@ -0,0 +1,549 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.dataprotection.fluent.models.BackupInstanceResourceInner;
+import com.azure.resourcemanager.dataprotection.models.AzureBackupRehydrationRequest;
+import com.azure.resourcemanager.dataprotection.models.AzureBackupRestoreRequest;
+import com.azure.resourcemanager.dataprotection.models.TriggerBackupRequest;
+import com.azure.resourcemanager.dataprotection.models.ValidateForBackupRequest;
+import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObject;
+
+/** An instance of this class provides access to all the operations defined in BackupInstancesClient. */
+public interface BackupInstancesClient {
+ /**
+ * Gets a backup instances belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instances belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable getBackupInstancesInVault(String vaultName, String resourceGroupName);
+
+ /**
+ * Gets a backup instances belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instances belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable getBackupInstancesInVault(
+ String vaultName, String resourceGroupName, Context context);
+
+ /**
+ * Gets a backup instance with name in a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instance with name in a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ BackupInstanceResourceInner get(String vaultName, String resourceGroupName, String backupInstanceName);
+
+ /**
+ * Gets a backup instance with name in a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instance with name in a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String vaultName, String resourceGroupName, String backupInstanceName, Context context);
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, BackupInstanceResourceInner> beginPut(
+ String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters);
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param 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 backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, BackupInstanceResourceInner> beginPut(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ BackupInstanceResourceInner parameters,
+ Context context);
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ BackupInstanceResourceInner put(
+ String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters);
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param 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 backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ BackupInstanceResourceInner put(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ BackupInstanceResourceInner parameters,
+ Context context);
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginDelete(
+ String vaultName, String resourceGroupName, String backupInstanceName);
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginDelete(
+ String vaultName, String resourceGroupName, String backupInstanceName, Context context);
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String vaultName, String resourceGroupName, String backupInstanceName);
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String vaultName, String resourceGroupName, String backupInstanceName, Context context);
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginAdhocBackup(
+ String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters);
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginAdhocBackup(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ TriggerBackupRequest parameters,
+ Context context);
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void adhocBackup(
+ String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters);
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void adhocBackup(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ TriggerBackupRequest parameters,
+ Context context);
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginValidateForBackup(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters);
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginValidateForBackup(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context);
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void validateForBackup(String vaultName, String resourceGroupName, ValidateForBackupRequest parameters);
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void validateForBackup(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context);
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginTriggerRehydrate(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters);
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginTriggerRehydrate(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters,
+ Context context);
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void triggerRehydrate(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters);
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void triggerRehydrate(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters,
+ Context context);
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginTriggerRestore(
+ String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters);
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginTriggerRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ AzureBackupRestoreRequest parameters,
+ Context context);
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void triggerRestore(
+ String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters);
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void triggerRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ AzureBackupRestoreRequest parameters,
+ Context context);
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginValidateRestore(
+ String vaultName, String resourceGroupName, String backupInstanceName, ValidateRestoreRequestObject parameters);
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginValidateRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters,
+ Context context);
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void validateRestore(
+ String vaultName, String resourceGroupName, String backupInstanceName, ValidateRestoreRequestObject parameters);
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void validateRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters,
+ Context context);
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupPoliciesClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupPoliciesClient.java
new file mode 100644
index 000000000000..22624ad8c3e7
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupPoliciesClient.java
@@ -0,0 +1,138 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.dataprotection.fluent.models.BaseBackupPolicyResourceInner;
+
+/** An instance of this class provides access to all the operations defined in BackupPoliciesClient. */
+public interface BackupPoliciesClient {
+ /**
+ * Returns list of backup policies belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.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 BaseBackupPolicy resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String vaultName, String resourceGroupName);
+
+ /**
+ * Returns list of backup policies belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 BaseBackupPolicy resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String vaultName, String resourceGroupName, Context context);
+
+ /**
+ * Gets a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup policy belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ BaseBackupPolicyResourceInner get(String vaultName, String resourceGroupName, String backupPolicyName);
+
+ /**
+ * Gets a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup policy belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String vaultName, String resourceGroupName, String backupPolicyName, Context context);
+
+ /**
+ * Creates or Updates a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName 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 baseBackupPolicy resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ BaseBackupPolicyResourceInner put(
+ String vaultName, String resourceGroupName, String backupPolicyName, BaseBackupPolicyResourceInner parameters);
+
+ /**
+ * Creates or Updates a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName 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 baseBackupPolicy resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response putWithResponse(
+ String vaultName,
+ String resourceGroupName,
+ String backupPolicyName,
+ BaseBackupPolicyResourceInner parameters,
+ Context context);
+
+ /**
+ * Deletes a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String vaultName, String resourceGroupName, String backupPolicyName);
+
+ /**
+ * Deletes a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(
+ String vaultName, String resourceGroupName, String backupPolicyName, Context context);
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupVaultsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupVaultsClient.java
new file mode 100644
index 000000000000..0263429a6b0e
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/BackupVaultsClient.java
@@ -0,0 +1,274 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.Response;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.dataprotection.fluent.models.BackupVaultResourceInner;
+import com.azure.resourcemanager.dataprotection.fluent.models.CheckNameAvailabilityResultInner;
+import com.azure.resourcemanager.dataprotection.models.CheckNameAvailabilityRequest;
+import com.azure.resourcemanager.dataprotection.models.PatchResourceRequestInput;
+
+/** An instance of this class provides access to all the operations defined in BackupVaultsClient. */
+public interface BackupVaultsClient {
+ /**
+ * Returns resource collection belonging to a subscription.
+ *
+ * @throws com.azure.core.management.exception.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 BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Returns resource collection belonging to a subscription.
+ *
+ * @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 BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+
+ /**
+ * Returns resource collection belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName);
+
+ /**
+ * Returns resource collection belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @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 BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByResourceGroup(String resourceGroupName, Context context);
+
+ /**
+ * Returns a resource belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ BackupVaultResourceInner getByResourceGroup(String resourceGroupName, String vaultName);
+
+ /**
+ * Returns a resource belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getByResourceGroupWithResponse(
+ String resourceGroupName, String vaultName, Context context);
+
+ /**
+ * Creates or updates a BackupVault resource belonging to a resource group.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, BackupVaultResourceInner> beginPut(
+ String vaultName, String resourceGroupName, BackupVaultResourceInner parameters);
+
+ /**
+ * Creates or updates a BackupVault resource belonging to a resource group.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, BackupVaultResourceInner> beginPut(
+ String vaultName, String resourceGroupName, BackupVaultResourceInner parameters, Context context);
+
+ /**
+ * Creates or updates a BackupVault resource belonging to a resource group.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ BackupVaultResourceInner put(String vaultName, String resourceGroupName, BackupVaultResourceInner parameters);
+
+ /**
+ * Creates or updates a BackupVault resource belonging to a resource group.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ BackupVaultResourceInner put(
+ String vaultName, String resourceGroupName, BackupVaultResourceInner parameters, Context context);
+
+ /**
+ * Deletes a BackupVault resource from the resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void delete(String resourceGroupName, String vaultName);
+
+ /**
+ * Deletes a BackupVault resource from the resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response deleteWithResponse(String resourceGroupName, String vaultName, Context context);
+
+ /**
+ * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, BackupVaultResourceInner> beginPatch(
+ String vaultName, String resourceGroupName, PatchResourceRequestInput parameters);
+
+ /**
+ * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, BackupVaultResourceInner> beginPatch(
+ String vaultName, String resourceGroupName, PatchResourceRequestInput parameters, Context context);
+
+ /**
+ * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ BackupVaultResourceInner patch(String vaultName, String resourceGroupName, PatchResourceRequestInput parameters);
+
+ /**
+ * Updates a BackupVault resource belonging to a resource group. For example, updating tags for a resource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ BackupVaultResourceInner patch(
+ String vaultName, String resourceGroupName, PatchResourceRequestInput parameters, Context context);
+
+ /**
+ * API to check for resource name availability.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param location The location in which uniqueness will be verified.
+ * @param parameters Check name availability request.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return checkNameAvailability Result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ CheckNameAvailabilityResultInner checkNameAvailability(
+ String resourceGroupName, String location, CheckNameAvailabilityRequest parameters);
+
+ /**
+ * API to check for resource name availability.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param location The location in which uniqueness will be verified.
+ * @param parameters Check name availability request.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return checkNameAvailability Result.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response checkNameAvailabilityWithResponse(
+ String resourceGroupName, String location, CheckNameAvailabilityRequest parameters, Context context);
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionClient.java
new file mode 100644
index 000000000000..f411dcb84dc8
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/DataProtectionClient.java
@@ -0,0 +1,130 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent;
+
+import com.azure.core.http.HttpPipeline;
+import java.time.Duration;
+
+/** The interface for DataProtectionClient class. */
+public interface DataProtectionClient {
+ /**
+ * Gets The subscription Id.
+ *
+ * @return the subscriptionId value.
+ */
+ String getSubscriptionId();
+
+ /**
+ * Gets server parameter.
+ *
+ * @return the endpoint value.
+ */
+ String getEndpoint();
+
+ /**
+ * Gets Api Version.
+ *
+ * @return the apiVersion value.
+ */
+ String getApiVersion();
+
+ /**
+ * Gets The HTTP pipeline to send requests through.
+ *
+ * @return the httpPipeline value.
+ */
+ HttpPipeline getHttpPipeline();
+
+ /**
+ * Gets The default poll interval for long-running operation.
+ *
+ * @return the defaultPollInterval value.
+ */
+ Duration getDefaultPollInterval();
+
+ /**
+ * Gets the BackupVaultsClient object to access its operations.
+ *
+ * @return the BackupVaultsClient object.
+ */
+ BackupVaultsClient getBackupVaults();
+
+ /**
+ * Gets the OperationResultsClient object to access its operations.
+ *
+ * @return the OperationResultsClient object.
+ */
+ OperationResultsClient getOperationResults();
+
+ /**
+ * Gets the ResourceProvidersClient object to access its operations.
+ *
+ * @return the ResourceProvidersClient object.
+ */
+ ResourceProvidersClient getResourceProviders();
+
+ /**
+ * Gets the OperationsClient object to access its operations.
+ *
+ * @return the OperationsClient object.
+ */
+ OperationsClient getOperations();
+
+ /**
+ * Gets the BackupPoliciesClient object to access its operations.
+ *
+ * @return the BackupPoliciesClient object.
+ */
+ BackupPoliciesClient getBackupPolicies();
+
+ /**
+ * Gets the BackupInstancesClient object to access its operations.
+ *
+ * @return the BackupInstancesClient object.
+ */
+ BackupInstancesClient getBackupInstances();
+
+ /**
+ * Gets the RecoveryPointsClient object to access its operations.
+ *
+ * @return the RecoveryPointsClient object.
+ */
+ RecoveryPointsClient getRecoveryPoints();
+
+ /**
+ * Gets the RecoveryPointOperationsClient object to access its operations.
+ *
+ * @return the RecoveryPointOperationsClient object.
+ */
+ RecoveryPointOperationsClient getRecoveryPointOperations();
+
+ /**
+ * Gets the JobsClient object to access its operations.
+ *
+ * @return the JobsClient object.
+ */
+ JobsClient getJobs();
+
+ /**
+ * Gets the JobOperationsClient object to access its operations.
+ *
+ * @return the JobOperationsClient object.
+ */
+ JobOperationsClient getJobOperations();
+
+ /**
+ * Gets the ExportJobsClient object to access its operations.
+ *
+ * @return the ExportJobsClient object.
+ */
+ ExportJobsClient getExportJobs();
+
+ /**
+ * Gets the ExportJobsOperationResultsClient object to access its operations.
+ *
+ * @return the ExportJobsOperationResultsClient object.
+ */
+ ExportJobsOperationResultsClient getExportJobsOperationResults();
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsClient.java
new file mode 100644
index 000000000000..d807fc789928
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsClient.java
@@ -0,0 +1,66 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.polling.SyncPoller;
+
+/** An instance of this class provides access to all the operations defined in ExportJobsClient. */
+public interface ExportJobsClient {
+ /**
+ * Triggers export of jobs and returns an OperationID to track.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginTrigger(String resourceGroupName, String vaultName);
+
+ /**
+ * Triggers export of jobs and returns an OperationID to track.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ SyncPoller, Void> beginTrigger(String resourceGroupName, String vaultName, Context context);
+
+ /**
+ * Triggers export of jobs and returns an OperationID to track.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void trigger(String resourceGroupName, String vaultName);
+
+ /**
+ * Triggers export of jobs and returns an OperationID to track.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void trigger(String resourceGroupName, String vaultName, Context context);
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsOperationResultsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsOperationResultsClient.java
new file mode 100644
index 000000000000..71636c714b0e
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ExportJobsOperationResultsClient.java
@@ -0,0 +1,48 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.dataprotection.fluent.models.ExportJobsResultInner;
+
+/** An instance of this class provides access to all the operations defined in ExportJobsOperationResultsClient. */
+public interface ExportJobsOperationResultsClient {
+ /**
+ * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also
+ * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized
+ * format.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param operationId OperationID which represents the export job.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the operation result of operation triggered by Export Jobs API.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ ExportJobsResultInner get(String resourceGroupName, String vaultName, String operationId);
+
+ /**
+ * Gets the operation result of operation triggered by Export Jobs API. If the operation is successful, then it also
+ * contains URL of a Blob and a SAS key to access the same. The blob contains exported jobs in JSON serialized
+ * format.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param operationId OperationID which represents the export job.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the operation result of operation triggered by Export Jobs API.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String vaultName, String operationId, Context context);
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/JobOperationsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/JobOperationsClient.java
new file mode 100644
index 000000000000..f9790253f668
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/JobOperationsClient.java
@@ -0,0 +1,44 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupJobResourceInner;
+
+/** An instance of this class provides access to all the operations defined in JobOperationsClient. */
+public interface JobOperationsClient {
+ /**
+ * Gets a job with id in a backup vault.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param jobId The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a job with id in a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AzureBackupJobResourceInner get(String resourceGroupName, String vaultName, String jobId);
+
+ /**
+ * Gets a job with id in a backup vault.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param jobId The Job ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000).
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a job with id in a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String resourceGroupName, String vaultName, String jobId, Context context);
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/JobsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/JobsClient.java
new file mode 100644
index 000000000000..3ed5d80431f1
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/JobsClient.java
@@ -0,0 +1,41 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupJobResourceInner;
+
+/** An instance of this class provides access to all the operations defined in JobsClient. */
+public interface JobsClient {
+ /**
+ * Returns list of jobs belonging to a backup vault.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of AzureBackup Job resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String vaultName);
+
+ /**
+ * Returns list of jobs belonging to a backup vault.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of AzureBackup Job resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(String resourceGroupName, String vaultName, Context context);
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationResultsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationResultsClient.java
new file mode 100644
index 000000000000..36d20ca2a9f4
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationResultsClient.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.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+
+/** An instance of this class provides access to all the operations defined in OperationResultsClient. */
+public interface OperationResultsClient {
+ /**
+ * Gets the operation result for a resource.
+ *
+ * @param operationId The operationId parameter.
+ * @param location The location parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ void get(String operationId, String location);
+
+ /**
+ * Gets the operation result for a resource.
+ *
+ * @param operationId The operationId parameter.
+ * @param location The location parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the operation result for a resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(String operationId, String location, Context context);
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationsClient.java
new file mode 100644
index 000000000000..ccb8bf0df683
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/OperationsClient.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.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.dataprotection.fluent.models.ClientDiscoveryValueForSingleApiInner;
+
+/** An instance of this class provides access to all the operations defined in OperationsClient. */
+public interface OperationsClient {
+ /**
+ * Returns the list of available operations.
+ *
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return operations List response which contains list of available APIs.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list();
+
+ /**
+ * Returns the list of available operations.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return operations List response which contains list of available APIs.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable list(Context context);
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RecoveryPointOperationsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RecoveryPointOperationsClient.java
new file mode 100644
index 000000000000..9fe22bdcc11c
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RecoveryPointOperationsClient.java
@@ -0,0 +1,47 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupRecoveryPointResourceInner;
+
+/** An instance of this class provides access to all the operations defined in RecoveryPointOperationsClient. */
+public interface RecoveryPointOperationsClient {
+ /**
+ * Gets a Recovery Point using recoveryPointId for a Datasource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param recoveryPointId The recoveryPointId parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Recovery Point using recoveryPointId for a Datasource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ AzureBackupRecoveryPointResourceInner get(
+ String vaultName, String resourceGroupName, String backupInstanceName, String recoveryPointId);
+
+ /**
+ * Gets a Recovery Point using recoveryPointId for a Datasource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param recoveryPointId The recoveryPointId parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a Recovery Point using recoveryPointId for a Datasource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getWithResponse(
+ String vaultName, String resourceGroupName, String backupInstanceName, String recoveryPointId, Context context);
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RecoveryPointsClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RecoveryPointsClient.java
new file mode 100644
index 000000000000..153cead8881d
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/RecoveryPointsClient.java
@@ -0,0 +1,45 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupRecoveryPointResourceInner;
+
+/** An instance of this class provides access to all the operations defined in RecoveryPointsClient. */
+public interface RecoveryPointsClient {
+ /**
+ * Returns a list of Recovery Points for a DataSource in a vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return azure backup recoveryPoint resource list.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable getList(
+ String vaultName, String resourceGroupName, String backupInstanceName);
+
+ /**
+ * Returns a list of Recovery Points for a DataSource in a vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return azure backup recoveryPoint resource list.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable getList(
+ String vaultName, String resourceGroupName, String backupInstanceName, Context context);
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ResourceProvidersClient.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ResourceProvidersClient.java
new file mode 100644
index 000000000000..9c804556cc46
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/ResourceProvidersClient.java
@@ -0,0 +1,99 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent;
+
+import com.azure.core.annotation.ReturnType;
+import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.Response;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.dataprotection.fluent.models.BackupVaultResourceInner;
+import com.azure.resourcemanager.dataprotection.fluent.models.FeatureValidationResponseBaseInner;
+import com.azure.resourcemanager.dataprotection.fluent.models.OperationResourceInner;
+import com.azure.resourcemanager.dataprotection.models.FeatureValidationRequestBase;
+
+/** An instance of this class provides access to all the operations defined in ResourceProvidersClient. */
+public interface ResourceProvidersClient {
+ /**
+ * Gets the operation status for a resource.
+ *
+ * @param location The location parameter.
+ * @param operationId The operationId parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the operation status for a resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ OperationResourceInner getOperationStatus(String location, String operationId);
+
+ /**
+ * Gets the operation status for a resource.
+ *
+ * @param location The location parameter.
+ * @param operationId The operationId parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the operation status for a resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getOperationStatusWithResponse(
+ String location, String operationId, Context context);
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param operationId The operationId parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ BackupVaultResourceInner getOperationResultPatch(String vaultName, String resourceGroupName, String operationId);
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param operationId The operationId parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response getOperationResultPatchWithResponse(
+ String vaultName, String resourceGroupName, String operationId, Context context);
+
+ /**
+ * Validates if a feature is supported.
+ *
+ * @param location The location parameter.
+ * @param parameters Feature support request object.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return base class for Backup Feature support.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ FeatureValidationResponseBaseInner checkFeatureSupport(String location, FeatureValidationRequestBase parameters);
+
+ /**
+ * Validates if a feature is supported.
+ *
+ * @param location The location parameter.
+ * @param parameters Feature support request object.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return base class for Backup Feature support.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ Response checkFeatureSupportWithResponse(
+ String location, FeatureValidationRequestBase parameters, Context context);
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupJobResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupJobResourceInner.java
new file mode 100644
index 000000000000..f3fc551c9511
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupJobResourceInner.java
@@ -0,0 +1,57 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.dataprotection.models.AzureBackupJob;
+import com.azure.resourcemanager.dataprotection.models.DppResource;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** AzureBackup Job Resource Class. */
+@Fluent
+public final class AzureBackupJobResourceInner extends DppResource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupJobResourceInner.class);
+
+ /*
+ * AzureBackupJobResource properties
+ */
+ @JsonProperty(value = "properties")
+ private AzureBackupJob properties;
+
+ /**
+ * Get the properties property: AzureBackupJobResource properties.
+ *
+ * @return the properties value.
+ */
+ public AzureBackupJob properties() {
+ return this.properties;
+ }
+
+ /**
+ * Set the properties property: AzureBackupJobResource properties.
+ *
+ * @param properties the properties value to set.
+ * @return the AzureBackupJobResourceInner object itself.
+ */
+ public AzureBackupJobResourceInner withProperties(AzureBackupJob properties) {
+ this.properties = properties;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ super.validate();
+ if (properties() != null) {
+ properties().validate();
+ }
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupRecoveryPointResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupRecoveryPointResourceInner.java
new file mode 100644
index 000000000000..bfe1f1ede704
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/AzureBackupRecoveryPointResourceInner.java
@@ -0,0 +1,28 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.annotation.JsonFlatten;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.dataprotection.models.DppResource;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+/** Azure backup recoveryPoint resource. */
+@JsonFlatten
+@Immutable
+public class AzureBackupRecoveryPointResourceInner extends DppResource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureBackupRecoveryPointResourceInner.class);
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ super.validate();
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupInstanceResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupInstanceResourceInner.java
new file mode 100644
index 000000000000..e073f1190445
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupInstanceResourceInner.java
@@ -0,0 +1,181 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.JsonFlatten;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.dataprotection.models.Datasource;
+import com.azure.resourcemanager.dataprotection.models.DatasourceSet;
+import com.azure.resourcemanager.dataprotection.models.DppResource;
+import com.azure.resourcemanager.dataprotection.models.PolicyInfo;
+import com.azure.resourcemanager.dataprotection.models.ProtectionStatusDetails;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** BackupInstance Resource. */
+@JsonFlatten
+@Fluent
+public class BackupInstanceResourceInner extends DppResource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInstanceResourceInner.class);
+
+ /*
+ * Gets or sets the data source information.
+ */
+ @JsonProperty(value = "properties.dataSourceInfo")
+ private Datasource dataSourceInfo;
+
+ /*
+ * Gets or sets the data source set information.
+ */
+ @JsonProperty(value = "properties.dataSourceSetInfo")
+ private DatasourceSet dataSourceSetInfo;
+
+ /*
+ * The objectType property.
+ */
+ @JsonProperty(value = "properties.objectType")
+ private String objectType;
+
+ /*
+ * Gets or sets the policy information.
+ */
+ @JsonProperty(value = "properties.policyInfo")
+ private PolicyInfo policyInfo;
+
+ /*
+ * Specifies the protection status of the resource
+ */
+ @JsonProperty(value = "properties.protectionStatus", access = JsonProperty.Access.WRITE_ONLY)
+ private ProtectionStatusDetails protectionStatus;
+
+ /*
+ * Specifies the provisioning state of the resource i.e.
+ * provisioning/updating/Succeeded/Failed
+ */
+ @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private String provisioningState;
+
+ /**
+ * Get the dataSourceInfo property: Gets or sets the data source information.
+ *
+ * @return the dataSourceInfo value.
+ */
+ public Datasource dataSourceInfo() {
+ return this.dataSourceInfo;
+ }
+
+ /**
+ * Set the dataSourceInfo property: Gets or sets the data source information.
+ *
+ * @param dataSourceInfo the dataSourceInfo value to set.
+ * @return the BackupInstanceResourceInner object itself.
+ */
+ public BackupInstanceResourceInner withDataSourceInfo(Datasource dataSourceInfo) {
+ this.dataSourceInfo = dataSourceInfo;
+ return this;
+ }
+
+ /**
+ * Get the dataSourceSetInfo property: Gets or sets the data source set information.
+ *
+ * @return the dataSourceSetInfo value.
+ */
+ public DatasourceSet dataSourceSetInfo() {
+ return this.dataSourceSetInfo;
+ }
+
+ /**
+ * Set the dataSourceSetInfo property: Gets or sets the data source set information.
+ *
+ * @param dataSourceSetInfo the dataSourceSetInfo value to set.
+ * @return the BackupInstanceResourceInner object itself.
+ */
+ public BackupInstanceResourceInner withDataSourceSetInfo(DatasourceSet dataSourceSetInfo) {
+ this.dataSourceSetInfo = dataSourceSetInfo;
+ return this;
+ }
+
+ /**
+ * Get the objectType property: The objectType property.
+ *
+ * @return the objectType value.
+ */
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * Set the objectType property: The objectType property.
+ *
+ * @param objectType the objectType value to set.
+ * @return the BackupInstanceResourceInner object itself.
+ */
+ public BackupInstanceResourceInner withObjectType(String objectType) {
+ this.objectType = objectType;
+ return this;
+ }
+
+ /**
+ * Get the policyInfo property: Gets or sets the policy information.
+ *
+ * @return the policyInfo value.
+ */
+ public PolicyInfo policyInfo() {
+ return this.policyInfo;
+ }
+
+ /**
+ * Set the policyInfo property: Gets or sets the policy information.
+ *
+ * @param policyInfo the policyInfo value to set.
+ * @return the BackupInstanceResourceInner object itself.
+ */
+ public BackupInstanceResourceInner withPolicyInfo(PolicyInfo policyInfo) {
+ this.policyInfo = policyInfo;
+ return this;
+ }
+
+ /**
+ * Get the protectionStatus property: Specifies the protection status of the resource.
+ *
+ * @return the protectionStatus value.
+ */
+ public ProtectionStatusDetails protectionStatus() {
+ return this.protectionStatus;
+ }
+
+ /**
+ * Get the provisioningState property: Specifies the provisioning state of the resource i.e.
+ * provisioning/updating/Succeeded/Failed.
+ *
+ * @return the provisioningState value.
+ */
+ public String provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ super.validate();
+ if (dataSourceInfo() != null) {
+ dataSourceInfo().validate();
+ }
+ if (dataSourceSetInfo() != null) {
+ dataSourceSetInfo().validate();
+ }
+ if (policyInfo() != null) {
+ policyInfo().validate();
+ }
+ if (protectionStatus() != null) {
+ protectionStatus().validate();
+ }
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupVaultResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupVaultResourceInner.java
new file mode 100644
index 000000000000..2abe1b279cba
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BackupVaultResourceInner.java
@@ -0,0 +1,106 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.JsonFlatten;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.dataprotection.models.DppIdentityDetails;
+import com.azure.resourcemanager.dataprotection.models.DppTrackedResource;
+import com.azure.resourcemanager.dataprotection.models.ProvisioningState;
+import com.azure.resourcemanager.dataprotection.models.StorageSetting;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+import java.util.Map;
+
+/** Backup Vault Resource. */
+@JsonFlatten
+@Fluent
+public class BackupVaultResourceInner extends DppTrackedResource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupVaultResourceInner.class);
+
+ /*
+ * Provisioning state of the BackupVault resource
+ */
+ @JsonProperty(value = "properties.provisioningState", access = JsonProperty.Access.WRITE_ONLY)
+ private ProvisioningState provisioningState;
+
+ /*
+ * Storage Settings
+ */
+ @JsonProperty(value = "properties.storageSettings")
+ private List storageSettings;
+
+ /**
+ * Get the provisioningState property: Provisioning state of the BackupVault resource.
+ *
+ * @return the provisioningState value.
+ */
+ public ProvisioningState provisioningState() {
+ return this.provisioningState;
+ }
+
+ /**
+ * Get the storageSettings property: Storage Settings.
+ *
+ * @return the storageSettings value.
+ */
+ public List storageSettings() {
+ return this.storageSettings;
+ }
+
+ /**
+ * Set the storageSettings property: Storage Settings.
+ *
+ * @param storageSettings the storageSettings value to set.
+ * @return the BackupVaultResourceInner object itself.
+ */
+ public BackupVaultResourceInner withStorageSettings(List storageSettings) {
+ this.storageSettings = storageSettings;
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public BackupVaultResourceInner withEtag(String etag) {
+ super.withEtag(etag);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public BackupVaultResourceInner withIdentity(DppIdentityDetails identity) {
+ super.withIdentity(identity);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public BackupVaultResourceInner withLocation(String location) {
+ super.withLocation(location);
+ return this;
+ }
+
+ /** {@inheritDoc} */
+ @Override
+ public BackupVaultResourceInner withTags(Map tags) {
+ super.withTags(tags);
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ super.validate();
+ if (storageSettings() != null) {
+ storageSettings().forEach(e -> e.validate());
+ }
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BaseBackupPolicyResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BaseBackupPolicyResourceInner.java
new file mode 100644
index 000000000000..b2cf54ee16ca
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/BaseBackupPolicyResourceInner.java
@@ -0,0 +1,56 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.JsonFlatten;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.dataprotection.models.DppResource;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.util.List;
+
+/** BaseBackupPolicy resource. */
+@JsonFlatten
+@Fluent
+public class BaseBackupPolicyResourceInner extends DppResource {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(BaseBackupPolicyResourceInner.class);
+
+ /*
+ * Type of datasource for the backup management
+ */
+ @JsonProperty(value = "properties.datasourceTypes")
+ private List datasourceTypes;
+
+ /**
+ * Get the datasourceTypes property: Type of datasource for the backup management.
+ *
+ * @return the datasourceTypes value.
+ */
+ public List datasourceTypes() {
+ return this.datasourceTypes;
+ }
+
+ /**
+ * Set the datasourceTypes property: Type of datasource for the backup management.
+ *
+ * @param datasourceTypes the datasourceTypes value to set.
+ * @return the BaseBackupPolicyResourceInner object itself.
+ */
+ public BaseBackupPolicyResourceInner withDatasourceTypes(List datasourceTypes) {
+ this.datasourceTypes = datasourceTypes;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ @Override
+ public void validate() {
+ super.validate();
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/CheckNameAvailabilityResultInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/CheckNameAvailabilityResultInner.java
new file mode 100644
index 000000000000..e11c9e3e7dfd
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/CheckNameAvailabilityResultInner.java
@@ -0,0 +1,102 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.util.logging.ClientLogger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** CheckNameAvailability Result. */
+@Fluent
+public final class CheckNameAvailabilityResultInner {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(CheckNameAvailabilityResultInner.class);
+
+ /*
+ * Gets or sets the message.
+ */
+ @JsonProperty(value = "message")
+ private String message;
+
+ /*
+ * Gets or sets a value indicating whether [name available].
+ */
+ @JsonProperty(value = "nameAvailable")
+ private Boolean nameAvailable;
+
+ /*
+ * Gets or sets the reason.
+ */
+ @JsonProperty(value = "reason")
+ private String reason;
+
+ /**
+ * Get the message property: Gets or sets the message.
+ *
+ * @return the message value.
+ */
+ public String message() {
+ return this.message;
+ }
+
+ /**
+ * Set the message property: Gets or sets the message.
+ *
+ * @param message the message value to set.
+ * @return the CheckNameAvailabilityResultInner object itself.
+ */
+ public CheckNameAvailabilityResultInner withMessage(String message) {
+ this.message = message;
+ return this;
+ }
+
+ /**
+ * Get the nameAvailable property: Gets or sets a value indicating whether [name available].
+ *
+ * @return the nameAvailable value.
+ */
+ public Boolean nameAvailable() {
+ return this.nameAvailable;
+ }
+
+ /**
+ * Set the nameAvailable property: Gets or sets a value indicating whether [name available].
+ *
+ * @param nameAvailable the nameAvailable value to set.
+ * @return the CheckNameAvailabilityResultInner object itself.
+ */
+ public CheckNameAvailabilityResultInner withNameAvailable(Boolean nameAvailable) {
+ this.nameAvailable = nameAvailable;
+ return this;
+ }
+
+ /**
+ * Get the reason property: Gets or sets the reason.
+ *
+ * @return the reason value.
+ */
+ public String reason() {
+ return this.reason;
+ }
+
+ /**
+ * Set the reason property: Gets or sets the reason.
+ *
+ * @param reason the reason value to set.
+ * @return the CheckNameAvailabilityResultInner object itself.
+ */
+ public CheckNameAvailabilityResultInner withReason(String reason) {
+ this.reason = reason;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ClientDiscoveryValueForSingleApiInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ClientDiscoveryValueForSingleApiInner.java
new file mode 100644
index 000000000000..0c05904d754a
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ClientDiscoveryValueForSingleApiInner.java
@@ -0,0 +1,168 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.JsonFlatten;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.dataprotection.models.ClientDiscoveryDisplay;
+import com.azure.resourcemanager.dataprotection.models.ClientDiscoveryForServiceSpecification;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** Available operation details. */
+@JsonFlatten
+@Fluent
+public class ClientDiscoveryValueForSingleApiInner {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ClientDiscoveryValueForSingleApiInner.class);
+
+ /*
+ * Contains the localized display information for this particular operation
+ */
+ @JsonProperty(value = "display")
+ private ClientDiscoveryDisplay display;
+
+ /*
+ * Name of the Operation.
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * Indicates whether the operation is a data action
+ */
+ @JsonProperty(value = "isDataAction")
+ private Boolean isDataAction;
+
+ /*
+ * The intended executor of the operation;governs the display of the
+ * operation in the RBAC UX and the audit logs UX
+ */
+ @JsonProperty(value = "origin")
+ private String origin;
+
+ /*
+ * Operation properties.
+ */
+ @JsonProperty(value = "properties.serviceSpecification")
+ private ClientDiscoveryForServiceSpecification serviceSpecification;
+
+ /**
+ * Get the display property: Contains the localized display information for this particular operation.
+ *
+ * @return the display value.
+ */
+ public ClientDiscoveryDisplay display() {
+ return this.display;
+ }
+
+ /**
+ * Set the display property: Contains the localized display information for this particular operation.
+ *
+ * @param display the display value to set.
+ * @return the ClientDiscoveryValueForSingleApiInner object itself.
+ */
+ public ClientDiscoveryValueForSingleApiInner withDisplay(ClientDiscoveryDisplay display) {
+ this.display = display;
+ return this;
+ }
+
+ /**
+ * Get the name property: Name of the Operation.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: Name of the Operation.
+ *
+ * @param name the name value to set.
+ * @return the ClientDiscoveryValueForSingleApiInner object itself.
+ */
+ public ClientDiscoveryValueForSingleApiInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the isDataAction property: Indicates whether the operation is a data action.
+ *
+ * @return the isDataAction value.
+ */
+ public Boolean isDataAction() {
+ return this.isDataAction;
+ }
+
+ /**
+ * Set the isDataAction property: Indicates whether the operation is a data action.
+ *
+ * @param isDataAction the isDataAction value to set.
+ * @return the ClientDiscoveryValueForSingleApiInner object itself.
+ */
+ public ClientDiscoveryValueForSingleApiInner withIsDataAction(Boolean isDataAction) {
+ this.isDataAction = isDataAction;
+ return this;
+ }
+
+ /**
+ * Get the origin property: The intended executor of the operation;governs the display of the operation in the RBAC
+ * UX and the audit logs UX.
+ *
+ * @return the origin value.
+ */
+ public String origin() {
+ return this.origin;
+ }
+
+ /**
+ * Set the origin property: The intended executor of the operation;governs the display of the operation in the RBAC
+ * UX and the audit logs UX.
+ *
+ * @param origin the origin value to set.
+ * @return the ClientDiscoveryValueForSingleApiInner object itself.
+ */
+ public ClientDiscoveryValueForSingleApiInner withOrigin(String origin) {
+ this.origin = origin;
+ return this;
+ }
+
+ /**
+ * Get the serviceSpecification property: Operation properties.
+ *
+ * @return the serviceSpecification value.
+ */
+ public ClientDiscoveryForServiceSpecification serviceSpecification() {
+ return this.serviceSpecification;
+ }
+
+ /**
+ * Set the serviceSpecification property: Operation properties.
+ *
+ * @param serviceSpecification the serviceSpecification value to set.
+ * @return the ClientDiscoveryValueForSingleApiInner object itself.
+ */
+ public ClientDiscoveryValueForSingleApiInner withServiceSpecification(
+ ClientDiscoveryForServiceSpecification serviceSpecification) {
+ this.serviceSpecification = serviceSpecification;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ if (display() != null) {
+ display().validate();
+ }
+ if (serviceSpecification() != null) {
+ serviceSpecification().validate();
+ }
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ExportJobsResultInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ExportJobsResultInner.java
new file mode 100644
index 000000000000..1fc6bb9a6ea2
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/ExportJobsResultInner.java
@@ -0,0 +1,85 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.util.logging.ClientLogger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+
+/** The result for export jobs containing blob details. */
+@Immutable
+public final class ExportJobsResultInner {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(ExportJobsResultInner.class);
+
+ /*
+ * URL of the blob into which the serialized string of list of jobs is
+ * exported.
+ */
+ @JsonProperty(value = "blobUrl", access = JsonProperty.Access.WRITE_ONLY)
+ private String blobUrl;
+
+ /*
+ * SAS key to access the blob.
+ */
+ @JsonProperty(value = "blobSasKey", access = JsonProperty.Access.WRITE_ONLY)
+ private String blobSasKey;
+
+ /*
+ * URL of the blob into which the ExcelFile is uploaded.
+ */
+ @JsonProperty(value = "excelFileBlobUrl", access = JsonProperty.Access.WRITE_ONLY)
+ private String excelFileBlobUrl;
+
+ /*
+ * SAS key to access the ExcelFile blob.
+ */
+ @JsonProperty(value = "excelFileBlobSasKey", access = JsonProperty.Access.WRITE_ONLY)
+ private String excelFileBlobSasKey;
+
+ /**
+ * Get the blobUrl property: URL of the blob into which the serialized string of list of jobs is exported.
+ *
+ * @return the blobUrl value.
+ */
+ public String blobUrl() {
+ return this.blobUrl;
+ }
+
+ /**
+ * Get the blobSasKey property: SAS key to access the blob.
+ *
+ * @return the blobSasKey value.
+ */
+ public String blobSasKey() {
+ return this.blobSasKey;
+ }
+
+ /**
+ * Get the excelFileBlobUrl property: URL of the blob into which the ExcelFile is uploaded.
+ *
+ * @return the excelFileBlobUrl value.
+ */
+ public String excelFileBlobUrl() {
+ return this.excelFileBlobUrl;
+ }
+
+ /**
+ * Get the excelFileBlobSasKey property: SAS key to access the ExcelFile blob.
+ *
+ * @return the excelFileBlobSasKey value.
+ */
+ public String excelFileBlobSasKey() {
+ return this.excelFileBlobSasKey;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/FeatureValidationResponseBaseInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/FeatureValidationResponseBaseInner.java
new file mode 100644
index 000000000000..0e9a3db10739
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/FeatureValidationResponseBaseInner.java
@@ -0,0 +1,34 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent.models;
+
+import com.azure.core.annotation.Immutable;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.dataprotection.models.FeatureValidationResponse;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonSubTypes;
+import com.fasterxml.jackson.annotation.JsonTypeInfo;
+import com.fasterxml.jackson.annotation.JsonTypeName;
+
+/** Base class for Backup Feature support. */
+@JsonTypeInfo(
+ use = JsonTypeInfo.Id.NAME,
+ include = JsonTypeInfo.As.PROPERTY,
+ property = "objectType",
+ defaultImpl = FeatureValidationResponseBaseInner.class)
+@JsonTypeName("FeatureValidationResponseBase")
+@JsonSubTypes({@JsonSubTypes.Type(name = "FeatureValidationResponse", value = FeatureValidationResponse.class)})
+@Immutable
+public class FeatureValidationResponseBaseInner {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(FeatureValidationResponseBaseInner.class);
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/OperationResourceInner.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/OperationResourceInner.java
new file mode 100644
index 000000000000..6cfd25af97b0
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/OperationResourceInner.java
@@ -0,0 +1,224 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.fluent.models;
+
+import com.azure.core.annotation.Fluent;
+import com.azure.core.annotation.JsonFlatten;
+import com.azure.core.management.exception.ManagementError;
+import com.azure.core.util.logging.ClientLogger;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import java.time.OffsetDateTime;
+
+/** Operation Resource. */
+@JsonFlatten
+@Fluent
+public class OperationResourceInner {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(OperationResourceInner.class);
+
+ /*
+ * End time of the operation
+ */
+ @JsonProperty(value = "endTime")
+ private OffsetDateTime endTime;
+
+ /*
+ * Required if status == failed or status == canceled. This is the OData v4
+ * error format, used by the RPC and will go into the v2.2 Azure REST API
+ * guidelines.
+ * The full set of optional properties (e.g. inner errors / details) can be
+ * found in the "Error Response" section.
+ */
+ @JsonProperty(value = "error")
+ private ManagementError error;
+
+ /*
+ * It should match what is used to GET the operation result
+ */
+ @JsonProperty(value = "id")
+ private String id;
+
+ /*
+ * It must match the last segment of the "id" field, and will typically be
+ * a GUID / system generated value
+ */
+ @JsonProperty(value = "name")
+ private String name;
+
+ /*
+ * Start time of the operation
+ */
+ @JsonProperty(value = "startTime")
+ private OffsetDateTime startTime;
+
+ /*
+ * The status property.
+ */
+ @JsonProperty(value = "status")
+ private String status;
+
+ /*
+ * This property will be used as the discriminator for deciding the
+ * specific types in the polymorphic chain of types.
+ */
+ @JsonProperty(value = "properties.objectType")
+ private String objectType;
+
+ /**
+ * Get the endTime property: End time of the operation.
+ *
+ * @return the endTime value.
+ */
+ public OffsetDateTime endTime() {
+ return this.endTime;
+ }
+
+ /**
+ * Set the endTime property: End time of the operation.
+ *
+ * @param endTime the endTime value to set.
+ * @return the OperationResourceInner object itself.
+ */
+ public OperationResourceInner withEndTime(OffsetDateTime endTime) {
+ this.endTime = endTime;
+ return this;
+ }
+
+ /**
+ * Get the error property: Required if status == failed or status == canceled. This is the OData v4 error format,
+ * used by the RPC and will go into the v2.2 Azure REST API guidelines. The full set of optional properties (e.g.
+ * inner errors / details) can be found in the "Error Response" section.
+ *
+ * @return the error value.
+ */
+ public ManagementError error() {
+ return this.error;
+ }
+
+ /**
+ * Set the error property: Required if status == failed or status == canceled. This is the OData v4 error format,
+ * used by the RPC and will go into the v2.2 Azure REST API guidelines. The full set of optional properties (e.g.
+ * inner errors / details) can be found in the "Error Response" section.
+ *
+ * @param error the error value to set.
+ * @return the OperationResourceInner object itself.
+ */
+ public OperationResourceInner withError(ManagementError error) {
+ this.error = error;
+ return this;
+ }
+
+ /**
+ * Get the id property: It should match what is used to GET the operation result.
+ *
+ * @return the id value.
+ */
+ public String id() {
+ return this.id;
+ }
+
+ /**
+ * Set the id property: It should match what is used to GET the operation result.
+ *
+ * @param id the id value to set.
+ * @return the OperationResourceInner object itself.
+ */
+ public OperationResourceInner withId(String id) {
+ this.id = id;
+ return this;
+ }
+
+ /**
+ * Get the name property: It must match the last segment of the "id" field, and will typically be a GUID / system
+ * generated value.
+ *
+ * @return the name value.
+ */
+ public String name() {
+ return this.name;
+ }
+
+ /**
+ * Set the name property: It must match the last segment of the "id" field, and will typically be a GUID / system
+ * generated value.
+ *
+ * @param name the name value to set.
+ * @return the OperationResourceInner object itself.
+ */
+ public OperationResourceInner withName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ /**
+ * Get the startTime property: Start time of the operation.
+ *
+ * @return the startTime value.
+ */
+ public OffsetDateTime startTime() {
+ return this.startTime;
+ }
+
+ /**
+ * Set the startTime property: Start time of the operation.
+ *
+ * @param startTime the startTime value to set.
+ * @return the OperationResourceInner object itself.
+ */
+ public OperationResourceInner withStartTime(OffsetDateTime startTime) {
+ this.startTime = startTime;
+ return this;
+ }
+
+ /**
+ * Get the status property: The status property.
+ *
+ * @return the status value.
+ */
+ public String status() {
+ return this.status;
+ }
+
+ /**
+ * Set the status property: The status property.
+ *
+ * @param status the status value to set.
+ * @return the OperationResourceInner object itself.
+ */
+ public OperationResourceInner withStatus(String status) {
+ this.status = status;
+ return this;
+ }
+
+ /**
+ * Get the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @return the objectType value.
+ */
+ public String objectType() {
+ return this.objectType;
+ }
+
+ /**
+ * Set the objectType property: This property will be used as the discriminator for deciding the specific types in
+ * the polymorphic chain of types.
+ *
+ * @param objectType the objectType value to set.
+ * @return the OperationResourceInner object itself.
+ */
+ public OperationResourceInner withObjectType(String objectType) {
+ this.objectType = objectType;
+ return this;
+ }
+
+ /**
+ * Validates the instance.
+ *
+ * @throws IllegalArgumentException thrown if the instance is not valid.
+ */
+ public void validate() {
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/package-info.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/package-info.java
new file mode 100644
index 000000000000..a6a6163c4875
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/models/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the inner data models for DataProtectionClient. Open API 2.0 Specs for Azure Data Protection
+ * service.
+ */
+package com.azure.resourcemanager.dataprotection.fluent.models;
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/package-info.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/package-info.java
new file mode 100644
index 000000000000..8494f21366f8
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/fluent/package-info.java
@@ -0,0 +1,9 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+/**
+ * Package containing the service clients for DataProtectionClient. Open API 2.0 Specs for Azure Data Protection
+ * service.
+ */
+package com.azure.resourcemanager.dataprotection.fluent;
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/AzureBackupJobResourceImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/AzureBackupJobResourceImpl.java
new file mode 100644
index 000000000000..2d7bc6978e15
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/AzureBackupJobResourceImpl.java
@@ -0,0 +1,50 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.implementation;
+
+import com.azure.resourcemanager.dataprotection.DataProtectionManager;
+import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupJobResourceInner;
+import com.azure.resourcemanager.dataprotection.models.AzureBackupJob;
+import com.azure.resourcemanager.dataprotection.models.AzureBackupJobResource;
+import com.azure.resourcemanager.dataprotection.models.SystemData;
+
+public final class AzureBackupJobResourceImpl implements AzureBackupJobResource {
+ private AzureBackupJobResourceInner innerObject;
+
+ private final DataProtectionManager serviceManager;
+
+ AzureBackupJobResourceImpl(AzureBackupJobResourceInner innerObject, DataProtectionManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public AzureBackupJob properties() {
+ return this.innerModel().properties();
+ }
+
+ public AzureBackupJobResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private DataProtectionManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/AzureBackupRecoveryPointResourceImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/AzureBackupRecoveryPointResourceImpl.java
new file mode 100644
index 000000000000..6e6633d8de61
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/AzureBackupRecoveryPointResourceImpl.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.resourcemanager.dataprotection.DataProtectionManager;
+import com.azure.resourcemanager.dataprotection.fluent.models.AzureBackupRecoveryPointResourceInner;
+import com.azure.resourcemanager.dataprotection.models.AzureBackupRecoveryPointResource;
+import com.azure.resourcemanager.dataprotection.models.SystemData;
+
+public final class AzureBackupRecoveryPointResourceImpl implements AzureBackupRecoveryPointResource {
+ private AzureBackupRecoveryPointResourceInner innerObject;
+
+ private final DataProtectionManager serviceManager;
+
+ AzureBackupRecoveryPointResourceImpl(
+ AzureBackupRecoveryPointResourceInner innerObject, DataProtectionManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public AzureBackupRecoveryPointResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private DataProtectionManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstanceResourceImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstanceResourceImpl.java
new file mode 100644
index 000000000000..0515e775f357
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstanceResourceImpl.java
@@ -0,0 +1,220 @@
+// 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.util.Context;
+import com.azure.resourcemanager.dataprotection.DataProtectionManager;
+import com.azure.resourcemanager.dataprotection.fluent.models.BackupInstanceResourceInner;
+import com.azure.resourcemanager.dataprotection.models.AzureBackupRehydrationRequest;
+import com.azure.resourcemanager.dataprotection.models.AzureBackupRestoreRequest;
+import com.azure.resourcemanager.dataprotection.models.BackupInstanceResource;
+import com.azure.resourcemanager.dataprotection.models.Datasource;
+import com.azure.resourcemanager.dataprotection.models.DatasourceSet;
+import com.azure.resourcemanager.dataprotection.models.PolicyInfo;
+import com.azure.resourcemanager.dataprotection.models.ProtectionStatusDetails;
+import com.azure.resourcemanager.dataprotection.models.SystemData;
+import com.azure.resourcemanager.dataprotection.models.TriggerBackupRequest;
+import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObject;
+
+public final class BackupInstanceResourceImpl
+ implements BackupInstanceResource, BackupInstanceResource.Definition, BackupInstanceResource.Update {
+ private BackupInstanceResourceInner innerObject;
+
+ private final 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 Datasource dataSourceInfo() {
+ return this.innerModel().dataSourceInfo();
+ }
+
+ public DatasourceSet dataSourceSetInfo() {
+ return this.innerModel().dataSourceSetInfo();
+ }
+
+ public String objectType() {
+ return this.innerModel().objectType();
+ }
+
+ public PolicyInfo policyInfo() {
+ return this.innerModel().policyInfo();
+ }
+
+ public ProtectionStatusDetails protectionStatus() {
+ return this.innerModel().protectionStatus();
+ }
+
+ public String provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public BackupInstanceResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private DataProtectionManager manager() {
+ return this.serviceManager;
+ }
+
+ private String vaultName;
+
+ private String resourceGroupName;
+
+ private String backupInstanceName;
+
+ public BackupInstanceResourceImpl withExistingBackupVault(String vaultName, String resourceGroupName) {
+ this.vaultName = vaultName;
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public BackupInstanceResource create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getBackupInstances()
+ .put(vaultName, resourceGroupName, backupInstanceName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public BackupInstanceResource create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getBackupInstances()
+ .put(vaultName, resourceGroupName, backupInstanceName, this.innerModel(), context);
+ return this;
+ }
+
+ BackupInstanceResourceImpl(String name, DataProtectionManager serviceManager) {
+ this.innerObject = new BackupInstanceResourceInner();
+ this.serviceManager = serviceManager;
+ this.backupInstanceName = name;
+ }
+
+ public BackupInstanceResourceImpl update() {
+ return this;
+ }
+
+ public BackupInstanceResource apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getBackupInstances()
+ .put(vaultName, resourceGroupName, backupInstanceName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public BackupInstanceResource apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getBackupInstances()
+ .put(vaultName, resourceGroupName, backupInstanceName, this.innerModel(), context);
+ return this;
+ }
+
+ BackupInstanceResourceImpl(BackupInstanceResourceInner innerObject, DataProtectionManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "backupVaults");
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.backupInstanceName = Utils.getValueFromIdByName(innerObject.id(), "backupInstances");
+ }
+
+ public BackupInstanceResource refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getBackupInstances()
+ .getWithResponse(vaultName, resourceGroupName, backupInstanceName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public BackupInstanceResource refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getBackupInstances()
+ .getWithResponse(vaultName, resourceGroupName, backupInstanceName, context)
+ .getValue();
+ return this;
+ }
+
+ public void adhocBackup(TriggerBackupRequest parameters) {
+ serviceManager.backupInstances().adhocBackup(vaultName, resourceGroupName, backupInstanceName, parameters);
+ }
+
+ public void adhocBackup(TriggerBackupRequest parameters, Context context) {
+ serviceManager
+ .backupInstances()
+ .adhocBackup(vaultName, resourceGroupName, backupInstanceName, parameters, context);
+ }
+
+ public void triggerRehydrate(AzureBackupRehydrationRequest parameters) {
+ serviceManager.backupInstances().triggerRehydrate(resourceGroupName, vaultName, backupInstanceName, parameters);
+ }
+
+ public void triggerRehydrate(AzureBackupRehydrationRequest parameters, Context context) {
+ serviceManager
+ .backupInstances()
+ .triggerRehydrate(resourceGroupName, vaultName, backupInstanceName, parameters, context);
+ }
+
+ public void triggerRestore(AzureBackupRestoreRequest parameters) {
+ serviceManager.backupInstances().triggerRestore(vaultName, resourceGroupName, backupInstanceName, parameters);
+ }
+
+ public void triggerRestore(AzureBackupRestoreRequest parameters, Context context) {
+ serviceManager
+ .backupInstances()
+ .triggerRestore(vaultName, resourceGroupName, backupInstanceName, parameters, context);
+ }
+
+ public void validateRestore(ValidateRestoreRequestObject parameters) {
+ serviceManager.backupInstances().validateRestore(vaultName, resourceGroupName, backupInstanceName, parameters);
+ }
+
+ public void validateRestore(ValidateRestoreRequestObject parameters, Context context) {
+ serviceManager
+ .backupInstances()
+ .validateRestore(vaultName, resourceGroupName, backupInstanceName, parameters, context);
+ }
+
+ public BackupInstanceResourceImpl withDataSourceInfo(Datasource dataSourceInfo) {
+ this.innerModel().withDataSourceInfo(dataSourceInfo);
+ return this;
+ }
+
+ public BackupInstanceResourceImpl withDataSourceSetInfo(DatasourceSet dataSourceSetInfo) {
+ this.innerModel().withDataSourceSetInfo(dataSourceSetInfo);
+ return this;
+ }
+
+ public BackupInstanceResourceImpl withObjectType(String objectType) {
+ this.innerModel().withObjectType(objectType);
+ return this;
+ }
+
+ public BackupInstanceResourceImpl withPolicyInfo(PolicyInfo policyInfo) {
+ this.innerModel().withPolicyInfo(policyInfo);
+ return this;
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesClientImpl.java
new file mode 100644
index 000000000000..a099fdad2c71
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesClientImpl.java
@@ -0,0 +1,2668 @@
+// 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.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.dataprotection.fluent.BackupInstancesClient;
+import com.azure.resourcemanager.dataprotection.fluent.models.BackupInstanceResourceInner;
+import com.azure.resourcemanager.dataprotection.models.AzureBackupRehydrationRequest;
+import com.azure.resourcemanager.dataprotection.models.AzureBackupRestoreRequest;
+import com.azure.resourcemanager.dataprotection.models.BackupInstanceResourceList;
+import com.azure.resourcemanager.dataprotection.models.TriggerBackupRequest;
+import com.azure.resourcemanager.dataprotection.models.ValidateForBackupRequest;
+import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObject;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in BackupInstancesClient. */
+public final class BackupInstancesClientImpl implements BackupInstancesClient {
+ private final ClientLogger logger = new ClientLogger(BackupInstancesClientImpl.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final BackupInstancesService service;
+
+ /** The service client containing this operation class. */
+ private final DataProtectionClientImpl client;
+
+ /**
+ * Initializes an instance of BackupInstancesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ BackupInstancesClientImpl(DataProtectionClientImpl client) {
+ this.service =
+ RestProxy.create(BackupInstancesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DataProtectionClientBackupInstances to be used by the proxy service
+ * to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "DataProtectionClient")
+ private interface BackupInstancesService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection"
+ + "/backupVaults/{vaultName}/backupInstances")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getBackupInstancesInVault(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @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}/backupInstances/{backupInstanceName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("backupInstanceName") String backupInstanceName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection"
+ + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> put(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("backupInstanceName") String backupInstanceName,
+ @BodyParam("application/json") BackupInstanceResourceInner parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection"
+ + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}")
+ @ExpectedResponses({200, 202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> delete(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("backupInstanceName") String backupInstanceName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection"
+ + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/backup")
+ @ExpectedResponses({202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> adhocBackup(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("backupInstanceName") String backupInstanceName,
+ @BodyParam("application/json") TriggerBackupRequest parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection"
+ + "/backupVaults/{vaultName}/validateForBackup")
+ @ExpectedResponses({202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> validateForBackup(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") ValidateForBackupRequest parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection"
+ + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/rehydrate")
+ @ExpectedResponses({202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> triggerRehydrate(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("backupInstanceName") String backupInstanceName,
+ @BodyParam("application/json") AzureBackupRehydrationRequest parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection"
+ + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/restore")
+ @ExpectedResponses({202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> triggerRestore(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("backupInstanceName") String backupInstanceName,
+ @BodyParam("application/json") AzureBackupRestoreRequest parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection"
+ + "/backupVaults/{vaultName}/backupInstances/{backupInstanceName}/validateRestore")
+ @ExpectedResponses({202, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> validateRestore(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("backupInstanceName") String backupInstanceName,
+ @BodyParam("application/json") ValidateRestoreRequestObject parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getBackupInstancesInVaultNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Gets a backup instances belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instances belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getBackupInstancesInVaultSinglePageAsync(
+ String vaultName, String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getBackupInstancesInVault(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets a backup instances belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instances belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getBackupInstancesInVaultSinglePageAsync(
+ String vaultName, String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getBackupInstancesInVault(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Gets a backup instances belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instances belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux getBackupInstancesInVaultAsync(
+ String vaultName, String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> getBackupInstancesInVaultSinglePageAsync(vaultName, resourceGroupName),
+ nextLink -> getBackupInstancesInVaultNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Gets a backup instances belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instances belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux getBackupInstancesInVaultAsync(
+ String vaultName, String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> getBackupInstancesInVaultSinglePageAsync(vaultName, resourceGroupName, context),
+ nextLink -> getBackupInstancesInVaultNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Gets a backup instances belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instances belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable getBackupInstancesInVault(
+ String vaultName, String resourceGroupName) {
+ return new PagedIterable<>(getBackupInstancesInVaultAsync(vaultName, resourceGroupName));
+ }
+
+ /**
+ * Gets a backup instances belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instances belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable getBackupInstancesInVault(
+ String vaultName, String resourceGroupName, Context context) {
+ return new PagedIterable<>(getBackupInstancesInVaultAsync(vaultName, resourceGroupName, context));
+ }
+
+ /**
+ * Gets a backup instance with name in a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instance with name in a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupInstanceName,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets a backup instance with name in a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instance with name in a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupInstanceName,
+ accept,
+ context);
+ }
+
+ /**
+ * Gets a backup instance with name in a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instance with name in a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName) {
+ return getWithResponseAsync(vaultName, resourceGroupName, backupInstanceName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets a backup instance with name in a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instance with name in a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public BackupInstanceResourceInner get(String vaultName, String resourceGroupName, String backupInstanceName) {
+ return getAsync(vaultName, resourceGroupName, backupInstanceName).block();
+ }
+
+ /**
+ * Gets a backup instance with name in a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup instance with name in a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String vaultName, String resourceGroupName, String backupInstanceName, Context context) {
+ return getWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, context).block();
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> putWithResponseAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .put(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupInstanceName,
+ parameters,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> putWithResponseAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ BackupInstanceResourceInner parameters,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .put(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupInstanceName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, BackupInstanceResourceInner> beginPutAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters) {
+ Mono>> mono =
+ putWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ BackupInstanceResourceInner.class,
+ BackupInstanceResourceInner.class,
+ Context.NONE);
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, BackupInstanceResourceInner> beginPutAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ BackupInstanceResourceInner parameters,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ putWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ BackupInstanceResourceInner.class,
+ BackupInstanceResourceInner.class,
+ context);
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, BackupInstanceResourceInner> beginPut(
+ String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters) {
+ return beginPutAsync(vaultName, resourceGroupName, backupInstanceName, parameters).getSyncPoller();
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, BackupInstanceResourceInner> beginPut(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ BackupInstanceResourceInner parameters,
+ Context context) {
+ return beginPutAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context).getSyncPoller();
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono putAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters) {
+ return beginPutAsync(vaultName, resourceGroupName, backupInstanceName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono putAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ BackupInstanceResourceInner parameters,
+ Context context) {
+ return beginPutAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public BackupInstanceResourceInner put(
+ String vaultName, String resourceGroupName, String backupInstanceName, BackupInstanceResourceInner parameters) {
+ return putAsync(vaultName, resourceGroupName, backupInstanceName, parameters).block();
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public BackupInstanceResourceInner put(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ BackupInstanceResourceInner parameters,
+ Context context) {
+ return putAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context).block();
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupInstanceName,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> deleteWithResponseAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupInstanceName,
+ accept,
+ context);
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginDeleteAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName) {
+ Mono>> mono =
+ deleteWithResponseAsync(vaultName, resourceGroupName, backupInstanceName);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginDeleteAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ deleteWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginDelete(
+ String vaultName, String resourceGroupName, String backupInstanceName) {
+ return beginDeleteAsync(vaultName, resourceGroupName, backupInstanceName).getSyncPoller();
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginDelete(
+ String vaultName, String resourceGroupName, String backupInstanceName, Context context) {
+ return beginDeleteAsync(vaultName, resourceGroupName, backupInstanceName, context).getSyncPoller();
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String vaultName, String resourceGroupName, String backupInstanceName) {
+ return beginDeleteAsync(vaultName, resourceGroupName, backupInstanceName)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, Context context) {
+ return beginDeleteAsync(vaultName, resourceGroupName, backupInstanceName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String vaultName, String resourceGroupName, String backupInstanceName) {
+ deleteAsync(vaultName, resourceGroupName, backupInstanceName).block();
+ }
+
+ /**
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String vaultName, String resourceGroupName, String backupInstanceName, Context context) {
+ deleteAsync(vaultName, resourceGroupName, backupInstanceName, context).block();
+ }
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> adhocBackupWithResponseAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .adhocBackup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupInstanceName,
+ parameters,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> adhocBackupWithResponseAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ TriggerBackupRequest parameters,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .adhocBackup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupInstanceName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginAdhocBackupAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters) {
+ Mono>> mono =
+ adhocBackupWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
+ }
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginAdhocBackupAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ TriggerBackupRequest parameters,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ adhocBackupWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginAdhocBackup(
+ String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters) {
+ return beginAdhocBackupAsync(vaultName, resourceGroupName, backupInstanceName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginAdhocBackup(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ TriggerBackupRequest parameters,
+ Context context) {
+ return beginAdhocBackupAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono adhocBackupAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters) {
+ return beginAdhocBackupAsync(vaultName, resourceGroupName, backupInstanceName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono adhocBackupAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ TriggerBackupRequest parameters,
+ Context context) {
+ return beginAdhocBackupAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void adhocBackup(
+ String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters) {
+ adhocBackupAsync(vaultName, resourceGroupName, backupInstanceName, parameters).block();
+ }
+
+ /**
+ * Trigger adhoc backup.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void adhocBackup(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ TriggerBackupRequest parameters,
+ Context context) {
+ adhocBackupAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context).block();
+ }
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> validateForBackupWithResponseAsync(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (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
+ .validateForBackup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ parameters,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> validateForBackupWithResponseAsync(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (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
+ .validateForBackup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginValidateForBackupAsync(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters) {
+ Mono>> mono =
+ validateForBackupWithResponseAsync(vaultName, resourceGroupName, parameters);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
+ }
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginValidateForBackupAsync(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ validateForBackupWithResponseAsync(vaultName, resourceGroupName, parameters, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginValidateForBackup(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters) {
+ return beginValidateForBackupAsync(vaultName, resourceGroupName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginValidateForBackup(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context) {
+ return beginValidateForBackupAsync(vaultName, resourceGroupName, parameters, context).getSyncPoller();
+ }
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono validateForBackupAsync(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters) {
+ return beginValidateForBackupAsync(vaultName, resourceGroupName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono validateForBackupAsync(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context) {
+ return beginValidateForBackupAsync(vaultName, resourceGroupName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void validateForBackup(String vaultName, String resourceGroupName, ValidateForBackupRequest parameters) {
+ validateForBackupAsync(vaultName, resourceGroupName, parameters).block();
+ }
+
+ /**
+ * Validate whether adhoc backup will be successful or not.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void validateForBackup(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context) {
+ validateForBackupAsync(vaultName, resourceGroupName, parameters, context).block();
+ }
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> triggerRehydrateWithResponseAsync(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .triggerRehydrate(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ vaultName,
+ backupInstanceName,
+ parameters,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> triggerRehydrateWithResponseAsync(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest 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 (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .triggerRehydrate(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ vaultName,
+ backupInstanceName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginTriggerRehydrateAsync(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters) {
+ Mono>> mono =
+ triggerRehydrateWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
+ }
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginTriggerRehydrateAsync(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ triggerRehydrateWithResponseAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginTriggerRehydrate(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters) {
+ return beginTriggerRehydrateAsync(resourceGroupName, vaultName, backupInstanceName, parameters).getSyncPoller();
+ }
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginTriggerRehydrate(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters,
+ Context context) {
+ return beginTriggerRehydrateAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono triggerRehydrateAsync(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters) {
+ return beginTriggerRehydrateAsync(resourceGroupName, vaultName, backupInstanceName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono triggerRehydrateAsync(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters,
+ Context context) {
+ return beginTriggerRehydrateAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void triggerRehydrate(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters) {
+ triggerRehydrateAsync(resourceGroupName, vaultName, backupInstanceName, parameters).block();
+ }
+
+ /**
+ * rehydrate recovery point for restore for a BackupInstance.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param backupInstanceName The backupInstanceName parameter.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @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 triggerRehydrate(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters,
+ Context context) {
+ triggerRehydrateAsync(resourceGroupName, vaultName, backupInstanceName, parameters, context).block();
+ }
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> triggerRestoreWithResponseAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .triggerRestore(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupInstanceName,
+ parameters,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> triggerRestoreWithResponseAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ AzureBackupRestoreRequest parameters,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .triggerRestore(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupInstanceName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginTriggerRestoreAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters) {
+ Mono>> mono =
+ triggerRestoreWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
+ }
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginTriggerRestoreAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ AzureBackupRestoreRequest parameters,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ triggerRestoreWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginTriggerRestore(
+ String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters) {
+ return beginTriggerRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginTriggerRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ AzureBackupRestoreRequest parameters,
+ Context context) {
+ return beginTriggerRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono triggerRestoreAsync(
+ String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters) {
+ return beginTriggerRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono triggerRestoreAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ AzureBackupRestoreRequest parameters,
+ Context context) {
+ return beginTriggerRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void triggerRestore(
+ String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters) {
+ triggerRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters).block();
+ }
+
+ /**
+ * Triggers restore for a BackupInstance.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void triggerRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ AzureBackupRestoreRequest parameters,
+ Context context) {
+ triggerRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context).block();
+ }
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> validateRestoreWithResponseAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .validateRestore(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupInstanceName,
+ parameters,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> validateRestoreWithResponseAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupInstanceName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupInstanceName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .validateRestore(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupInstanceName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginValidateRestoreAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters) {
+ Mono>> mono =
+ validateRestoreWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE);
+ }
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, Void> beginValidateRestoreAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters,
+ Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono =
+ validateRestoreWithResponseAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context);
+ return this
+ .client
+ .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context);
+ }
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginValidateRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters) {
+ return beginValidateRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters).getSyncPoller();
+ }
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller, Void> beginValidateRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters,
+ Context context) {
+ return beginValidateRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context)
+ .getSyncPoller();
+ }
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono validateRestoreAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters) {
+ return beginValidateRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono validateRestoreAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters,
+ Context context) {
+ return beginValidateRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void validateRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters) {
+ validateRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters).block();
+ }
+
+ /**
+ * Validates if Restore can be triggered for a DataSource.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupInstanceName The name of the backup instance.
+ * @param parameters Request body for operation.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void validateRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters,
+ Context context) {
+ validateRestoreAsync(vaultName, resourceGroupName, backupInstanceName, parameters, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource list response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getBackupInstancesInVaultNextSinglePageAsync(
+ 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.getBackupInstancesInVaultNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backupInstance Resource list response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getBackupInstancesInVaultNextSinglePageAsync(
+ 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
+ .getBackupInstancesInVaultNext(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/BackupInstancesImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesImpl.java
new file mode 100644
index 000000000000..90682c7789c0
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupInstancesImpl.java
@@ -0,0 +1,271 @@
+// 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.DataProtectionManager;
+import com.azure.resourcemanager.dataprotection.fluent.BackupInstancesClient;
+import com.azure.resourcemanager.dataprotection.fluent.models.BackupInstanceResourceInner;
+import com.azure.resourcemanager.dataprotection.models.AzureBackupRehydrationRequest;
+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.TriggerBackupRequest;
+import com.azure.resourcemanager.dataprotection.models.ValidateForBackupRequest;
+import com.azure.resourcemanager.dataprotection.models.ValidateRestoreRequestObject;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public final class BackupInstancesImpl implements BackupInstances {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupInstancesImpl.class);
+
+ private final BackupInstancesClient innerClient;
+
+ private final DataProtectionManager serviceManager;
+
+ public BackupInstancesImpl(BackupInstancesClient innerClient, DataProtectionManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable getBackupInstancesInVault(String vaultName, String resourceGroupName) {
+ PagedIterable inner =
+ this.serviceClient().getBackupInstancesInVault(vaultName, resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new BackupInstanceResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable getBackupInstancesInVault(
+ String vaultName, String resourceGroupName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().getBackupInstancesInVault(vaultName, resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new BackupInstanceResourceImpl(inner1, this.manager()));
+ }
+
+ public BackupInstanceResource get(String vaultName, String resourceGroupName, String backupInstanceName) {
+ BackupInstanceResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName, backupInstanceName);
+ if (inner != null) {
+ return new BackupInstanceResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getWithResponse(
+ String vaultName, String resourceGroupName, String backupInstanceName, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(vaultName, resourceGroupName, backupInstanceName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new BackupInstanceResourceImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public void delete(String vaultName, String resourceGroupName, String backupInstanceName) {
+ this.serviceClient().delete(vaultName, resourceGroupName, backupInstanceName);
+ }
+
+ public void delete(String vaultName, String resourceGroupName, String backupInstanceName, Context context) {
+ this.serviceClient().delete(vaultName, resourceGroupName, backupInstanceName, context);
+ }
+
+ public void adhocBackup(
+ String vaultName, String resourceGroupName, String backupInstanceName, TriggerBackupRequest parameters) {
+ this.serviceClient().adhocBackup(vaultName, resourceGroupName, backupInstanceName, parameters);
+ }
+
+ public void adhocBackup(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ TriggerBackupRequest parameters,
+ Context context) {
+ this.serviceClient().adhocBackup(vaultName, resourceGroupName, backupInstanceName, parameters, context);
+ }
+
+ public void validateForBackup(String vaultName, String resourceGroupName, ValidateForBackupRequest parameters) {
+ this.serviceClient().validateForBackup(vaultName, resourceGroupName, parameters);
+ }
+
+ public void validateForBackup(
+ String vaultName, String resourceGroupName, ValidateForBackupRequest parameters, Context context) {
+ this.serviceClient().validateForBackup(vaultName, resourceGroupName, parameters, context);
+ }
+
+ public void triggerRehydrate(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters) {
+ this.serviceClient().triggerRehydrate(resourceGroupName, vaultName, backupInstanceName, parameters);
+ }
+
+ public void triggerRehydrate(
+ String resourceGroupName,
+ String vaultName,
+ String backupInstanceName,
+ AzureBackupRehydrationRequest parameters,
+ Context context) {
+ this.serviceClient().triggerRehydrate(resourceGroupName, vaultName, backupInstanceName, parameters, context);
+ }
+
+ public void triggerRestore(
+ String vaultName, String resourceGroupName, String backupInstanceName, AzureBackupRestoreRequest parameters) {
+ this.serviceClient().triggerRestore(vaultName, resourceGroupName, backupInstanceName, parameters);
+ }
+
+ public void triggerRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ AzureBackupRestoreRequest parameters,
+ Context context) {
+ this.serviceClient().triggerRestore(vaultName, resourceGroupName, backupInstanceName, parameters, context);
+ }
+
+ public void validateRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters) {
+ this.serviceClient().validateRestore(vaultName, resourceGroupName, backupInstanceName, parameters);
+ }
+
+ public void validateRestore(
+ String vaultName,
+ String resourceGroupName,
+ String backupInstanceName,
+ ValidateRestoreRequestObject parameters,
+ Context context) {
+ this.serviceClient().validateRestore(vaultName, resourceGroupName, backupInstanceName, parameters, context);
+ }
+
+ public BackupInstanceResource getById(String id) {
+ String vaultName = Utils.getValueFromIdByName(id, "backupVaults");
+ if (vaultName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id)));
+ }
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String backupInstanceName = Utils.getValueFromIdByName(id, "backupInstances");
+ if (backupInstanceName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'backupInstances'.", id)));
+ }
+ return this.getWithResponse(vaultName, resourceGroupName, backupInstanceName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String vaultName = Utils.getValueFromIdByName(id, "backupVaults");
+ if (vaultName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id)));
+ }
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String backupInstanceName = Utils.getValueFromIdByName(id, "backupInstances");
+ if (backupInstanceName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'backupInstances'.", id)));
+ }
+ return this.getWithResponse(vaultName, resourceGroupName, backupInstanceName, context);
+ }
+
+ public void deleteById(String id) {
+ String vaultName = Utils.getValueFromIdByName(id, "backupVaults");
+ if (vaultName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id)));
+ }
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String backupInstanceName = Utils.getValueFromIdByName(id, "backupInstances");
+ if (backupInstanceName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'backupInstances'.", id)));
+ }
+ this.delete(vaultName, resourceGroupName, backupInstanceName, Context.NONE);
+ }
+
+ public void deleteByIdWithResponse(String id, Context context) {
+ String vaultName = Utils.getValueFromIdByName(id, "backupVaults");
+ if (vaultName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id)));
+ }
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String backupInstanceName = Utils.getValueFromIdByName(id, "backupInstances");
+ if (backupInstanceName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'backupInstances'.", id)));
+ }
+ this.delete(vaultName, resourceGroupName, backupInstanceName, context);
+ }
+
+ private BackupInstancesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private DataProtectionManager manager() {
+ return this.serviceManager;
+ }
+
+ public BackupInstanceResourceImpl define(String name) {
+ return new BackupInstanceResourceImpl(name, this.manager());
+ }
+}
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
new file mode 100644
index 000000000000..983f4f9373e6
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupPoliciesClientImpl.java
@@ -0,0 +1,902 @@
+// 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.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.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.dataprotection.fluent.BackupPoliciesClient;
+import com.azure.resourcemanager.dataprotection.fluent.models.BaseBackupPolicyResourceInner;
+import com.azure.resourcemanager.dataprotection.models.BaseBackupPolicyResourceList;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in BackupPoliciesClient. */
+public final class BackupPoliciesClientImpl implements BackupPoliciesClient {
+ private final ClientLogger logger = new ClientLogger(BackupPoliciesClientImpl.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final BackupPoliciesService service;
+
+ /** The service client containing this operation class. */
+ private final DataProtectionClientImpl client;
+
+ /**
+ * Initializes an instance of BackupPoliciesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ BackupPoliciesClientImpl(DataProtectionClientImpl client) {
+ this.service =
+ RestProxy.create(BackupPoliciesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DataProtectionClientBackupPolicies to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "DataProtectionClient")
+ private interface BackupPoliciesService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/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("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @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}/backupPolicies/{backupPolicyName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("backupPolicyName") String backupPolicyName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection"
+ + "/backupVaults/{vaultName}/backupPolicies/{backupPolicyName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> put(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("backupPolicyName") String backupPolicyName,
+ @BodyParam("application/json") BaseBackupPolicyResourceInner parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/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("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("backupPolicyName") String backupPolicyName,
+ @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 list of backup policies belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 BaseBackupPolicy resources.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String vaultName, String resourceGroupName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Returns list of backup policies belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 BaseBackupPolicy resources.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String vaultName, String resourceGroupName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Returns list of backup policies belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 BaseBackupPolicy resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(String vaultName, String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(vaultName, resourceGroupName), nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns list of backup policies belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 BaseBackupPolicy resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(
+ String vaultName, String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(vaultName, resourceGroupName, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Returns list of backup policies belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 BaseBackupPolicy resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String vaultName, String resourceGroupName) {
+ return new PagedIterable<>(listAsync(vaultName, resourceGroupName));
+ }
+
+ /**
+ * Returns list of backup policies belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 BaseBackupPolicy resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(
+ String vaultName, String resourceGroupName, Context context) {
+ return new PagedIterable<>(listAsync(vaultName, resourceGroupName, context));
+ }
+
+ /**
+ * Gets a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup policy belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String vaultName, String resourceGroupName, String backupPolicyName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupPolicyName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupPolicyName,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Gets a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup policy belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String vaultName, String resourceGroupName, String backupPolicyName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupPolicyName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupPolicyName,
+ accept,
+ context);
+ }
+
+ /**
+ * Gets a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup policy belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getAsync(
+ String vaultName, String resourceGroupName, String backupPolicyName) {
+ return getWithResponseAsync(vaultName, resourceGroupName, backupPolicyName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Gets a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup policy belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public BaseBackupPolicyResourceInner get(String vaultName, String resourceGroupName, String backupPolicyName) {
+ return getAsync(vaultName, resourceGroupName, backupPolicyName).block();
+ }
+
+ /**
+ * Gets a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a backup policy belonging to a backup vault.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String vaultName, String resourceGroupName, String backupPolicyName, Context context) {
+ return getWithResponseAsync(vaultName, resourceGroupName, backupPolicyName, context).block();
+ }
+
+ /**
+ * Creates or Updates a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName 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 baseBackupPolicy resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> putWithResponseAsync(
+ String vaultName, String resourceGroupName, String backupPolicyName, BaseBackupPolicyResourceInner parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupPolicyName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .put(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupPolicyName,
+ parameters,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Creates or Updates a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName 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 baseBackupPolicy resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> putWithResponseAsync(
+ String vaultName,
+ String resourceGroupName,
+ String backupPolicyName,
+ BaseBackupPolicyResourceInner parameters,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupPolicyName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .put(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupPolicyName,
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Creates or Updates a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName 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 baseBackupPolicy resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono putAsync(
+ String vaultName, String resourceGroupName, String backupPolicyName, BaseBackupPolicyResourceInner parameters) {
+ return putWithResponseAsync(vaultName, resourceGroupName, backupPolicyName, parameters)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Creates or Updates a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName 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 baseBackupPolicy resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public BaseBackupPolicyResourceInner put(
+ String vaultName, String resourceGroupName, String backupPolicyName, BaseBackupPolicyResourceInner parameters) {
+ return putAsync(vaultName, resourceGroupName, backupPolicyName, parameters).block();
+ }
+
+ /**
+ * Creates or Updates a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName 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 baseBackupPolicy resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response putWithResponse(
+ String vaultName,
+ String resourceGroupName,
+ String backupPolicyName,
+ BaseBackupPolicyResourceInner parameters,
+ Context context) {
+ return putWithResponseAsync(vaultName, resourceGroupName, backupPolicyName, parameters, context).block();
+ }
+
+ /**
+ * Deletes a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(
+ String vaultName, String resourceGroupName, String backupPolicyName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupPolicyName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupPolicyName,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Deletes a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(
+ String vaultName, String resourceGroupName, String backupPolicyName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (backupPolicyName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter backupPolicyName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ backupPolicyName,
+ accept,
+ context);
+ }
+
+ /**
+ * Deletes a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the completion.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono deleteAsync(String vaultName, String resourceGroupName, String backupPolicyName) {
+ return deleteWithResponseAsync(vaultName, resourceGroupName, backupPolicyName)
+ .flatMap((Response res) -> Mono.empty());
+ }
+
+ /**
+ * Deletes a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void delete(String vaultName, String resourceGroupName, String backupPolicyName) {
+ deleteAsync(vaultName, resourceGroupName, backupPolicyName).block();
+ }
+
+ /**
+ * Deletes a backup policy belonging to a backup vault.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param backupPolicyName The backupPolicyName parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteWithResponse(
+ String vaultName, String resourceGroupName, String backupPolicyName, Context context) {
+ return deleteWithResponseAsync(vaultName, resourceGroupName, backupPolicyName, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of BaseBackupPolicy resources.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of BaseBackupPolicy resources.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupPoliciesImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupPoliciesImpl.java
new file mode 100644
index 000000000000..8317d19e1e2b
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupPoliciesImpl.java
@@ -0,0 +1,194 @@
+// 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.DataProtectionManager;
+import com.azure.resourcemanager.dataprotection.fluent.BackupPoliciesClient;
+import com.azure.resourcemanager.dataprotection.fluent.models.BaseBackupPolicyResourceInner;
+import com.azure.resourcemanager.dataprotection.models.BackupPolicies;
+import com.azure.resourcemanager.dataprotection.models.BaseBackupPolicyResource;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+
+public final class BackupPoliciesImpl implements BackupPolicies {
+ @JsonIgnore private final ClientLogger logger = new ClientLogger(BackupPoliciesImpl.class);
+
+ private final BackupPoliciesClient innerClient;
+
+ private final DataProtectionManager serviceManager;
+
+ public BackupPoliciesImpl(BackupPoliciesClient innerClient, DataProtectionManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list(String vaultName, String resourceGroupName) {
+ PagedIterable inner = this.serviceClient().list(vaultName, resourceGroupName);
+ return Utils.mapPage(inner, inner1 -> new BaseBackupPolicyResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(String vaultName, String resourceGroupName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().list(vaultName, resourceGroupName, context);
+ return Utils.mapPage(inner, inner1 -> new BaseBackupPolicyResourceImpl(inner1, this.manager()));
+ }
+
+ public BaseBackupPolicyResource get(String vaultName, String resourceGroupName, String backupPolicyName) {
+ BaseBackupPolicyResourceInner inner = this.serviceClient().get(vaultName, resourceGroupName, backupPolicyName);
+ if (inner != null) {
+ return new BaseBackupPolicyResourceImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response getWithResponse(
+ String vaultName, String resourceGroupName, String backupPolicyName, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(vaultName, resourceGroupName, backupPolicyName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new BaseBackupPolicyResourceImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public void delete(String vaultName, String resourceGroupName, String backupPolicyName) {
+ this.serviceClient().delete(vaultName, resourceGroupName, backupPolicyName);
+ }
+
+ public Response deleteWithResponse(
+ String vaultName, String resourceGroupName, String backupPolicyName, Context context) {
+ return this.serviceClient().deleteWithResponse(vaultName, resourceGroupName, backupPolicyName, context);
+ }
+
+ public BaseBackupPolicyResource getById(String id) {
+ String vaultName = Utils.getValueFromIdByName(id, "backupVaults");
+ if (vaultName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id)));
+ }
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies");
+ if (backupPolicyName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id)));
+ }
+ return this.getWithResponse(vaultName, resourceGroupName, backupPolicyName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String vaultName = Utils.getValueFromIdByName(id, "backupVaults");
+ if (vaultName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id)));
+ }
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies");
+ if (backupPolicyName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id)));
+ }
+ return this.getWithResponse(vaultName, resourceGroupName, backupPolicyName, context);
+ }
+
+ public void deleteById(String id) {
+ String vaultName = Utils.getValueFromIdByName(id, "backupVaults");
+ if (vaultName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id)));
+ }
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies");
+ if (backupPolicyName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id)));
+ }
+ this.deleteWithResponse(vaultName, resourceGroupName, backupPolicyName, Context.NONE).getValue();
+ }
+
+ public Response deleteByIdWithResponse(String id, Context context) {
+ String vaultName = Utils.getValueFromIdByName(id, "backupVaults");
+ if (vaultName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'backupVaults'.", id)));
+ }
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String backupPolicyName = Utils.getValueFromIdByName(id, "backupPolicies");
+ if (backupPolicyName == null) {
+ throw logger
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'backupPolicies'.", id)));
+ }
+ return this.deleteWithResponse(vaultName, resourceGroupName, backupPolicyName, context);
+ }
+
+ private BackupPoliciesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private DataProtectionManager manager() {
+ return this.serviceManager;
+ }
+
+ public BaseBackupPolicyResourceImpl define(String name) {
+ return new BaseBackupPolicyResourceImpl(name, this.manager());
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultResourceImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultResourceImpl.java
new file mode 100644
index 000000000000..21fc30aa23d7
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultResourceImpl.java
@@ -0,0 +1,221 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.dataprotection.implementation;
+
+import com.azure.core.management.Region;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.dataprotection.DataProtectionManager;
+import com.azure.resourcemanager.dataprotection.fluent.models.BackupVaultResourceInner;
+import com.azure.resourcemanager.dataprotection.models.BackupVaultResource;
+import com.azure.resourcemanager.dataprotection.models.DppIdentityDetails;
+import com.azure.resourcemanager.dataprotection.models.PatchResourceRequestInput;
+import com.azure.resourcemanager.dataprotection.models.ProvisioningState;
+import com.azure.resourcemanager.dataprotection.models.StorageSetting;
+import com.azure.resourcemanager.dataprotection.models.SystemData;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
+public final class BackupVaultResourceImpl
+ implements BackupVaultResource, BackupVaultResource.Definition, BackupVaultResource.Update {
+ private BackupVaultResourceInner innerObject;
+
+ private final DataProtectionManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String location() {
+ return this.innerModel().location();
+ }
+
+ public Map tags() {
+ Map inner = this.innerModel().tags();
+ if (inner != null) {
+ return Collections.unmodifiableMap(inner);
+ } else {
+ return Collections.emptyMap();
+ }
+ }
+
+ public String etag() {
+ return this.innerModel().etag();
+ }
+
+ public DppIdentityDetails identity() {
+ return this.innerModel().identity();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public ProvisioningState provisioningState() {
+ return this.innerModel().provisioningState();
+ }
+
+ public List storageSettings() {
+ List inner = this.innerModel().storageSettings();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public Region region() {
+ return Region.fromName(this.regionName());
+ }
+
+ public String regionName() {
+ return this.location();
+ }
+
+ public BackupVaultResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private DataProtectionManager manager() {
+ return this.serviceManager;
+ }
+
+ private String vaultName;
+
+ private String resourceGroupName;
+
+ private PatchResourceRequestInput updateParameters;
+
+ public BackupVaultResourceImpl withExistingResourceGroup(String resourceGroupName) {
+ this.resourceGroupName = resourceGroupName;
+ return this;
+ }
+
+ public BackupVaultResource create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getBackupVaults()
+ .put(vaultName, resourceGroupName, this.innerModel(), Context.NONE);
+ return this;
+ }
+
+ public BackupVaultResource create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getBackupVaults()
+ .put(vaultName, resourceGroupName, this.innerModel(), context);
+ return this;
+ }
+
+ BackupVaultResourceImpl(String name, DataProtectionManager serviceManager) {
+ this.innerObject = new BackupVaultResourceInner();
+ this.serviceManager = serviceManager;
+ this.vaultName = name;
+ }
+
+ public BackupVaultResourceImpl update() {
+ this.updateParameters = new PatchResourceRequestInput();
+ return this;
+ }
+
+ public BackupVaultResource apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getBackupVaults()
+ .patch(vaultName, resourceGroupName, updateParameters, Context.NONE);
+ return this;
+ }
+
+ public BackupVaultResource apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getBackupVaults()
+ .patch(vaultName, resourceGroupName, updateParameters, context);
+ return this;
+ }
+
+ BackupVaultResourceImpl(BackupVaultResourceInner innerObject, DataProtectionManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.vaultName = Utils.getValueFromIdByName(innerObject.id(), "backupVaults");
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ }
+
+ public BackupVaultResource refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getBackupVaults()
+ .getByResourceGroupWithResponse(resourceGroupName, vaultName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public BackupVaultResource refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getBackupVaults()
+ .getByResourceGroupWithResponse(resourceGroupName, vaultName, context)
+ .getValue();
+ return this;
+ }
+
+ public BackupVaultResourceImpl withRegion(Region location) {
+ this.innerModel().withLocation(location.toString());
+ return this;
+ }
+
+ public BackupVaultResourceImpl withRegion(String location) {
+ this.innerModel().withLocation(location);
+ return this;
+ }
+
+ public BackupVaultResourceImpl withTags(Map tags) {
+ if (isInCreateMode()) {
+ this.innerModel().withTags(tags);
+ return this;
+ } else {
+ this.updateParameters.withTags(tags);
+ return this;
+ }
+ }
+
+ public BackupVaultResourceImpl withEtag(String etag) {
+ this.innerModel().withEtag(etag);
+ return this;
+ }
+
+ public BackupVaultResourceImpl withIdentity(DppIdentityDetails identity) {
+ if (isInCreateMode()) {
+ this.innerModel().withIdentity(identity);
+ return this;
+ } else {
+ this.updateParameters.withIdentity(identity);
+ return this;
+ }
+ }
+
+ public BackupVaultResourceImpl withStorageSettings(List storageSettings) {
+ this.innerModel().withStorageSettings(storageSettings);
+ return this;
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultsClientImpl.java b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultsClientImpl.java
new file mode 100644
index 000000000000..1bf1d5489e25
--- /dev/null
+++ b/sdk/dataprotection/azure-resourcemanager-dataprotection/src/main/java/com/azure/resourcemanager/dataprotection/implementation/BackupVaultsClientImpl.java
@@ -0,0 +1,1645 @@
+// 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.Patch;
+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.management.polling.PollResult;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.core.util.polling.PollerFlux;
+import com.azure.core.util.polling.SyncPoller;
+import com.azure.resourcemanager.dataprotection.fluent.BackupVaultsClient;
+import com.azure.resourcemanager.dataprotection.fluent.models.BackupVaultResourceInner;
+import com.azure.resourcemanager.dataprotection.fluent.models.CheckNameAvailabilityResultInner;
+import com.azure.resourcemanager.dataprotection.models.BackupVaultResourceList;
+import com.azure.resourcemanager.dataprotection.models.CheckNameAvailabilityRequest;
+import com.azure.resourcemanager.dataprotection.models.PatchResourceRequestInput;
+import java.nio.ByteBuffer;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in BackupVaultsClient. */
+public final class BackupVaultsClientImpl implements BackupVaultsClient {
+ private final ClientLogger logger = new ClientLogger(BackupVaultsClientImpl.class);
+
+ /** The proxy service used to perform REST calls. */
+ private final BackupVaultsService service;
+
+ /** The service client containing this operation class. */
+ private final DataProtectionClientImpl client;
+
+ /**
+ * Initializes an instance of BackupVaultsClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ BackupVaultsClientImpl(DataProtectionClientImpl client) {
+ this.service =
+ RestProxy.create(BackupVaultsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DataProtectionClientBackupVaults to be used by the proxy service to
+ * perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "DataProtectionClient")
+ private interface BackupVaultsService {
+ @Headers({"Content-Type: application/json"})
+ @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DataProtection/backupVaults")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/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") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/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("resourceGroupName") String resourceGroupName,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection"
+ + "/backupVaults/{vaultName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> put(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") BackupVaultResourceInner parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/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("resourceGroupName") String resourceGroupName,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DataProtection"
+ + "/backupVaults/{vaultName}")
+ @ExpectedResponses({200, 202})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono>> patch(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("vaultName") String vaultName,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @BodyParam("application/json") PatchResourceRequestInput parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Post(
+ "/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") String subscriptionId,
+ @PathParam("location") String location,
+ @BodyParam("application/json") CheckNameAvailabilityRequest parameters,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getResourcesInSubscriptionNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> getResourcesInResourceGroupNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Returns resource collection belonging to a subscription.
+ *
+ * @throws 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 BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync() {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Returns resource collection belonging to a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Returns resource collection belonging to a subscription.
+ *
+ * @throws 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 BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync() {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(), nextLink -> getResourcesInSubscriptionNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns resource collection belonging to a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(context),
+ nextLink -> getResourcesInSubscriptionNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Returns resource collection belonging to a subscription.
+ *
+ * @throws 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 BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list() {
+ return new PagedIterable<>(listAsync());
+ }
+
+ /**
+ * Returns resource collection belonging to a subscription.
+ *
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(Context context) {
+ return new PagedIterable<>(listAsync(context));
+ }
+
+ /**
+ * Returns resource collection belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
+ 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."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Returns resource collection belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByResourceGroupSinglePageAsync(
+ String resourceGroupName, 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."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Returns resource collection belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName),
+ nextLink -> getResourcesInResourceGroupNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Returns resource collection belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
+ return new PagedFlux<>(
+ () -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
+ nextLink -> getResourcesInResourceGroupNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Returns resource collection belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return list of BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
+ }
+
+ /**
+ * Returns resource collection belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws 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 BackupVault resources.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
+ return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
+ }
+
+ /**
+ * Returns a resource belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ 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 (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 (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ vaultName,
+ this.client.getSubscriptionId(),
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Returns a resource belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getByResourceGroupWithResponseAsync(
+ 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 (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 (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .getByResourceGroup(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ resourceGroupName,
+ vaultName,
+ this.client.getSubscriptionId(),
+ accept,
+ context);
+ }
+
+ /**
+ * Returns a resource belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono getByResourceGroupAsync(String resourceGroupName, String vaultName) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName)
+ .flatMap(
+ (Response res) -> {
+ if (res.getValue() != null) {
+ return Mono.just(res.getValue());
+ } else {
+ return Mono.empty();
+ }
+ });
+ }
+
+ /**
+ * Returns a resource belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public BackupVaultResourceInner getByResourceGroup(String resourceGroupName, String vaultName) {
+ return getByResourceGroupAsync(resourceGroupName, vaultName).block();
+ }
+
+ /**
+ * Returns a resource belonging to a resource group.
+ *
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param vaultName The name of the backup vault.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getByResourceGroupWithResponse(
+ String resourceGroupName, String vaultName, Context context) {
+ return getByResourceGroupWithResponseAsync(resourceGroupName, vaultName, context).block();
+ }
+
+ /**
+ * Creates or updates a BackupVault resource belonging to a resource group.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> putWithResponseAsync(
+ String vaultName, String resourceGroupName, BackupVaultResourceInner parameters) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .put(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ parameters,
+ accept,
+ context))
+ .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ }
+
+ /**
+ * Creates or updates a BackupVault resource belonging to a resource group.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono>> putWithResponseAsync(
+ String vaultName, String resourceGroupName, BackupVaultResourceInner parameters, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (vaultName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter vaultName is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ if (parameters == null) {
+ return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
+ } else {
+ parameters.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .put(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ vaultName,
+ resourceGroupName,
+ this.client.getSubscriptionId(),
+ parameters,
+ accept,
+ context);
+ }
+
+ /**
+ * Creates or updates a BackupVault resource belonging to a resource group.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, BackupVaultResourceInner> beginPutAsync(
+ String vaultName, String resourceGroupName, BackupVaultResourceInner parameters) {
+ Mono>> mono = putWithResponseAsync(vaultName, resourceGroupName, parameters);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ BackupVaultResourceInner.class,
+ BackupVaultResourceInner.class,
+ Context.NONE);
+ }
+
+ /**
+ * Creates or updates a BackupVault resource belonging to a resource group.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private PollerFlux, BackupVaultResourceInner> beginPutAsync(
+ String vaultName, String resourceGroupName, BackupVaultResourceInner parameters, Context context) {
+ context = this.client.mergeContext(context);
+ Mono>> mono = putWithResponseAsync(vaultName, resourceGroupName, parameters, context);
+ return this
+ .client
+ .getLroResult(
+ mono,
+ this.client.getHttpPipeline(),
+ BackupVaultResourceInner.class,
+ BackupVaultResourceInner.class,
+ context);
+ }
+
+ /**
+ * Creates or updates a BackupVault resource belonging to a resource group.
+ *
+ * @param vaultName The name of the backup vault.
+ * @param resourceGroupName The name of the resource group where the backup vault is present.
+ * @param 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 backup Vault Resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public SyncPoller