Skip to content

Commit

Permalink
CodeGen from PR 18624 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Dev dataprotection microsoft.data protection 2022 03 31 preview (Azure#18624)

* Adds base for updating Microsoft.DataProtection from version preview/2022-02-01-preview to version 2022-03-31-preview

* Updates readme

* Updates API version in new specs and examples

* Changes from 2022-03-01

* Adding extension routing API

* Prettier fix

* Undo unintentional changes

* Revert "Prettier fix"

This reverts commit 3ac4c11592e7bba2297d14d0183ced1c444c2103.

* Adding autoheal settings

* Adding x-ms-parameter-location

* Fixing example resourceId and extension resource path

Co-authored-by: chandrasekarendran <59728024+chandrasekarendran@users.noreply.github.com>
  • Loading branch information
SDKAuto and chandrasekarendran committed Apr 26, 2022
1 parent f60709a commit 9ba6bc9
Show file tree
Hide file tree
Showing 276 changed files with 6,884 additions and 3,272 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.1 (2022-04-26)

- Azure Resource Manager DataProtection client library for Java. This package contains Microsoft Azure SDK for DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-preview-2022-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Azure Resource Manager DataProtection client library for Java.

This package contains Microsoft Azure SDK for DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-2021-07. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
This package contains Microsoft Azure SDK for DataProtection Management SDK. Open API 2.0 Specs for Azure Data Protection service. Package tag package-preview-2022-03. 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

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-dataprotection</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.2</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
454 changes: 366 additions & 88 deletions sdk/dataprotection/azure-resourcemanager-dataprotection/SAMPLE.md

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for DataProtection Management</name>
<description>This package contains Microsoft Azure SDK for DataProtection Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Open API 2.0 Specs for Azure Data Protection service. Package tag package-2021-07.</description>
<description>This package contains Microsoft Azure SDK for DataProtection Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Open API 2.0 Specs for Azure Data Protection service. Package tag package-preview-2022-03.</description>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,21 @@
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
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.BackupInstancesExtensionRoutingsImpl;
import com.azure.resourcemanager.dataprotection.implementation.BackupInstancesImpl;
import com.azure.resourcemanager.dataprotection.implementation.BackupPoliciesImpl;
import com.azure.resourcemanager.dataprotection.implementation.BackupVaultOperationResultsImpl;
Expand All @@ -33,11 +36,14 @@
import com.azure.resourcemanager.dataprotection.implementation.ExportJobsOperationResultsImpl;
import com.azure.resourcemanager.dataprotection.implementation.JobsImpl;
import com.azure.resourcemanager.dataprotection.implementation.OperationResultsImpl;
import com.azure.resourcemanager.dataprotection.implementation.OperationStatusBackupVaultContextsImpl;
import com.azure.resourcemanager.dataprotection.implementation.OperationStatusImpl;
import com.azure.resourcemanager.dataprotection.implementation.OperationStatusResourceGroupContextsImpl;
import com.azure.resourcemanager.dataprotection.implementation.RecoveryPointsImpl;
import com.azure.resourcemanager.dataprotection.implementation.ResourceGuardsImpl;
import com.azure.resourcemanager.dataprotection.implementation.RestorableTimeRangesImpl;
import com.azure.resourcemanager.dataprotection.models.BackupInstances;
import com.azure.resourcemanager.dataprotection.models.BackupInstancesExtensionRoutings;
import com.azure.resourcemanager.dataprotection.models.BackupPolicies;
import com.azure.resourcemanager.dataprotection.models.BackupVaultOperationResults;
import com.azure.resourcemanager.dataprotection.models.BackupVaults;
Expand All @@ -48,6 +54,8 @@
import com.azure.resourcemanager.dataprotection.models.Jobs;
import com.azure.resourcemanager.dataprotection.models.OperationResults;
import com.azure.resourcemanager.dataprotection.models.OperationStatus;
import com.azure.resourcemanager.dataprotection.models.OperationStatusBackupVaultContexts;
import com.azure.resourcemanager.dataprotection.models.OperationStatusResourceGroupContexts;
import com.azure.resourcemanager.dataprotection.models.RecoveryPoints;
import com.azure.resourcemanager.dataprotection.models.ResourceGuards;
import com.azure.resourcemanager.dataprotection.models.RestorableTimeRanges;
Expand All @@ -66,6 +74,10 @@ public final class DataProtectionManager {

private OperationStatus operationStatus;

private OperationStatusBackupVaultContexts operationStatusBackupVaultContexts;

private OperationStatusResourceGroupContexts operationStatusResourceGroupContexts;

private BackupVaultOperationResults backupVaultOperationResults;

private DataProtections dataProtections;
Expand All @@ -76,6 +88,8 @@ public final class DataProtectionManager {

private BackupInstances backupInstances;

private BackupInstancesExtensionRoutings backupInstancesExtensionRoutings;

private RecoveryPoints recoveryPoints;

private Jobs jobs;
Expand Down Expand Up @@ -115,6 +129,19 @@ public static DataProtectionManager authenticate(TokenCredential credential, Azu
return configure().authenticate(credential, profile);
}

/**
* Creates an instance of DataProtection service API entry point.
*
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the DataProtection service API instance.
*/
public static DataProtectionManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
return new DataProtectionManager(httpPipeline, profile, null);
}

/**
* Gets a Configurable instance that can be used to create DataProtectionManager with optional configuration.
*
Expand All @@ -126,13 +153,14 @@ public static Configurable configure() {

/** The Configurable allowing configurations to be set. */
public static final class Configurable {
private final ClientLogger logger = new ClientLogger(Configurable.class);
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);

private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
private final List<String> scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
private RetryOptions retryOptions;
private Duration defaultPollInterval;

private Configurable() {
Expand Down Expand Up @@ -193,16 +221,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
return this;
}

/**
* Sets the retry options for the HTTP pipeline retry policy.
*
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
*
* @param retryOptions the retry options for the HTTP pipeline retry policy.
* @return the configurable object itself.
*/
public Configurable withRetryOptions(RetryOptions retryOptions) {
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
return this;
}

/**
* Sets the default poll interval, used when service does not provide "Retry-After" header.
*
* @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.");
this.defaultPollInterval =
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
}
return this;
}
Expand Down Expand Up @@ -242,10 +285,15 @@ public DataProtectionManager authenticate(TokenCredential credential, AzureProfi
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
}
if (retryPolicy == null) {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
if (retryOptions != null) {
retryPolicy = new RetryPolicy(retryOptions);
} else {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
}
}
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
policies
.addAll(
Expand Down Expand Up @@ -300,6 +348,25 @@ public OperationStatus operationStatus() {
return operationStatus;
}

/** @return Resource collection API of OperationStatusBackupVaultContexts. */
public OperationStatusBackupVaultContexts operationStatusBackupVaultContexts() {
if (this.operationStatusBackupVaultContexts == null) {
this.operationStatusBackupVaultContexts =
new OperationStatusBackupVaultContextsImpl(clientObject.getOperationStatusBackupVaultContexts(), this);
}
return operationStatusBackupVaultContexts;
}

/** @return Resource collection API of OperationStatusResourceGroupContexts. */
public OperationStatusResourceGroupContexts operationStatusResourceGroupContexts() {
if (this.operationStatusResourceGroupContexts == null) {
this.operationStatusResourceGroupContexts =
new OperationStatusResourceGroupContextsImpl(
clientObject.getOperationStatusResourceGroupContexts(), this);
}
return operationStatusResourceGroupContexts;
}

/** @return Resource collection API of BackupVaultOperationResults. */
public BackupVaultOperationResults backupVaultOperationResults() {
if (this.backupVaultOperationResults == null) {
Expand Down Expand Up @@ -342,6 +409,15 @@ public BackupInstances backupInstances() {
return backupInstances;
}

/** @return Resource collection API of BackupInstancesExtensionRoutings. */
public BackupInstancesExtensionRoutings backupInstancesExtensionRoutings() {
if (this.backupInstancesExtensionRoutings == null) {
this.backupInstancesExtensionRoutings =
new BackupInstancesExtensionRoutingsImpl(clientObject.getBackupInstancesExtensionRoutings(), this);
}
return backupInstancesExtensionRoutings;
}

/** @return Resource collection API of RecoveryPoints. */
public RecoveryPoints recoveryPoints() {
if (this.recoveryPoints == null) {
Expand Down
Loading

0 comments on commit 9ba6bc9

Please sign in to comment.