Skip to content

Commit 29ce547

Browse files
author
SDKAuto
committed
CodeGen from PR 20467 in Azure/azure-rest-api-specs
Merge 58153c4cc41140067071e0895c5e4484527f9b20 into 9366804c62e024801daf8a578924099ff644ccf6
1 parent 6253460 commit 29ce547

File tree

165 files changed

+6998
-1239
lines changed

Some content is hidden

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

165 files changed

+6998
-1239
lines changed

sdk/webpubsub/azure-resourcemanager-webpubsub/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.3 (Unreleased)
3+
## 1.0.0-beta.1 (2022-10-19)
4+
5+
- Azure Resource Manager WebPubSub client library for Java. This package contains Microsoft Azure SDK for WebPubSub Management SDK. REST API for Azure WebPubSub Service. Package tag package-2022-08-01-preview. 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/webpubsub/azure-resourcemanager-webpubsub/README.md

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

33
Azure Resource Manager WebPubSub client library for Java.
44

5-
This package contains Microsoft Azure SDK for WebPubSub Management SDK. REST API for Azure WebPubSub Service. Package tag package-2021-10-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 WebPubSub Management SDK. REST API for Azure WebPubSub Service. Package tag package-2022-08-01-preview. 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-webpubsub</artifactId>
35-
<version>1.0.0-beta.2</version>
35+
<version>1.0.0-beta.3</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})

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

Lines changed: 251 additions & 45 deletions
Large diffs are not rendered by default.

sdk/webpubsub/azure-resourcemanager-webpubsub/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<packaging>jar</packaging>
1414

1515
<name>Microsoft Azure SDK for WebPubSub Management</name>
16-
<description>This package contains Microsoft Azure SDK for WebPubSub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for Azure WebPubSub Service. Package tag package-2021-10-01.</description>
16+
<description>This package contains Microsoft Azure SDK for WebPubSub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for Azure WebPubSub Service. Package tag package-2022-08-01-preview.</description>
1717
<url>https://github.com/Azure/azure-sdk-for-java</url>
1818

1919
<licenses>

sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/WebPubSubManager.java

Lines changed: 126 additions & 13 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;
@@ -23,6 +26,8 @@
2326
import com.azure.resourcemanager.webpubsub.fluent.WebPubSubManagementClient;
2427
import com.azure.resourcemanager.webpubsub.implementation.OperationsImpl;
2528
import com.azure.resourcemanager.webpubsub.implementation.UsagesImpl;
29+
import com.azure.resourcemanager.webpubsub.implementation.WebPubSubCustomCertificatesImpl;
30+
import com.azure.resourcemanager.webpubsub.implementation.WebPubSubCustomDomainsImpl;
2631
import com.azure.resourcemanager.webpubsub.implementation.WebPubSubHubsImpl;
2732
import com.azure.resourcemanager.webpubsub.implementation.WebPubSubManagementClientBuilder;
2833
import com.azure.resourcemanager.webpubsub.implementation.WebPubSubPrivateEndpointConnectionsImpl;
@@ -31,6 +36,8 @@
3136
import com.azure.resourcemanager.webpubsub.implementation.WebPubSubsImpl;
3237
import com.azure.resourcemanager.webpubsub.models.Operations;
3338
import com.azure.resourcemanager.webpubsub.models.Usages;
39+
import com.azure.resourcemanager.webpubsub.models.WebPubSubCustomCertificates;
40+
import com.azure.resourcemanager.webpubsub.models.WebPubSubCustomDomains;
3441
import com.azure.resourcemanager.webpubsub.models.WebPubSubHubs;
3542
import com.azure.resourcemanager.webpubsub.models.WebPubSubPrivateEndpointConnections;
3643
import com.azure.resourcemanager.webpubsub.models.WebPubSubPrivateLinkResources;
@@ -41,6 +48,7 @@
4148
import java.util.ArrayList;
4249
import java.util.List;
4350
import java.util.Objects;
51+
import java.util.stream.Collectors;
4452

4553
/** Entry point to WebPubSubManager. REST API for Azure WebPubSub Service. */
4654
public final class WebPubSubManager {
@@ -50,6 +58,10 @@ public final class WebPubSubManager {
5058

5159
private Usages usages;
5260

61+
private WebPubSubCustomCertificates webPubSubCustomCertificates;
62+
63+
private WebPubSubCustomDomains webPubSubCustomDomains;
64+
5365
private WebPubSubHubs webPubSubHubs;
5466

5567
private WebPubSubPrivateEndpointConnections webPubSubPrivateEndpointConnections;
@@ -85,6 +97,19 @@ public static WebPubSubManager authenticate(TokenCredential credential, AzurePro
8597
return configure().authenticate(credential, profile);
8698
}
8799

100+
/**
101+
* Creates an instance of WebPubSub service API entry point.
102+
*
103+
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
104+
* @param profile the Azure profile for client.
105+
* @return the WebPubSub service API instance.
106+
*/
107+
public static WebPubSubManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
108+
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
109+
Objects.requireNonNull(profile, "'profile' cannot be null.");
110+
return new WebPubSubManager(httpPipeline, profile, null);
111+
}
112+
88113
/**
89114
* Gets a Configurable instance that can be used to create WebPubSubManager with optional configuration.
90115
*
@@ -96,13 +121,14 @@ public static Configurable configure() {
96121

97122
/** The Configurable allowing configurations to be set. */
98123
public static final class Configurable {
99-
private final ClientLogger logger = new ClientLogger(Configurable.class);
124+
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
100125

101126
private HttpClient httpClient;
102127
private HttpLogOptions httpLogOptions;
103128
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
104129
private final List<String> scopes = new ArrayList<>();
105130
private RetryPolicy retryPolicy;
131+
private RetryOptions retryOptions;
106132
private Duration defaultPollInterval;
107133

108134
private Configurable() {
@@ -163,16 +189,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
163189
return this;
164190
}
165191

192+
/**
193+
* Sets the retry options for the HTTP pipeline retry policy.
194+
*
195+
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
196+
*
197+
* @param retryOptions the retry options for the HTTP pipeline retry policy.
198+
* @return the configurable object itself.
199+
*/
200+
public Configurable withRetryOptions(RetryOptions retryOptions) {
201+
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
202+
return this;
203+
}
204+
166205
/**
167206
* Sets the default poll interval, used when service does not provide "Retry-After" header.
168207
*
169208
* @param defaultPollInterval the default poll interval.
170209
* @return the configurable object itself.
171210
*/
172211
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
173-
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
212+
this.defaultPollInterval =
213+
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
174214
if (this.defaultPollInterval.isNegative()) {
175-
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
215+
throw LOGGER
216+
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
176217
}
177218
return this;
178219
}
@@ -194,7 +235,7 @@ public WebPubSubManager authenticate(TokenCredential credential, AzureProfile pr
194235
.append("-")
195236
.append("com.azure.resourcemanager.webpubsub")
196237
.append("/")
197-
.append("1.0.0-beta.2");
238+
.append("1.0.0-beta.1");
198239
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
199240
userAgentBuilder
200241
.append(" (")
@@ -212,16 +253,34 @@ public WebPubSubManager authenticate(TokenCredential credential, AzureProfile pr
212253
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
213254
}
214255
if (retryPolicy == null) {
215-
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
256+
if (retryOptions != null) {
257+
retryPolicy = new RetryPolicy(retryOptions);
258+
} else {
259+
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
260+
}
216261
}
217262
List<HttpPipelinePolicy> policies = new ArrayList<>();
218263
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
264+
policies.add(new AddHeadersFromContextPolicy());
219265
policies.add(new RequestIdPolicy());
266+
policies
267+
.addAll(
268+
this
269+
.policies
270+
.stream()
271+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
272+
.collect(Collectors.toList()));
220273
HttpPolicyProviders.addBeforeRetryPolicies(policies);
221274
policies.add(retryPolicy);
222275
policies.add(new AddDatePolicy());
223276
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
224-
policies.addAll(this.policies);
277+
policies
278+
.addAll(
279+
this
280+
.policies
281+
.stream()
282+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
283+
.collect(Collectors.toList()));
225284
HttpPolicyProviders.addAfterRetryPolicies(policies);
226285
policies.add(new HttpLoggingPolicy(httpLogOptions));
227286
HttpPipeline httpPipeline =
@@ -233,39 +292,85 @@ public WebPubSubManager authenticate(TokenCredential credential, AzureProfile pr
233292
}
234293
}
235294

236-
/** @return Resource collection API of Operations. */
295+
/**
296+
* Gets the resource collection API of Operations.
297+
*
298+
* @return Resource collection API of Operations.
299+
*/
237300
public Operations operations() {
238301
if (this.operations == null) {
239302
this.operations = new OperationsImpl(clientObject.getOperations(), this);
240303
}
241304
return operations;
242305
}
243306

244-
/** @return Resource collection API of WebPubSubs. */
307+
/**
308+
* Gets the resource collection API of WebPubSubs. It manages WebPubSubResource.
309+
*
310+
* @return Resource collection API of WebPubSubs.
311+
*/
245312
public WebPubSubs webPubSubs() {
246313
if (this.webPubSubs == null) {
247314
this.webPubSubs = new WebPubSubsImpl(clientObject.getWebPubSubs(), this);
248315
}
249316
return webPubSubs;
250317
}
251318

252-
/** @return Resource collection API of Usages. */
319+
/**
320+
* Gets the resource collection API of Usages.
321+
*
322+
* @return Resource collection API of Usages.
323+
*/
253324
public Usages usages() {
254325
if (this.usages == null) {
255326
this.usages = new UsagesImpl(clientObject.getUsages(), this);
256327
}
257328
return usages;
258329
}
259330

260-
/** @return Resource collection API of WebPubSubHubs. */
331+
/**
332+
* Gets the resource collection API of WebPubSubCustomCertificates. It manages CustomCertificate.
333+
*
334+
* @return Resource collection API of WebPubSubCustomCertificates.
335+
*/
336+
public WebPubSubCustomCertificates webPubSubCustomCertificates() {
337+
if (this.webPubSubCustomCertificates == null) {
338+
this.webPubSubCustomCertificates =
339+
new WebPubSubCustomCertificatesImpl(clientObject.getWebPubSubCustomCertificates(), this);
340+
}
341+
return webPubSubCustomCertificates;
342+
}
343+
344+
/**
345+
* Gets the resource collection API of WebPubSubCustomDomains. It manages CustomDomain.
346+
*
347+
* @return Resource collection API of WebPubSubCustomDomains.
348+
*/
349+
public WebPubSubCustomDomains webPubSubCustomDomains() {
350+
if (this.webPubSubCustomDomains == null) {
351+
this.webPubSubCustomDomains =
352+
new WebPubSubCustomDomainsImpl(clientObject.getWebPubSubCustomDomains(), this);
353+
}
354+
return webPubSubCustomDomains;
355+
}
356+
357+
/**
358+
* Gets the resource collection API of WebPubSubHubs. It manages WebPubSubHub.
359+
*
360+
* @return Resource collection API of WebPubSubHubs.
361+
*/
261362
public WebPubSubHubs webPubSubHubs() {
262363
if (this.webPubSubHubs == null) {
263364
this.webPubSubHubs = new WebPubSubHubsImpl(clientObject.getWebPubSubHubs(), this);
264365
}
265366
return webPubSubHubs;
266367
}
267368

268-
/** @return Resource collection API of WebPubSubPrivateEndpointConnections. */
369+
/**
370+
* Gets the resource collection API of WebPubSubPrivateEndpointConnections.
371+
*
372+
* @return Resource collection API of WebPubSubPrivateEndpointConnections.
373+
*/
269374
public WebPubSubPrivateEndpointConnections webPubSubPrivateEndpointConnections() {
270375
if (this.webPubSubPrivateEndpointConnections == null) {
271376
this.webPubSubPrivateEndpointConnections =
@@ -275,7 +380,11 @@ public WebPubSubPrivateEndpointConnections webPubSubPrivateEndpointConnections()
275380
return webPubSubPrivateEndpointConnections;
276381
}
277382

278-
/** @return Resource collection API of WebPubSubPrivateLinkResources. */
383+
/**
384+
* Gets the resource collection API of WebPubSubPrivateLinkResources.
385+
*
386+
* @return Resource collection API of WebPubSubPrivateLinkResources.
387+
*/
279388
public WebPubSubPrivateLinkResources webPubSubPrivateLinkResources() {
280389
if (this.webPubSubPrivateLinkResources == null) {
281390
this.webPubSubPrivateLinkResources =
@@ -284,7 +393,11 @@ public WebPubSubPrivateLinkResources webPubSubPrivateLinkResources() {
284393
return webPubSubPrivateLinkResources;
285394
}
286395

287-
/** @return Resource collection API of WebPubSubSharedPrivateLinkResources. */
396+
/**
397+
* Gets the resource collection API of WebPubSubSharedPrivateLinkResources. It manages SharedPrivateLinkResource.
398+
*
399+
* @return Resource collection API of WebPubSubSharedPrivateLinkResources.
400+
*/
288401
public WebPubSubSharedPrivateLinkResources webPubSubSharedPrivateLinkResources() {
289402
if (this.webPubSubSharedPrivateLinkResources == null) {
290403
this.webPubSubSharedPrivateLinkResources =

sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/OperationsClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public interface OperationsClient {
1717
*
1818
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
1919
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
20-
* @return result of the request to list REST API operations.
20+
* @return result of the request to list REST API operations as paginated response with {@link PagedIterable}.
2121
*/
2222
@ServiceMethod(returns = ReturnType.COLLECTION)
2323
PagedIterable<OperationInner> list();
@@ -29,7 +29,7 @@ public interface OperationsClient {
2929
* @throws IllegalArgumentException thrown if parameters fail the validation.
3030
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
3131
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
32-
* @return result of the request to list REST API operations.
32+
* @return result of the request to list REST API operations as paginated response with {@link PagedIterable}.
3333
*/
3434
@ServiceMethod(returns = ReturnType.COLLECTION)
3535
PagedIterable<OperationInner> list(Context context);

sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/fluent/UsagesClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ public interface UsagesClient {
1919
* @throws IllegalArgumentException thrown if parameters fail the validation.
2020
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
2121
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
22-
* @return object that includes an array of the resource usages and a possible link for next set.
22+
* @return object that includes an array of the resource usages and a possible link for next set as paginated
23+
* response with {@link PagedIterable}.
2324
*/
2425
@ServiceMethod(returns = ReturnType.COLLECTION)
2526
PagedIterable<SignalRServiceUsageInner> list(String location);
@@ -32,7 +33,8 @@ public interface UsagesClient {
3233
* @throws IllegalArgumentException thrown if parameters fail the validation.
3334
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
3435
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
35-
* @return object that includes an array of the resource usages and a possible link for next set.
36+
* @return object that includes an array of the resource usages and a possible link for next set as paginated
37+
* response with {@link PagedIterable}.
3638
*/
3739
@ServiceMethod(returns = ReturnType.COLLECTION)
3840
PagedIterable<SignalRServiceUsageInner> list(String location, Context context);

0 commit comments

Comments
 (0)