Skip to content
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

[AutoPR azure-resourcemanager-dataprotection] Adding ResourceGuardProxy APIs to Microsoft.Dataprotection latest stable version #3827

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.4 (Unreleased)
## 1.0.0-beta.1 (2023-02-24)

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

### Features Added

Expand Down
Original file line number Diff line number Diff line change
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.3</version>
<version>1.0.0-beta.4</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
137 changes: 137 additions & 0 deletions sdk/dataprotection/azure-resourcemanager-dataprotection/SAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,14 @@
- [List](#deletedbackupinstances_list)
- [Undelete](#deletedbackupinstances_undelete)

## DppResourceGuardProxy

- [CreateOrUpdate](#dppresourceguardproxy_createorupdate)
- [Delete](#dppresourceguardproxy_delete)
- [Get](#dppresourceguardproxy_get)
- [List](#dppresourceguardproxy_list)
- [UnlockDelete](#dppresourceguardproxy_unlockdelete)

## ExportJobs

- [Trigger](#exportjobs_trigger)
Expand Down Expand Up @@ -1341,6 +1349,135 @@ public final class DeletedBackupInstancesUndeleteSamples {
}
```

### DppResourceGuardProxy_CreateOrUpdate

```java
import com.azure.resourcemanager.dataprotection.models.ResourceGuardProxyBase;

/** Samples for DppResourceGuardProxy CreateOrUpdate. */
public final class DppResourceGuardProxyCreateOrUpdateSamples {
/*
* x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardProxyCRUD/PutResourceGuardProxy.json
*/
/**
* Sample code: Create ResourceGuardProxy.
*
* @param manager Entry point to DataProtectionManager.
*/
public static void createResourceGuardProxy(
com.azure.resourcemanager.dataprotection.DataProtectionManager manager) {
manager
.dppResourceGuardProxies()
.define("swaggerExample")
.withExistingBackupVault("SampleResourceGroup", "sampleVault")
.withProperties(
new ResourceGuardProxyBase()
.withResourceGuardResourceId(
"/subscriptions/f9e67185-f313-4e79-aa71-6458d429369d/resourceGroups/ResourceGuardSecurityAdminRG/providers/Microsoft.DataProtection/resourceGuards/ResourceGuardTestResource"))
.create();
}
}
```

### DppResourceGuardProxy_Delete

```java
/** Samples for DppResourceGuardProxy Delete. */
public final class DppResourceGuardProxyDeleteSamples {
/*
* x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardProxyCRUD/DeleteResourceGuardProxy.json
*/
/**
* Sample code: Delete ResourceGuardProxy.
*
* @param manager Entry point to DataProtectionManager.
*/
public static void deleteResourceGuardProxy(
com.azure.resourcemanager.dataprotection.DataProtectionManager manager) {
manager
.dppResourceGuardProxies()
.deleteWithResponse(
"SampleResourceGroup", "sampleVault", "swaggerExample", com.azure.core.util.Context.NONE);
}
}
```

### DppResourceGuardProxy_Get

```java
/** Samples for DppResourceGuardProxy Get. */
public final class DppResourceGuardProxyGetSamples {
/*
* x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardProxyCRUD/GetResourceGuardProxy.json
*/
/**
* Sample code: Get ResourceGuardProxy.
*
* @param manager Entry point to DataProtectionManager.
*/
public static void getResourceGuardProxy(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) {
manager
.dppResourceGuardProxies()
.getWithResponse("SampleResourceGroup", "sampleVault", "swaggerExample", com.azure.core.util.Context.NONE);
}
}
```

### DppResourceGuardProxy_List

```java
/** Samples for DppResourceGuardProxy List. */
public final class DppResourceGuardProxyListSamples {
/*
* x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardProxyCRUD/ListResourceGuardProxy.json
*/
/**
* Sample code: Get ResourceGuardProxies.
*
* @param manager Entry point to DataProtectionManager.
*/
public static void getResourceGuardProxies(com.azure.resourcemanager.dataprotection.DataProtectionManager manager) {
manager.dppResourceGuardProxies().list("SampleResourceGroup", "sampleVault", com.azure.core.util.Context.NONE);
}
}
```

### DppResourceGuardProxy_UnlockDelete

```java
import com.azure.resourcemanager.dataprotection.models.UnlockDeleteRequest;
import java.util.Arrays;

/** Samples for DppResourceGuardProxy UnlockDelete. */
public final class DppResourceGuardProxyUnlockDeleteSamples {
/*
* x-ms-original-file: specification/dataprotection/resource-manager/Microsoft.DataProtection/stable/2023-01-01/examples/ResourceGuardProxyCRUD/UnlockDeleteResourceGuardProxy.json
*/
/**
* Sample code: UnlockDelete ResourceGuardProxy.
*
* @param manager Entry point to DataProtectionManager.
*/
public static void unlockDeleteResourceGuardProxy(
com.azure.resourcemanager.dataprotection.DataProtectionManager manager) {
manager
.dppResourceGuardProxies()
.unlockDeleteWithResponse(
"SampleResourceGroup",
"sampleVault",
"swaggerExample",
new UnlockDeleteRequest()
.withResourceGuardOperationRequests(
Arrays
.asList(
"/subscriptions/f9e67185-f313-4e79-aa71-6458d429369d/resourceGroups/ResourceGuardSecurityAdminRG/providers/Microsoft.DataProtection/resourceGuards/ResourceGuardTestResource/deleteBackupInstanceRequests/default"))
.withResourceToBeDeleted(
"/subscriptions/5e13b949-1218-4d18-8b99-7e12155ec4f7/resourceGroups/SampleResourceGroup/providers/Microsoft.DataProtection/backupVaults/sampleVault/backupInstances/TestBI9779f4de"),
com.azure.core.util.Context.NONE);
}
}
```

### ExportJobs_Trigger

```java
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
~ Copyright (c) Microsoft Corporation. All rights reserved.
~ Licensed under the MIT License.
~ Code generated by Microsoft (R) AutoRest Code Generator.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
Expand Down Expand Up @@ -38,7 +43,8 @@
</developers>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.skip>true</jacoco.skip>
<jacoco.min.linecoverage>0</jacoco.min.linecoverage>
<jacoco.min.branchcoverage>0</jacoco.min.branchcoverage>
</properties>
<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import com.azure.resourcemanager.dataprotection.implementation.DataProtectionOperationsImpl;
import com.azure.resourcemanager.dataprotection.implementation.DataProtectionsImpl;
import com.azure.resourcemanager.dataprotection.implementation.DeletedBackupInstancesImpl;
import com.azure.resourcemanager.dataprotection.implementation.DppResourceGuardProxiesImpl;
import com.azure.resourcemanager.dataprotection.implementation.ExportJobsImpl;
import com.azure.resourcemanager.dataprotection.implementation.ExportJobsOperationResultsImpl;
import com.azure.resourcemanager.dataprotection.implementation.JobsImpl;
Expand All @@ -49,6 +50,7 @@
import com.azure.resourcemanager.dataprotection.models.DataProtectionOperations;
import com.azure.resourcemanager.dataprotection.models.DataProtections;
import com.azure.resourcemanager.dataprotection.models.DeletedBackupInstances;
import com.azure.resourcemanager.dataprotection.models.DppResourceGuardProxies;
import com.azure.resourcemanager.dataprotection.models.ExportJobs;
import com.azure.resourcemanager.dataprotection.models.ExportJobsOperationResults;
import com.azure.resourcemanager.dataprotection.models.Jobs;
Expand All @@ -64,7 +66,6 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.UUID;
import java.util.stream.Collectors;

/** Entry point to DataProtectionManager. Open API 2.0 Specs for Azure Data Protection service. */
Expand Down Expand Up @@ -103,6 +104,8 @@ public final class DataProtectionManager {

private ResourceGuards resourceGuards;

private DppResourceGuardProxies dppResourceGuardProxies;

private final DataProtectionClient clientObject;

private DataProtectionManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) {
Expand All @@ -112,7 +115,7 @@ private DataProtectionManager(HttpPipeline httpPipeline, AzureProfile profile, D
new DataProtectionClientBuilder()
.pipeline(httpPipeline)
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
.subscriptionId(UUID.fromString(profile.getSubscriptionId()))
.subscriptionId(profile.getSubscriptionId())
.defaultPollInterval(defaultPollInterval)
.buildClient();
}
Expand Down Expand Up @@ -268,7 +271,7 @@ public DataProtectionManager authenticate(TokenCredential credential, AzureProfi
.append("-")
.append("com.azure.resourcemanager.dataprotection")
.append("/")
.append("1.0.0-beta.3");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand Down Expand Up @@ -536,6 +539,19 @@ public ResourceGuards resourceGuards() {
return resourceGuards;
}

/**
* Gets the resource collection API of DppResourceGuardProxies. It manages ResourceGuardProxyBaseResource.
*
* @return Resource collection API of DppResourceGuardProxies.
*/
public DppResourceGuardProxies dppResourceGuardProxies() {
if (this.dppResourceGuardProxies == null) {
this.dppResourceGuardProxies =
new DppResourceGuardProxiesImpl(clientObject.getDppResourceGuardProxies(), this);
}
return dppResourceGuardProxies;
}

/**
* @return Wrapped service client DataProtectionClient providing direct access to the underlying auto-generated API
* implementation, based on Azure REST API.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import com.azure.core.http.HttpPipeline;
import java.time.Duration;
import java.util.UUID;

/** The interface for DataProtectionClient class. */
public interface DataProtectionClient {
Expand All @@ -15,7 +14,7 @@ public interface DataProtectionClient {
*
* @return the subscriptionId value.
*/
UUID getSubscriptionId();
String getSubscriptionId();

/**
* Gets server parameter.
Expand Down Expand Up @@ -163,4 +162,11 @@ public interface DataProtectionClient {
* @return the ResourceGuardsClient object.
*/
ResourceGuardsClient getResourceGuards();

/**
* Gets the DppResourceGuardProxiesClient object to access its operations.
*
* @return the DppResourceGuardProxiesClient object.
*/
DppResourceGuardProxiesClient getDppResourceGuardProxies();
}
Loading