Skip to content

[AutoPR azure-resourcemanager-dataprotection] Swagger fix for MUA for RSV and Dpp #354

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-05-10)

- 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-2022-04. 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-2022-04. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

## We'd love to hear your feedback

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
420 changes: 334 additions & 86 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-2022-04.</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,11 +10,13 @@
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
Expand All @@ -33,7 +35,9 @@
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;
Expand All @@ -48,6 +52,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 +72,10 @@ public final class DataProtectionManager {

private OperationStatus operationStatus;

private OperationStatusBackupVaultContexts operationStatusBackupVaultContexts;

private OperationStatusResourceGroupContexts operationStatusResourceGroupContexts;

private BackupVaultOperationResults backupVaultOperationResults;

private DataProtections dataProtections;
Expand Down Expand Up @@ -115,6 +125,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 +149,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 +217,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 +281,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 @@ -276,31 +320,74 @@ public DataProtectionManager authenticate(TokenCredential credential, AzureProfi
}
}

/** @return Resource collection API of BackupVaults. */
/**
* Gets the resource collection API of BackupVaults.
*
* @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. */
/**
* Gets the resource collection API of OperationResults.
*
* @return Resource collection API of OperationResults.
*/
public OperationResults operationResults() {
if (this.operationResults == null) {
this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this);
}
return operationResults;
}

/** @return Resource collection API of OperationStatus. */
/**
* Gets the resource collection API of OperationStatus.
*
* @return Resource collection API of OperationStatus.
*/
public OperationStatus operationStatus() {
if (this.operationStatus == null) {
this.operationStatus = new OperationStatusImpl(clientObject.getOperationStatus(), this);
}
return operationStatus;
}

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

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

/**
* Gets the resource collection API of BackupVaultOperationResults.
*
* @return Resource collection API of BackupVaultOperationResults.
*/
public BackupVaultOperationResults backupVaultOperationResults() {
if (this.backupVaultOperationResults == null) {
this.backupVaultOperationResults =
Expand All @@ -309,15 +396,23 @@ public BackupVaultOperationResults backupVaultOperationResults() {
return backupVaultOperationResults;
}

/** @return Resource collection API of DataProtections. */
/**
* Gets the resource collection API of DataProtections.
*
* @return Resource collection API of DataProtections.
*/
public DataProtections dataProtections() {
if (this.dataProtections == null) {
this.dataProtections = new DataProtectionsImpl(clientObject.getDataProtections(), this);
}
return dataProtections;
}

/** @return Resource collection API of DataProtectionOperations. */
/**
* Gets the resource collection API of DataProtectionOperations.
*
* @return Resource collection API of DataProtectionOperations.
*/
public DataProtectionOperations dataProtectionOperations() {
if (this.dataProtectionOperations == null) {
this.dataProtectionOperations =
Expand All @@ -326,55 +421,83 @@ public DataProtectionOperations dataProtectionOperations() {
return dataProtectionOperations;
}

/** @return Resource collection API of BackupPolicies. */
/**
* Gets the resource collection API of BackupPolicies.
*
* @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. */
/**
* Gets the resource collection API of BackupInstances.
*
* @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. */
/**
* Gets the resource collection API of RecoveryPoints.
*
* @return Resource collection API of RecoveryPoints.
*/
public RecoveryPoints recoveryPoints() {
if (this.recoveryPoints == null) {
this.recoveryPoints = new RecoveryPointsImpl(clientObject.getRecoveryPoints(), this);
}
return recoveryPoints;
}

/** @return Resource collection API of Jobs. */
/**
* Gets the resource collection API of Jobs.
*
* @return Resource collection API of Jobs.
*/
public Jobs jobs() {
if (this.jobs == null) {
this.jobs = new JobsImpl(clientObject.getJobs(), this);
}
return jobs;
}

/** @return Resource collection API of RestorableTimeRanges. */
/**
* Gets the resource collection API of RestorableTimeRanges.
*
* @return Resource collection API of RestorableTimeRanges.
*/
public RestorableTimeRanges restorableTimeRanges() {
if (this.restorableTimeRanges == null) {
this.restorableTimeRanges = new RestorableTimeRangesImpl(clientObject.getRestorableTimeRanges(), this);
}
return restorableTimeRanges;
}

/** @return Resource collection API of ExportJobs. */
/**
* Gets the resource collection API of ExportJobs.
*
* @return Resource collection API of ExportJobs.
*/
public ExportJobs exportJobs() {
if (this.exportJobs == null) {
this.exportJobs = new ExportJobsImpl(clientObject.getExportJobs(), this);
}
return exportJobs;
}

/** @return Resource collection API of ExportJobsOperationResults. */
/**
* Gets the resource collection API of ExportJobsOperationResults.
*
* @return Resource collection API of ExportJobsOperationResults.
*/
public ExportJobsOperationResults exportJobsOperationResults() {
if (this.exportJobsOperationResults == null) {
this.exportJobsOperationResults =
Expand All @@ -383,7 +506,11 @@ public ExportJobsOperationResults exportJobsOperationResults() {
return exportJobsOperationResults;
}

/** @return Resource collection API of ResourceGuards. */
/**
* Gets the resource collection API of ResourceGuards.
*
* @return Resource collection API of ResourceGuards.
*/
public ResourceGuards resourceGuards() {
if (this.resourceGuards == null) {
this.resourceGuards = new ResourceGuardsImpl(clientObject.getResourceGuards(), this);
Expand Down
Loading