Skip to content

Commit ba77af0

Browse files
author
SDKAuto
committed
CodeGen from PR 21043 in Azure/azure-rest-api-specs
Merge 54ab50e23d5066484f6c169903832b6fc469e53b into 0af1101de444d29bfb59dcc25d017d375337c984
1 parent a6c8651 commit ba77af0

File tree

176 files changed

+2076
-1952
lines changed

Some content is hidden

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

176 files changed

+2076
-1952
lines changed

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

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

3-
## 1.0.0-beta.6 (Unreleased)
3+
## 1.0.0-beta.1 (2022-10-10)
4+
5+
- Azure Resource Manager HDInsight client library for Java. This package contains Microsoft Azure SDK for HDInsight Management SDK. HDInsight Management Client. Package tag package-2021-06. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
46

57
### Features Added
68

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

Lines changed: 1 addition & 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-hdinsight</artifactId>
35-
<version>1.0.0-beta.5</version>
35+
<version>1.0.0-beta.6</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})

sdk/hdinsight/azure-resourcemanager-hdinsight/SAMPLE.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
- [ListUsages](#locations_listusages)
5555
- [ValidateClusterCreateRequest](#locations_validateclustercreaterequest)
5656

57+
## Operations
58+
59+
- [List](#operations_list)
60+
5761
## PrivateEndpointConnections
5862

5963
- [CreateOrUpdate](#privateendpointconnections_createorupdate)
@@ -2524,6 +2528,27 @@ public final class LocationsValidateClusterCreateRequestSamples {
25242528
}
25252529
```
25262530

2531+
### Operations_List
2532+
2533+
```java
2534+
import com.azure.core.util.Context;
2535+
2536+
/** Samples for Operations List. */
2537+
public final class OperationsListSamples {
2538+
/*
2539+
* x-ms-original-file: specification/hdinsight/resource-manager/Microsoft.HDInsight/stable/2021-06-01/examples/ListHDInsightOperations.json
2540+
*/
2541+
/**
2542+
* Sample code: Lists all of the available operations.
2543+
*
2544+
* @param manager Entry point to HDInsightManager.
2545+
*/
2546+
public static void listsAllOfTheAvailableOperations(com.azure.resourcemanager.hdinsight.HDInsightManager manager) {
2547+
manager.operations().list(Context.NONE);
2548+
}
2549+
}
2550+
```
2551+
25272552
### PrivateEndpointConnections_CreateOrUpdate
25282553

25292554
```java

sdk/hdinsight/azure-resourcemanager-hdinsight/src/main/java/com/azure/resourcemanager/hdinsight/HDInsightManager.java

Lines changed: 112 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@
88
import com.azure.core.http.HttpClient;
99
import com.azure.core.http.HttpPipeline;
1010
import com.azure.core.http.HttpPipelineBuilder;
11+
import com.azure.core.http.HttpPipelinePosition;
1112
import com.azure.core.http.policy.AddDatePolicy;
13+
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
1214
import com.azure.core.http.policy.HttpLogOptions;
1315
import com.azure.core.http.policy.HttpLoggingPolicy;
1416
import com.azure.core.http.policy.HttpPipelinePolicy;
1517
import com.azure.core.http.policy.HttpPolicyProviders;
1618
import com.azure.core.http.policy.RequestIdPolicy;
19+
import com.azure.core.http.policy.RetryOptions;
1720
import com.azure.core.http.policy.RetryPolicy;
1821
import com.azure.core.http.policy.UserAgentPolicy;
1922
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
@@ -49,6 +52,7 @@
4952
import java.util.ArrayList;
5053
import java.util.List;
5154
import java.util.Objects;
55+
import java.util.stream.Collectors;
5256

5357
/** Entry point to HDInsightManager. HDInsight Management Client. */
5458
public final class HDInsightManager {
@@ -101,6 +105,19 @@ public static HDInsightManager authenticate(TokenCredential credential, AzurePro
101105
return configure().authenticate(credential, profile);
102106
}
103107

108+
/**
109+
* Creates an instance of HDInsight service API entry point.
110+
*
111+
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
112+
* @param profile the Azure profile for client.
113+
* @return the HDInsight service API instance.
114+
*/
115+
public static HDInsightManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
116+
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
117+
Objects.requireNonNull(profile, "'profile' cannot be null.");
118+
return new HDInsightManager(httpPipeline, profile, null);
119+
}
120+
104121
/**
105122
* Gets a Configurable instance that can be used to create HDInsightManager with optional configuration.
106123
*
@@ -112,13 +129,14 @@ public static Configurable configure() {
112129

113130
/** The Configurable allowing configurations to be set. */
114131
public static final class Configurable {
115-
private final ClientLogger logger = new ClientLogger(Configurable.class);
132+
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
116133

117134
private HttpClient httpClient;
118135
private HttpLogOptions httpLogOptions;
119136
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
120137
private final List<String> scopes = new ArrayList<>();
121138
private RetryPolicy retryPolicy;
139+
private RetryOptions retryOptions;
122140
private Duration defaultPollInterval;
123141

124142
private Configurable() {
@@ -179,16 +197,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
179197
return this;
180198
}
181199

200+
/**
201+
* Sets the retry options for the HTTP pipeline retry policy.
202+
*
203+
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
204+
*
205+
* @param retryOptions the retry options for the HTTP pipeline retry policy.
206+
* @return the configurable object itself.
207+
*/
208+
public Configurable withRetryOptions(RetryOptions retryOptions) {
209+
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
210+
return this;
211+
}
212+
182213
/**
183214
* Sets the default poll interval, used when service does not provide "Retry-After" header.
184215
*
185216
* @param defaultPollInterval the default poll interval.
186217
* @return the configurable object itself.
187218
*/
188219
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
189-
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
220+
this.defaultPollInterval =
221+
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
190222
if (this.defaultPollInterval.isNegative()) {
191-
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
223+
throw LOGGER
224+
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
192225
}
193226
return this;
194227
}
@@ -210,7 +243,7 @@ public HDInsightManager authenticate(TokenCredential credential, AzureProfile pr
210243
.append("-")
211244
.append("com.azure.resourcemanager.hdinsight")
212245
.append("/")
213-
.append("1.0.0-beta.5");
246+
.append("1.0.0-beta.1");
214247
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
215248
userAgentBuilder
216249
.append(" (")
@@ -228,16 +261,34 @@ public HDInsightManager authenticate(TokenCredential credential, AzureProfile pr
228261
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
229262
}
230263
if (retryPolicy == null) {
231-
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
264+
if (retryOptions != null) {
265+
retryPolicy = new RetryPolicy(retryOptions);
266+
} else {
267+
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
268+
}
232269
}
233270
List<HttpPipelinePolicy> policies = new ArrayList<>();
234271
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
272+
policies.add(new AddHeadersFromContextPolicy());
235273
policies.add(new RequestIdPolicy());
274+
policies
275+
.addAll(
276+
this
277+
.policies
278+
.stream()
279+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
280+
.collect(Collectors.toList()));
236281
HttpPolicyProviders.addBeforeRetryPolicies(policies);
237282
policies.add(retryPolicy);
238283
policies.add(new AddDatePolicy());
239284
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
240-
policies.addAll(this.policies);
285+
policies
286+
.addAll(
287+
this
288+
.policies
289+
.stream()
290+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
291+
.collect(Collectors.toList()));
241292
HttpPolicyProviders.addAfterRetryPolicies(policies);
242293
policies.add(new HttpLoggingPolicy(httpLogOptions));
243294
HttpPipeline httpPipeline =
@@ -249,55 +300,83 @@ public HDInsightManager authenticate(TokenCredential credential, AzureProfile pr
249300
}
250301
}
251302

252-
/** @return Resource collection API of Clusters. */
303+
/**
304+
* Gets the resource collection API of Clusters. It manages Cluster.
305+
*
306+
* @return Resource collection API of Clusters.
307+
*/
253308
public Clusters clusters() {
254309
if (this.clusters == null) {
255310
this.clusters = new ClustersImpl(clientObject.getClusters(), this);
256311
}
257312
return clusters;
258313
}
259314

260-
/** @return Resource collection API of Applications. */
315+
/**
316+
* Gets the resource collection API of Applications. It manages Application.
317+
*
318+
* @return Resource collection API of Applications.
319+
*/
261320
public Applications applications() {
262321
if (this.applications == null) {
263322
this.applications = new ApplicationsImpl(clientObject.getApplications(), this);
264323
}
265324
return applications;
266325
}
267326

268-
/** @return Resource collection API of Locations. */
327+
/**
328+
* Gets the resource collection API of Locations.
329+
*
330+
* @return Resource collection API of Locations.
331+
*/
269332
public Locations locations() {
270333
if (this.locations == null) {
271334
this.locations = new LocationsImpl(clientObject.getLocations(), this);
272335
}
273336
return locations;
274337
}
275338

276-
/** @return Resource collection API of Configurations. */
339+
/**
340+
* Gets the resource collection API of Configurations.
341+
*
342+
* @return Resource collection API of Configurations.
343+
*/
277344
public Configurations configurations() {
278345
if (this.configurations == null) {
279346
this.configurations = new ConfigurationsImpl(clientObject.getConfigurations(), this);
280347
}
281348
return configurations;
282349
}
283350

284-
/** @return Resource collection API of Extensions. */
351+
/**
352+
* Gets the resource collection API of Extensions.
353+
*
354+
* @return Resource collection API of Extensions.
355+
*/
285356
public Extensions extensions() {
286357
if (this.extensions == null) {
287358
this.extensions = new ExtensionsImpl(clientObject.getExtensions(), this);
288359
}
289360
return extensions;
290361
}
291362

292-
/** @return Resource collection API of ScriptActions. */
363+
/**
364+
* Gets the resource collection API of ScriptActions.
365+
*
366+
* @return Resource collection API of ScriptActions.
367+
*/
293368
public ScriptActions scriptActions() {
294369
if (this.scriptActions == null) {
295370
this.scriptActions = new ScriptActionsImpl(clientObject.getScriptActions(), this);
296371
}
297372
return scriptActions;
298373
}
299374

300-
/** @return Resource collection API of ScriptExecutionHistories. */
375+
/**
376+
* Gets the resource collection API of ScriptExecutionHistories.
377+
*
378+
* @return Resource collection API of ScriptExecutionHistories.
379+
*/
301380
public ScriptExecutionHistories scriptExecutionHistories() {
302381
if (this.scriptExecutionHistories == null) {
303382
this.scriptExecutionHistories =
@@ -306,23 +385,35 @@ public ScriptExecutionHistories scriptExecutionHistories() {
306385
return scriptExecutionHistories;
307386
}
308387

309-
/** @return Resource collection API of Operations. */
388+
/**
389+
* Gets the resource collection API of Operations.
390+
*
391+
* @return Resource collection API of Operations.
392+
*/
310393
public Operations operations() {
311394
if (this.operations == null) {
312395
this.operations = new OperationsImpl(clientObject.getOperations(), this);
313396
}
314397
return operations;
315398
}
316399

317-
/** @return Resource collection API of VirtualMachines. */
400+
/**
401+
* Gets the resource collection API of VirtualMachines.
402+
*
403+
* @return Resource collection API of VirtualMachines.
404+
*/
318405
public VirtualMachines virtualMachines() {
319406
if (this.virtualMachines == null) {
320407
this.virtualMachines = new VirtualMachinesImpl(clientObject.getVirtualMachines(), this);
321408
}
322409
return virtualMachines;
323410
}
324411

325-
/** @return Resource collection API of PrivateEndpointConnections. */
412+
/**
413+
* Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection.
414+
*
415+
* @return Resource collection API of PrivateEndpointConnections.
416+
*/
326417
public PrivateEndpointConnections privateEndpointConnections() {
327418
if (this.privateEndpointConnections == null) {
328419
this.privateEndpointConnections =
@@ -331,7 +422,11 @@ public PrivateEndpointConnections privateEndpointConnections() {
331422
return privateEndpointConnections;
332423
}
333424

334-
/** @return Resource collection API of PrivateLinkResources. */
425+
/**
426+
* Gets the resource collection API of PrivateLinkResources.
427+
*
428+
* @return Resource collection API of PrivateLinkResources.
429+
*/
335430
public PrivateLinkResources privateLinkResources() {
336431
if (this.privateLinkResources == null) {
337432
this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this);

0 commit comments

Comments
 (0)