Skip to content

Commit c03987c

Browse files
authored
[Automation] Generate Fluent Lite from netapp#package-netapp-2021-04-01 (Azure#22306)
1 parent ebb00c4 commit c03987c

29 files changed

+1234
-104
lines changed

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

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

3-
## 1.0.0-beta.4 (Unreleased)
3+
## 1.0.0-beta.4 (2021-06-16)
44

5+
- Azure Resource Manager NetAppFiles client library for Java. This package contains Microsoft Azure SDK for NetAppFiles Management SDK. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-netapp-2021-04-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
6+
7+
### Breaking Change
8+
9+
#### `models.NetAppResources` was modified
10+
11+
* `checkFilePathAvailabilityWithResponse(java.lang.String,models.ResourceNameAvailabilityRequest,com.azure.core.util.Context)` was removed
12+
* `checkFilePathAvailability(java.lang.String,models.ResourceNameAvailabilityRequest)` was removed
13+
14+
### New Feature
15+
16+
* `models.ChownMode` was added
17+
18+
* `models.RestoreStatus` was added
19+
20+
* `models.FilePathAvailabilityRequest` was added
21+
22+
#### `models.BackupStatus` was modified
23+
24+
* `totalTransferBytes()` was added
25+
* `lastTransferSize()` was added
26+
* `lastTransferType()` was added
27+
28+
#### `models.Volume` was modified
29+
30+
* `coolnessPeriod()` was added
31+
* `coolAccess()` was added
32+
* `unixPermissions()` was added
33+
34+
#### `models.CapacityPool$Definition` was modified
35+
36+
* `withCoolAccess(java.lang.Boolean)` was added
37+
38+
#### `models.ActiveDirectory` was modified
39+
40+
* `withAdministrators(java.util.List)` was added
41+
* `administrators()` was added
42+
43+
#### `models.CapacityPool` was modified
44+
45+
* `coolAccess()` was added
46+
47+
#### `models.NetAppResources` was modified
48+
49+
* `checkFilePathAvailabilityWithResponse(java.lang.String,models.FilePathAvailabilityRequest,com.azure.core.util.Context)` was added
50+
* `checkFilePathAvailability(java.lang.String,models.FilePathAvailabilityRequest)` was added
51+
52+
#### `models.Backups` was modified
53+
54+
* `getVolumeRestoreStatusWithResponse(java.lang.String,java.lang.String,java.lang.String,java.lang.String,com.azure.core.util.Context)` was added
55+
* `getVolumeRestoreStatus(java.lang.String,java.lang.String,java.lang.String,java.lang.String)` was added
56+
57+
#### `models.Volume$Definition` was modified
58+
59+
* `withUnixPermissions(java.lang.String)` was added
60+
* `withCoolnessPeriod(java.lang.Integer)` was added
61+
* `withCoolAccess(java.lang.Boolean)` was added
62+
63+
#### `models.ExportPolicyRule` was modified
64+
65+
* `withChownMode(models.ChownMode)` was added
66+
* `chownMode()` was added
67+
68+
#### `NetAppFilesManager$Configurable` was modified
69+
70+
* `withScope(java.lang.String)` was added
571

672
## 1.0.0-beta.3 (2021-05-13)
773

sdk/netapp/azure-resourcemanager-netapp/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 NetAppFiles client library for Java.
44

5-
This package contains Microsoft Azure SDK for NetAppFiles Management SDK. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-netapp-2021-02-01. 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 NetAppFiles Management SDK. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-netapp-2021-04-01. 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-netapp</artifactId>
35-
<version>1.0.0-beta.3</version>
35+
<version>1.0.0-beta.4</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: 98 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -1,85 +1,104 @@
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-netapp</artifactId>
12-
<version>1.0.0-beta.4</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-netapp;current} -->
13-
<packaging>jar</packaging>
10+
<groupId>com.azure.resourcemanager</groupId>
11+
<artifactId>azure-resourcemanager-netapp</artifactId>
12+
<version>1.0.0-beta.4</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-netapp;current} -->
13+
<packaging>jar</packaging>
1414

15-
<name>Microsoft Azure SDK for NetAppFiles Management</name>
16-
<description>This package contains Microsoft Azure SDK for NetAppFiles Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-netapp-2021-02-01.</description>
17-
<url>https://github.com/Azure/azure-sdk-for-java</url>
15+
<name>Microsoft Azure SDK for NetAppFiles Management</name>
16+
<description>This package contains Microsoft Azure SDK for NetAppFiles Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-netapp-2021-04-01.</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.17.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.0</version> <!-- {x-version-update;com.azure:azure-core-management;dependency} -->
53-
</dependency>
54-
<dependency>
55-
<groupId>com.azure</groupId>
56-
<artifactId>azure-identity</artifactId>
57-
<version>1.3.1</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
58-
<scope>test</scope>
59-
</dependency>
60-
<dependency>
61-
<groupId>com.azure</groupId>
62-
<artifactId>azure-core-test</artifactId>
63-
<version>1.6.3</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
64-
<scope>test</scope>
65-
</dependency>
66-
<dependency>
67-
<groupId>com.azure.resourcemanager</groupId>
68-
<artifactId>azure-resourcemanager-resources</artifactId>
69-
<version>2.5.0</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-resources;dependency} -->
70-
<scope>test</scope>
71-
</dependency>
72-
</dependencies>
73-
<build>
74-
<plugins>
75-
<plugin>
76-
<groupId>org.jacoco</groupId>
77-
<artifactId>jacoco-maven-plugin</artifactId>
78-
<version>0.8.5</version> <!-- {x-version-update;org.jacoco:jacoco-maven-plugin;external_dependency} -->
79-
<configuration>
80-
<skip>true</skip>
81-
</configuration>
82-
</plugin>
83-
</plugins>
84-
</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.17.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.0</version> <!-- {x-version-update;com.azure:azure-core-management;dependency} -->
53+
</dependency>
54+
<dependency>
55+
<groupId>com.azure</groupId>
56+
<artifactId>azure-identity</artifactId>
57+
<version>1.3.1</version> <!-- {x-version-update;com.azure:azure-identity;dependency} -->
58+
<scope>test</scope>
59+
</dependency>
60+
<dependency>
61+
<groupId>com.azure</groupId>
62+
<artifactId>azure-core-test</artifactId>
63+
<version>1.6.3</version> <!-- {x-version-update;com.azure:azure-core-test;dependency} -->
64+
<scope>test</scope>
65+
</dependency>
66+
<dependency>
67+
<groupId>com.azure.resourcemanager</groupId>
68+
<artifactId>azure-resourcemanager-resources</artifactId>
69+
<version>2.5.0</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-resources;dependency} -->
70+
<scope>test</scope>
71+
</dependency>
72+
</dependencies>
73+
<build>
74+
<plugins>
75+
<plugin>
76+
<groupId>org.jacoco</groupId>
77+
<artifactId>jacoco-maven-plugin</artifactId>
78+
<version>0.8.5</version> <!-- {x-version-update;org.jacoco:jacoco-maven-plugin;external_dependency} -->
79+
<configuration>
80+
<skip>true</skip>
81+
</configuration>
82+
</plugin>
83+
<plugin>
84+
<groupId>org.revapi</groupId>
85+
<artifactId>revapi-maven-plugin</artifactId>
86+
<version>0.11.2</version> <!-- {x-version-update;org.revapi:revapi-maven-plugin;external_dependency} -->
87+
<configuration>
88+
<analysisConfiguration>
89+
<revapi.ignore>
90+
<item>
91+
<code>java.method.addedToInterface</code>
92+
</item>
93+
<item>
94+
<regex>true</regex>
95+
<code>.*</code>
96+
<package>com\.azure\.resourcemanager(\.[^.]+)+\.fluent(\.[^.]+)*</package>
97+
</item>
98+
</revapi.ignore>
99+
</analysisConfiguration>
100+
</configuration>
101+
</plugin>
102+
</plugins>
103+
</build>
85104
</project>

sdk/netapp/azure-resourcemanager-netapp/src/main/java/com/azure/resourcemanager/netapp/NetAppFilesManager.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;
@@ -117,6 +117,7 @@ public static final class Configurable {
117117
private HttpClient httpClient;
118118
private HttpLogOptions httpLogOptions;
119119
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
120+
private final List<String> scopes = new ArrayList<>();
120121
private RetryPolicy retryPolicy;
121122
private Duration defaultPollInterval;
122123

@@ -156,6 +157,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) {
156157
return this;
157158
}
158159

160+
/**
161+
* Adds the scope to permission sets.
162+
*
163+
* @param scope the scope.
164+
* @return the configurable object itself.
165+
*/
166+
public Configurable withScope(String scope) {
167+
this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null."));
168+
return this;
169+
}
170+
159171
/**
160172
* Sets the retry policy to the HTTP pipeline.
161173
*
@@ -198,7 +210,7 @@ public NetAppFilesManager authenticate(TokenCredential credential, AzureProfile
198210
.append("-")
199211
.append("com.azure.resourcemanager.netapp")
200212
.append("/")
201-
.append("1.0.0-beta.3");
213+
.append("1.0.0-beta.4");
202214
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
203215
userAgentBuilder
204216
.append(" (")
@@ -212,6 +224,9 @@ public NetAppFilesManager authenticate(TokenCredential credential, AzureProfile
212224
userAgentBuilder.append(" (auto-generated)");
213225
}
214226

227+
if (scopes.isEmpty()) {
228+
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
229+
}
215230
if (retryPolicy == null) {
216231
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
217232
}
@@ -221,10 +236,7 @@ public NetAppFilesManager authenticate(TokenCredential credential, AzureProfile
221236
HttpPolicyProviders.addBeforeRetryPolicies(policies);
222237
policies.add(retryPolicy);
223238
policies.add(new AddDatePolicy());
224-
policies
225-
.add(
226-
new BearerTokenAuthenticationPolicy(
227-
credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
239+
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
228240
policies.addAll(this.policies);
229241
HttpPolicyProviders.addAfterRetryPolicies(policies);
230242
policies.add(new HttpLoggingPolicy(httpLogOptions));

0 commit comments

Comments
 (0)