Skip to content

Commit 13bcbb6

Browse files
author
SDKAuto
committed
CodeGen from PR 14984 in Azure/azure-rest-api-specs
python config (Azure#14984)
1 parent 9800d75 commit 13bcbb6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1125
-2954
lines changed

sdk/resourcehealth/azure-resourcemanager-resourcehealth/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-06-25)
44

5+
- Azure Resource Manager ResourceHealth client library for Java. This package contains Microsoft Azure SDK for ResourceHealth Management SDK. The Resource Health Client. Package tag package-2017-07. 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-04-08)
78

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

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

33
Azure Resource Manager ResourceHealth client library for Java.
44

5-
This package contains Microsoft Azure SDK for ResourceHealth Management SDK. The Resource Health Client. Package tag package-2018-07-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 ResourceHealth Management SDK. The Resource Health Client. Package tag package-2017-07. 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-resourcehealth</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,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-resourcehealth</artifactId>
12-
<version>1.0.0-beta.2</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-resourcehealth;current} -->
13-
<packaging>jar</packaging>
10+
<groupId>com.azure.resourcemanager</groupId>
11+
<artifactId>azure-resourcemanager-resourcehealth</artifactId>
12+
<version>1.0.0-beta.2</version> <!-- {x-version-update;com.azure.resourcemanager:azure-resourcemanager-resourcehealth;current} -->
13+
<packaging>jar</packaging>
1414

15-
<name>Microsoft Azure SDK for ResourceHealth Management</name>
16-
<description>This package contains Microsoft Azure SDK for ResourceHealth Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Resource Health Client. Package tag package-2018-07-01.</description>
17-
<url>https://github.com/Azure/azure-sdk-for-java</url>
15+
<name>Microsoft Azure SDK for ResourceHealth Management</name>
16+
<description>This package contains Microsoft Azure SDK for ResourceHealth Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Resource Health Client. Package tag package-2017-07.</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-
</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.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+
</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/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/ResourceHealthManager.java

Lines changed: 42 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -9,26 +9,28 @@
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;
2323
import com.azure.resourcemanager.resourcehealth.fluent.MicrosoftResourceHealth;
2424
import com.azure.resourcemanager.resourcehealth.implementation.AvailabilityStatusesImpl;
25+
import com.azure.resourcemanager.resourcehealth.implementation.ChildAvailabilityStatusesImpl;
26+
import com.azure.resourcemanager.resourcehealth.implementation.ChildResourcesImpl;
2527
import com.azure.resourcemanager.resourcehealth.implementation.EmergingIssuesImpl;
26-
import com.azure.resourcemanager.resourcehealth.implementation.EventsOperationsImpl;
2728
import com.azure.resourcemanager.resourcehealth.implementation.MicrosoftResourceHealthBuilder;
2829
import com.azure.resourcemanager.resourcehealth.implementation.OperationsImpl;
2930
import com.azure.resourcemanager.resourcehealth.models.AvailabilityStatuses;
31+
import com.azure.resourcemanager.resourcehealth.models.ChildAvailabilityStatuses;
32+
import com.azure.resourcemanager.resourcehealth.models.ChildResources;
3033
import com.azure.resourcemanager.resourcehealth.models.EmergingIssues;
31-
import com.azure.resourcemanager.resourcehealth.models.EventsOperations;
3234
import com.azure.resourcemanager.resourcehealth.models.Operations;
3335
import java.time.Duration;
3436
import java.time.temporal.ChronoUnit;
@@ -38,10 +40,12 @@
3840

3941
/** Entry point to ResourceHealthManager. The Resource Health Client. */
4042
public final class ResourceHealthManager {
41-
private EventsOperations eventsOperations;
42-
4343
private AvailabilityStatuses availabilityStatuses;
4444

45+
private ChildAvailabilityStatuses childAvailabilityStatuses;
46+
47+
private ChildResources childResources;
48+
4549
private Operations operations;
4650

4751
private EmergingIssues emergingIssues;
@@ -89,6 +93,7 @@ public static final class Configurable {
8993
private HttpClient httpClient;
9094
private HttpLogOptions httpLogOptions;
9195
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
96+
private final List<String> scopes = new ArrayList<>();
9297
private RetryPolicy retryPolicy;
9398
private Duration defaultPollInterval;
9499

@@ -128,6 +133,17 @@ public Configurable withPolicy(HttpPipelinePolicy policy) {
128133
return this;
129134
}
130135

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+
131147
/**
132148
* Sets the retry policy to the HTTP pipeline.
133149
*
@@ -184,6 +200,9 @@ public ResourceHealthManager authenticate(TokenCredential credential, AzureProfi
184200
userAgentBuilder.append(" (auto-generated)");
185201
}
186202

203+
if (scopes.isEmpty()) {
204+
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
205+
}
187206
if (retryPolicy == null) {
188207
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
189208
}
@@ -193,10 +212,7 @@ public ResourceHealthManager authenticate(TokenCredential credential, AzureProfi
193212
HttpPolicyProviders.addBeforeRetryPolicies(policies);
194213
policies.add(retryPolicy);
195214
policies.add(new AddDatePolicy());
196-
policies
197-
.add(
198-
new BearerTokenAuthenticationPolicy(
199-
credential, profile.getEnvironment().getManagementEndpoint() + "/.default"));
215+
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
200216
policies.addAll(this.policies);
201217
HttpPolicyProviders.addAfterRetryPolicies(policies);
202218
policies.add(new HttpLoggingPolicy(httpLogOptions));
@@ -209,14 +225,6 @@ public ResourceHealthManager authenticate(TokenCredential credential, AzureProfi
209225
}
210226
}
211227

212-
/** @return Resource collection API of EventsOperations. */
213-
public EventsOperations eventsOperations() {
214-
if (this.eventsOperations == null) {
215-
this.eventsOperations = new EventsOperationsImpl(clientObject.getEventsOperations(), this);
216-
}
217-
return eventsOperations;
218-
}
219-
220228
/** @return Resource collection API of AvailabilityStatuses. */
221229
public AvailabilityStatuses availabilityStatuses() {
222230
if (this.availabilityStatuses == null) {
@@ -225,6 +233,23 @@ public AvailabilityStatuses availabilityStatuses() {
225233
return availabilityStatuses;
226234
}
227235

236+
/** @return Resource collection API of ChildAvailabilityStatuses. */
237+
public ChildAvailabilityStatuses childAvailabilityStatuses() {
238+
if (this.childAvailabilityStatuses == null) {
239+
this.childAvailabilityStatuses =
240+
new ChildAvailabilityStatusesImpl(clientObject.getChildAvailabilityStatuses(), this);
241+
}
242+
return childAvailabilityStatuses;
243+
}
244+
245+
/** @return Resource collection API of ChildResources. */
246+
public ChildResources childResources() {
247+
if (this.childResources == null) {
248+
this.childResources = new ChildResourcesImpl(clientObject.getChildResources(), this);
249+
}
250+
return childResources;
251+
}
252+
228253
/** @return Resource collection API of Operations. */
229254
public Operations operations() {
230255
if (this.operations == null) {

sdk/resourcehealth/azure-resourcemanager-resourcehealth/src/main/java/com/azure/resourcemanager/resourcehealth/fluent/AvailabilityStatusesClient.java

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414
/** An instance of this class provides access to all the operations defined in AvailabilityStatusesClient. */
1515
public interface AvailabilityStatusesClient {
1616
/**
17-
* Lists the current availability status for all the resources in the subscription.
17+
* Lists the current availability status for all the resources in the subscription. Use the nextLink property in the
18+
* response to get the next page of availability statuses.
1819
*
1920
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
2021
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -24,7 +25,8 @@ public interface AvailabilityStatusesClient {
2425
PagedIterable<AvailabilityStatusInner> listBySubscriptionId();
2526

2627
/**
27-
* Lists the current availability status for all the resources in the subscription.
28+
* Lists the current availability status for all the resources in the subscription. Use the nextLink property in the
29+
* response to get the next page of availability statuses.
2830
*
2931
* @param filter The filter to apply on the operation. For more information please see
3032
* https://docs.microsoft.com/en-us/rest/api/apimanagement/apis?redirectedfrom=MSDN.
@@ -39,7 +41,8 @@ public interface AvailabilityStatusesClient {
3941
PagedIterable<AvailabilityStatusInner> listBySubscriptionId(String filter, String expand, Context context);
4042

4143
/**
42-
* Lists the current availability status for all the resources in the resource group.
44+
* Lists the current availability status for all the resources in the resource group. Use the nextLink property in
45+
* the response to get the next page of availability statuses.
4346
*
4447
* @param resourceGroupName The name of the resource group.
4548
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -51,7 +54,8 @@ public interface AvailabilityStatusesClient {
5154
PagedIterable<AvailabilityStatusInner> listByResourceGroup(String resourceGroupName);
5255

5356
/**
54-
* Lists the current availability status for all the resources in the resource group.
57+
* Lists the current availability status for all the resources in the resource group. Use the nextLink property in
58+
* the response to get the next page of availability statuses.
5559
*
5660
* @param resourceGroupName The name of the resource group.
5761
* @param filter The filter to apply on the operation. For more information please see
@@ -105,7 +109,8 @@ Response<AvailabilityStatusInner> getByResourceWithResponse(
105109
String resourceUri, String filter, String expand, Context context);
106110

107111
/**
108-
* Lists all historical availability transitions and impacting events for a single resource.
112+
* Lists all historical availability transitions and impacting events for a single resource. Use the nextLink
113+
* property in the response to get the next page of availability status.
109114
*
110115
* @param resourceUri The fully qualified ID of the resource, including the resource name and resource type.
111116
* Currently the API support not nested and one nesting level resource types :
@@ -121,7 +126,8 @@ Response<AvailabilityStatusInner> getByResourceWithResponse(
121126
PagedIterable<AvailabilityStatusInner> list(String resourceUri);
122127

123128
/**
124-
* Lists all historical availability transitions and impacting events for a single resource.
129+
* Lists all historical availability transitions and impacting events for a single resource. Use the nextLink
130+
* property in the response to get the next page of availability status.
125131
*
126132
* @param resourceUri The fully qualified ID of the resource, including the resource name and resource type.
127133
* Currently the API support not nested and one nesting level resource types :

0 commit comments

Comments
 (0)