Skip to content

Commit ee37cf5

Browse files
author
SDKAuto
committed
CodeGen from PR 15417 in Azure/azure-rest-api-specs
Merge 3e1538958f5f39a34fa41540cc5931fff5652a27 into 7cc0a47e7808f3247c71cda25b7c1da8503272ba
1 parent 1b4741d commit ee37cf5

File tree

11 files changed

+142
-144
lines changed

11 files changed

+142
-144
lines changed

sdk/redisenterprise/azure-resourcemanager-redisenterprise/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.1.0-beta.1 (Unreleased)
3+
## 1.0.0-beta.1 (2021-07-28)
44

5+
- Azure Resource Manager RedisEnterprise client library for Java. This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-08. 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 (2021-04-21)
78

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Azure Resource Manager RedisEnterprise client library for Java.
44

5-
This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
5+
This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-08. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
66

77
## We'd love to hear your feedback
88

@@ -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-redisenterprise</artifactId>
35-
<version>1.0.0</version>
35+
<version>1.1.0-beta.1</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-redisenterprise</artifactId>
12-
<version>1.1.0-beta.1</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-redisenterprise;current} -->
13-
<packaging>jar</packaging>
10+
<groupId>com.azure.resourcemanager</groupId>
11+
<artifactId>azure-resourcemanager-redisenterprise</artifactId>
12+
<version>1.1.0-beta.1</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-redisenterprise;current} -->
13+
<packaging>jar</packaging>
1414

15-
<name>Microsoft Azure SDK for RedisEnterprise Management</name>
16-
<description>This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-03.</description>
17-
<url>https://github.com/Azure/azure-sdk-for-java</url>
15+
<name>Microsoft Azure SDK for RedisEnterprise Management</name>
16+
<description>This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-08.</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:[email protected]:Azure/azure-sdk-for-java.git</connection>
30-
<developerConnection>scm:git:[email protected]: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:[email protected]:Azure/azure-sdk-for-java.git</connection>
30+
<developerConnection>scm:git:[email protected]: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/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java

Lines changed: 18 additions & 6 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;
@@ -97,6 +97,7 @@ public static final class Configurable {
9797
private HttpClient httpClient;
9898
private HttpLogOptions httpLogOptions;
9999
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
100+
private final List<String> scopes = new ArrayList<>();
100101
private RetryPolicy retryPolicy;
101102
private Duration defaultPollInterval;
102103

@@ -136,6 +137,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) {
136137
return this;
137138
}
138139

140+
/**
141+
* Adds the scope to permission sets.
142+
*
143+
* @param scope the scope.
144+
* @return the configurable object itself.
145+
*/
146+
public Configurable withScope(String scope) {
147+
this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
148+
return this;
149+
}
150+
139151
/**
140152
* Sets the retry policy to the HTTP pipeline.
141153
*
@@ -178,7 +190,7 @@ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProf
178190
.append("-")
179191
.append("com.azure.resourcemanager.redisenterprise")
180192
.append("/")
181-
.append("1.0.0");
193+
.append("1.0.0-beta.1");
182194
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
183195
userAgentBuilder
184196
.append(" (")
@@ -192,6 +204,9 @@ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProf
192204
userAgentBuilder.append(" (auto-generated)");
193205
}
194206

207+
if (scopes.isEmpty()) {
208+
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
209+
}
195210
if (retryPolicy == null) {
196211
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
197212
}
@@ -201,10 +216,7 @@ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProf
201216
HttpPolicyProviders.addBeforeRetryPolicies(policies);
202217
policies.add(retryPolicy);
203218
policies.add(new AddDatePolicy());
204-
policies
205-
.add(
206-
new BearerTokenAuthenticationPolicy(
207-
credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
219+
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
208220
policies.addAll(this.policies);
209221
HttpPolicyProviders.addAfterRetryPolicies(policies);
210222
policies.add(new HttpLoggingPolicy(httpLogOptions));

sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/fluent/DatabasesClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ AccessKeysInner regenerateKey(
369369
Context context);
370370

371371
/**
372-
* Imports a database file to target database.
372+
* Imports database files to target database.
373373
*
374374
* @param resourceGroupName The name of the resource group. The name is case insensitive.
375375
* @param clusterName The name of the RedisEnterprise cluster.
@@ -385,7 +385,7 @@ SyncPoller<PollResult<Void>, Void> beginImportMethod(
385385
String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters);
386386

387387
/**
388-
* Imports a database file to target database.
388+
* Imports database files to target database.
389389
*
390390
* @param resourceGroupName The name of the resource group. The name is case insensitive.
391391
* @param clusterName The name of the RedisEnterprise cluster.
@@ -406,7 +406,7 @@ SyncPoller<PollResult<Void>, Void> beginImportMethod(
406406
Context context);
407407

408408
/**
409-
* Imports a database file to target database.
409+
* Imports database files to target database.
410410
*
411411
* @param resourceGroupName The name of the resource group. The name is case insensitive.
412412
* @param clusterName The name of the RedisEnterprise cluster.
@@ -421,7 +421,7 @@ void importMethod(
421421
String resourceGroupName, String clusterName, String databaseName, ImportClusterParameters parameters);
422422

423423
/**
424-
* Imports a database file to target database.
424+
* Imports database files to target database.
425425
*
426426
* @param resourceGroupName The name of the resource group. The name is case insensitive.
427427
* @param clusterName The name of the RedisEnterprise cluster.

sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,8 @@ public DatabaseImpl withPort(Integer port) {
225225
}
226226

227227
public DatabaseImpl withClusteringPolicy(ClusteringPolicy clusteringPolicy) {
228-
if (isInCreateMode()) {
229-
this.innerModel().withClusteringPolicy(clusteringPolicy);
230-
return this;
231-
} else {
232-
this.updateParameters.withClusteringPolicy(clusteringPolicy);
233-
return this;
234-
}
228+
this.innerModel().withClusteringPolicy(clusteringPolicy);
229+
return this;
235230
}
236231

237232
public DatabaseImpl withEvictionPolicy(EvictionPolicy evictionPolicy) {
@@ -255,13 +250,8 @@ public DatabaseImpl withPersistence(Persistence persistence) {
255250
}
256251

257252
public DatabaseImpl withModules(List<Module> modules) {
258-
if (isInCreateMode()) {
259-
this.innerModel().withModules(modules);
260-
return this;
261-
} else {
262-
this.updateParameters.withModules(modules);
263-
return this;
264-
}
253+
this.innerModel().withModules(modules);
254+
return this;
265255
}
266256

267257
private boolean isInCreateMode() {

0 commit comments

Comments
 (0)