Skip to content

Commit 2633533

Browse files
author
SDKAuto
committed
CodeGen from PR 15262 in Azure/azure-rest-api-specs
Merge 016bfedcd130f391da1b960e51d24ef61b9b9190 into ed3fcfb33e8ecae0717bee53046677bd2f3c16ad
1 parent 3b8ca74 commit 2633533

19 files changed

+597
-642
lines changed

sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# Release History
22

3-
## 1.0.0-beta.2 (Unreleased)
3+
## 1.0.0-beta.1 (2021-07-22)
44

5+
- Azure Resource Manager DelegatedNetwork client library for Java. This package contains Microsoft Azure SDK for DelegatedNetwork Management SDK. DNC web api provides way to create, get and delete dnc controller. Package tag package-2021-03-15. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
56

67
## 1.0.0-beta.1 (2021-03-26)
78

sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
3232
<dependency>
3333
<groupId>com.azure.resourcemanager</groupId>
3434
<artifactId>azure-resourcemanager-delegatednetwork</artifactId>
35-
<version>1.0.0-beta.1</version>
35+
<version>1.0.0-beta.2</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})
@@ -74,6 +74,8 @@ See [API design][design] for general introduction on design and key concepts on
7474

7575
## Examples
7676

77+
78+
7779
## Troubleshooting
7880

7981
## Next steps
Lines changed: 80 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,86 @@
11
<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">
2-
<modelVersion>4.0.0</modelVersion>
3-
<parent>
4-
<groupId>com.azure</groupId>
5-
<artifactId>azure-client-sdk-parent</artifactId>
6-
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
7-
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
8-
</parent>
2+
<modelVersion>4.0.0</modelVersion>
3+
<parent>
4+
<groupId>com.azure</groupId>
5+
<artifactId>azure-client-sdk-parent</artifactId>
6+
<version>1.7.0</version> <!-- {x-version-update;com.azure:azure-client-sdk-parent;current} -->
7+
<relativePath>../../parents/azure-client-sdk-parent</relativePath>
8+
</parent>
99

10-
<groupId>com.azure.resourcemanager</groupId>
11-
<artifactId>azure-resourcemanager-delegatednetwork</artifactId>
12-
<version>1.0.0-beta.2</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-delegatednetwork;current} -->
13-
<packaging>jar</packaging>
10+
<groupId>com.azure.resourcemanager</groupId>
11+
<artifactId>azure-resourcemanager-delegatednetwork</artifactId>
12+
<version>1.0.0-beta.2</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-delegatednetwork;current} -->
13+
<packaging>jar</packaging>
1414

15-
<name>Microsoft Azure SDK for DelegatedNetwork Management</name>
16-
<description>This package contains Microsoft Azure SDK for DelegatedNetwork Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. DNC web api provides way to create, get and delete dnc controller. Package tag package-2021-03-15.</description>
17-
<url>https://github.com/Azure/azure-sdk-for-java</url>
15+
<name>Microsoft Azure SDK for DelegatedNetwork Management</name>
16+
<description>This package contains Microsoft Azure SDK for DelegatedNetwork Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. DNC web api provides way to create, get and delete dnc controller. Package tag package-2021-03-15.</description>
17+
<url>https://github.com/Azure/azure-sdk-for-java</url>
1818

19-
<licenses>
20-
<license>
21-
<name>The MIT License (MIT)</name>
22-
<url>http://opensource.org/licenses/MIT</url>
23-
<distribution>repo</distribution>
24-
</license>
25-
</licenses>
19+
<licenses>
20+
<license>
21+
<name>The MIT License (MIT)</name>
22+
<url>http://opensource.org/licenses/MIT</url>
23+
<distribution>repo</distribution>
24+
</license>
25+
</licenses>
2626

27-
<scm>
28-
<url>https://github.com/Azure/azure-sdk-for-java</url>
29-
<connection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</connection>
30-
<developerConnection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</developerConnection>
31-
<tag>HEAD</tag>
32-
</scm>
33-
<developers>
34-
<developer>
35-
<id>microsoft</id>
36-
<name>Microsoft</name>
37-
</developer>
38-
</developers>
39-
<properties>
40-
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
41-
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
42-
</properties>
43-
<dependencies>
44-
<dependency>
45-
<groupId>com.azure</groupId>
46-
<artifactId>azure-core</artifactId>
47-
<version>1.18.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
48-
</dependency>
49-
<dependency>
50-
<groupId>com.azure</groupId>
51-
<artifactId>azure-core-management</artifactId>
52-
<version>1.3.1</version> <!-- {x-version-update;com.azure:azure-core-management;dependency} -->
53-
</dependency>
54-
</dependencies>
55-
<build>
56-
<plugins>
57-
<plugin>
58-
<groupId>org.jacoco</groupId>
59-
<artifactId>jacoco-maven-plugin</artifactId>
60-
<version>0.8.5</version> <!-- {x-version-update;org.jacoco:jacoco-maven-plugin;external_dependency} -->
61-
<configuration>
62-
<skip>true</skip>
63-
</configuration>
64-
</plugin>
65-
</plugins>
66-
</build>
27+
<scm>
28+
<url>https://github.com/Azure/azure-sdk-for-java</url>
29+
<connection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</connection>
30+
<developerConnection>scm:git:git@github.com:Azure/azure-sdk-for-java.git</developerConnection>
31+
<tag>HEAD</tag>
32+
</scm>
33+
<developers>
34+
<developer>
35+
<id>microsoft</id>
36+
<name>Microsoft</name>
37+
</developer>
38+
</developers>
39+
<properties>
40+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
41+
<legal><![CDATA[[INFO] Any downloads listed may be third party software. Microsoft grants you no rights for third party software.]]></legal>
42+
</properties>
43+
<dependencies>
44+
<dependency>
45+
<groupId>com.azure</groupId>
46+
<artifactId>azure-core</artifactId>
47+
<version>1.18.0</version> <!-- {x-version-update;com.azure:azure-core;dependency} -->
48+
</dependency>
49+
<dependency>
50+
<groupId>com.azure</groupId>
51+
<artifactId>azure-core-management</artifactId>
52+
<version>1.3.1</version> <!-- {x-version-update;com.azure:azure-core-management;dependency} -->
53+
</dependency>
54+
</dependencies>
55+
<build>
56+
<plugins>
57+
<plugin>
58+
<groupId>org.jacoco</groupId>
59+
<artifactId>jacoco-maven-plugin</artifactId>
60+
<version>0.8.5</version> <!-- {x-version-update;org.jacoco:jacoco-maven-plugin;external_dependency} -->
61+
<configuration>
62+
<skip>true</skip>
63+
</configuration>
64+
</plugin>
65+
<plugin>
66+
<groupId>org.revapi</groupId>
67+
<artifactId>revapi-maven-plugin</artifactId>
68+
<version>0.11.2</version> <!-- {x-version-update;org.revapi:revapi-maven-plugin;external_dependency} -->
69+
<configuration>
70+
<analysisConfiguration>
71+
<revapi.ignore>
72+
<item>
73+
<code>java.method.addedToInterface</code>
74+
</item>
75+
<item>
76+
<regex>true</regex>
77+
<code>.*</code>
78+
<package>com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)*</package>
79+
</item>
80+
</revapi.ignore>
81+
</analysisConfiguration>
82+
</configuration>
83+
</plugin>
84+
</plugins>
85+
</build>
6786
</project>

sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/DelegatedNetworkManager.java

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99
import com.azure.core.http.HttpPipeline;
1010
import com.azure.core.http.HttpPipelineBuilder;
1111
import com.azure.core.http.policy.AddDatePolicy;
12-
import com.azure.core.http.policy.BearerTokenAuthenticationPolicy;
1312
import com.azure.core.http.policy.HttpLogOptions;
1413
import com.azure.core.http.policy.HttpLoggingPolicy;
1514
import com.azure.core.http.policy.HttpPipelinePolicy;
1615
import com.azure.core.http.policy.HttpPolicyProviders;
1716
import com.azure.core.http.policy.RequestIdPolicy;
1817
import com.azure.core.http.policy.RetryPolicy;
1918
import com.azure.core.http.policy.UserAgentPolicy;
19+
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
2020
import com.azure.core.management.profile.AzureProfile;
2121
import com.azure.core.util.Configuration;
2222
import com.azure.core.util.logging.ClientLogger;
@@ -93,6 +93,7 @@ public static final class Configurable {
9393
private HttpClient httpClient;
9494
private HttpLogOptions httpLogOptions;
9595
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
96+
private final List<String> scopes = new ArrayList<>();
9697
private RetryPolicy retryPolicy;
9798
private Duration defaultPollInterval;
9899

@@ -132,6 +133,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) {
132133
return this;
133134
}
134135

136+
/**
137+
* Adds the scope to permission sets.
138+
*
139+
* @param scope the scope.
140+
* @return the configurable object itself.
141+
*/
142+
public Configurable withScope(String scope) {
143+
this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
144+
return this;
145+
}
146+
135147
/**
136148
* Sets the retry policy to the HTTP pipeline.
137149
*
@@ -188,6 +200,9 @@ public DelegatedNetworkManager authenticate(TokenCredential credential, AzurePro
188200
userAgentBuilder.append(" (auto-generated)");
189201
}
190202

203+
if (scopes.isEmpty()) {
204+
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
205+
}
191206
if (retryPolicy == null) {
192207
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
193208
}
@@ -197,10 +212,8 @@ public DelegatedNetworkManager authenticate(TokenCredential credential, AzurePro
197212
HttpPolicyProviders.addBeforeRetryPolicies(policies);
198213
policies.add(retryPolicy);
199214
policies.add(new AddDatePolicy());
200-
policies
201-
.add(
202-
new BearerTokenAuthenticationPolicy(
203-
credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
215+
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
216+
policies.addAll(this.policies);
204217
HttpPolicyProviders.addAfterRetryPolicies(policies);
205218
policies.add(new HttpLoggingPolicy(httpLogOptions));
206219
HttpPipeline httpPipeline =

sdk/delegatednetwork/azure-resourcemanager-delegatednetwork/src/main/java/com/azure/resourcemanager/delegatednetwork/fluent/OrchestratorInstanceServicesClient.java

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,27 +110,43 @@ OrchestratorInner create(
110110
*
111111
* @param resourceGroupName The name of the resource group. The name is case insensitive.
112112
* @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63.
113+
* @param forceDelete Force delete resource.
113114
* @throws IllegalArgumentException thrown if parameters fail the validation.
114115
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
115116
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
116117
* @return the completion.
117118
*/
118119
@ServiceMethod(returns = ReturnType.SINGLE)
119-
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String resourceName);
120+
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String resourceName, Boolean forceDelete);
120121

121122
/**
122123
* Deletes the Orchestrator Instance.
123124
*
124125
* @param resourceGroupName The name of the resource group. The name is case insensitive.
125126
* @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63.
127+
* @param forceDelete Force delete resource.
126128
* @param context The context to associate with this operation.
127129
* @throws IllegalArgumentException thrown if parameters fail the validation.
128130
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
129131
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
130132
* @return the completion.
131133
*/
132134
@ServiceMethod(returns = ReturnType.SINGLE)
133-
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String resourceName, Context context);
135+
SyncPoller<PollResult<Void>, Void> beginDelete(
136+
String resourceGroupName, String resourceName, Boolean forceDelete, Context context);
137+
138+
/**
139+
* Deletes the Orchestrator Instance.
140+
*
141+
* @param resourceGroupName The name of the resource group. The name is case insensitive.
142+
* @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63.
143+
* @param forceDelete Force delete resource.
144+
* @throws IllegalArgumentException thrown if parameters fail the validation.
145+
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
146+
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
147+
*/
148+
@ServiceMethod(returns = ReturnType.SINGLE)
149+
void delete(String resourceGroupName, String resourceName, Boolean forceDelete);
134150

135151
/**
136152
* Deletes the Orchestrator Instance.
@@ -149,13 +165,14 @@ OrchestratorInner create(
149165
*
150166
* @param resourceGroupName The name of the resource group. The name is case insensitive.
151167
* @param resourceName The name of the resource. It must be a minimum of 3 characters, and a maximum of 63.
168+
* @param forceDelete Force delete resource.
152169
* @param context The context to associate with this operation.
153170
* @throws IllegalArgumentException thrown if parameters fail the validation.
154171
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
155172
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
156173
*/
157174
@ServiceMethod(returns = ReturnType.SINGLE)
158-
void delete(String resourceGroupName, String resourceName, Context context);
175+
void delete(String resourceGroupName, String resourceName, Boolean forceDelete, Context context);
159176

160177
/**
161178
* Update Orchestrator Instance.

0 commit comments

Comments
 (0)