Skip to content

Commit 71d842f

Browse files
author
SDKAuto
committed
CodeGen from PR 15050 in Azure/azure-rest-api-specs
Merge af44661236b6a92f7eb938f69d3b09c1bfb032f5 into b5b3ae9a081535b4dabce52a1136eece3e2d469f
1 parent 2224e45 commit 71d842f

File tree

7 files changed

+159
-75
lines changed

7 files changed

+159
-75
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Release History
22

3+
## 1.0.0-beta.1 (2021-07-02)
4+
5+
- Azure Resource Manager AppConfiguration client library for Java. This package contains Microsoft Azure SDK for AppConfiguration Management SDK. Package tag package-2021-03-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
6+
37
## 1.0.0-beta.2 (2021-05-14)
48

59
- Azure Resource Manager AppConfiguration client library for Java. This package contains Microsoft Azure SDK for AppConfiguration Management SDK. Package tag package-2021-03-01-preview. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,13 +74,15 @@ 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
8082

8183
## Contributing
8284

83-
For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/main/CONTRIBUTING.md).
85+
For details on contributing to this repository, see the [contributing guide](https://github.com/Azure/azure-sdk-for-java/blob/master/CONTRIBUTING.md).
8486

8587
1. Fork it
8688
1. Create your feature branch (`git checkout -b my-new-feature`)
@@ -93,7 +95,7 @@ For details on contributing to this repository, see the [contributing guide](htt
9395
[docs]: https://azure.github.io/azure-sdk-for-java/
9496
[jdk]: https://docs.microsoft.com/java/azure/jdk/
9597
[azure_subscription]: https://azure.microsoft.com/free/
96-
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/identity/azure-identity
97-
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/core/azure-core-http-netty
98-
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/AUTH.md
99-
[design]: https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/resourcemanager/docs/DESIGN.md
98+
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity
99+
[azure_core_http_netty]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/core/azure-core-http-netty
100+
[authenticate]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/AUTH.md
101+
[design]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/resourcemanager/docs/DESIGN.md
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-appconfiguration</artifactId>
12-
<version>1.0.0-beta.2</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-appconfiguration;current} -->
13-
<packaging>jar</packaging>
10+
<groupId>com.azure.resourcemanager</groupId>
11+
<artifactId>azure-resourcemanager-appconfiguration</artifactId>
12+
<version>1.0.0-beta.2</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-appconfiguration;current} -->
13+
<packaging>jar</packaging>
1414

15-
<name>Microsoft Azure SDK for AppConfiguration Management</name>
16-
<description>This package contains Microsoft Azure SDK for AppConfiguration Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-03-01-preview.</description>
17-
<url>https://github.com/Azure/azure-sdk-for-java</url>
15+
<name>Microsoft Azure SDK for AppConfiguration Management</name>
16+
<description>This package contains Microsoft Azure SDK for AppConfiguration Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2021-03-01-preview.</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/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/AppConfigurationManager.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;
@@ -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
*
@@ -174,7 +186,7 @@ public AppConfigurationManager authenticate(TokenCredential credential, AzurePro
174186
.append("-")
175187
.append("com.azure.resourcemanager.appconfiguration")
176188
.append("/")
177-
.append("1.0.0-beta.2");
189+
.append("1.0.0-beta.1");
178190
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
179191
userAgentBuilder
180192
.append(" (")
@@ -188,6 +200,9 @@ public AppConfigurationManager 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,7 @@ public AppConfigurationManager 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])));
204216
policies.addAll(this.policies);
205217
HttpPolicyProviders.addAfterRetryPolicies(policies);
206218
policies.add(new HttpLoggingPolicy(httpLogOptions));

sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/implementation/ConfigurationStoreImpl.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,13 @@ public ConfigurationStoreImpl withEncryption(EncryptionProperties encryption) {
277277
}
278278

279279
public ConfigurationStoreImpl withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
280-
this.innerModel().withPublicNetworkAccess(publicNetworkAccess);
281-
return this;
280+
if (isInCreateMode()) {
281+
this.innerModel().withPublicNetworkAccess(publicNetworkAccess);
282+
return this;
283+
} else {
284+
this.updateConfigStoreUpdateParameters.withPublicNetworkAccess(publicNetworkAccess);
285+
return this;
286+
}
282287
}
283288

284289
public ConfigurationStoreImpl withDisableLocalAuth(Boolean disableLocalAuth) {

sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStore.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,8 @@ interface Update
287287
UpdateStages.WithIdentity,
288288
UpdateStages.WithSku,
289289
UpdateStages.WithEncryption,
290-
UpdateStages.WithDisableLocalAuth {
290+
UpdateStages.WithDisableLocalAuth,
291+
UpdateStages.WithPublicNetworkAccess {
291292
/**
292293
* Executes the update request.
293294
*
@@ -356,6 +357,18 @@ interface WithDisableLocalAuth {
356357
*/
357358
Update withDisableLocalAuth(Boolean disableLocalAuth);
358359
}
360+
/** The stage of the ConfigurationStore update allowing to specify publicNetworkAccess. */
361+
interface WithPublicNetworkAccess {
362+
/**
363+
* Specifies the publicNetworkAccess property: Control permission for data plane traffic coming from public
364+
* networks while private endpoint is enabled..
365+
*
366+
* @param publicNetworkAccess Control permission for data plane traffic coming from public networks while
367+
* private endpoint is enabled.
368+
* @return the next definition stage.
369+
*/
370+
Update withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess);
371+
}
359372
}
360373
/**
361374
* Refreshes the resource to sync with Azure.

sdk/appconfiguration/azure-resourcemanager-appconfiguration/src/main/java/com/azure/resourcemanager/appconfiguration/models/ConfigurationStoreUpdateParameters.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ public class ConfigurationStoreUpdateParameters {
4747
@JsonProperty(value = "properties.disableLocalAuth")
4848
private Boolean disableLocalAuth;
4949

50+
/*
51+
* Control permission for data plane traffic coming from public networks
52+
* while private endpoint is enabled.
53+
*/
54+
@JsonProperty(value = "properties.publicNetworkAccess")
55+
private PublicNetworkAccess publicNetworkAccess;
56+
5057
/**
5158
* Get the identity property: The managed identity information for the configuration store.
5259
*
@@ -147,6 +154,28 @@ public ConfigurationStoreUpdateParameters withDisableLocalAuth(Boolean disableLo
147154
return this;
148155
}
149156

157+
/**
158+
* Get the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while
159+
* private endpoint is enabled.
160+
*
161+
* @return the publicNetworkAccess value.
162+
*/
163+
public PublicNetworkAccess publicNetworkAccess() {
164+
return this.publicNetworkAccess;
165+
}
166+
167+
/**
168+
* Set the publicNetworkAccess property: Control permission for data plane traffic coming from public networks while
169+
* private endpoint is enabled.
170+
*
171+
* @param publicNetworkAccess the publicNetworkAccess value to set.
172+
* @return the ConfigurationStoreUpdateParameters object itself.
173+
*/
174+
public ConfigurationStoreUpdateParameters withPublicNetworkAccess(PublicNetworkAccess publicNetworkAccess) {
175+
this.publicNetworkAccess = publicNetworkAccess;
176+
return this;
177+
}
178+
150179
/**
151180
* Validates the instance.
152181
*

0 commit comments

Comments
 (0)