From e9b549a65f5883c0d63d301f56db69f7f543323d Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Fri, 10 Dec 2021 03:26:44 +0000 Subject: [PATCH] CodeGen from PR 17002 in Azure/azure-rest-api-specs Merge e3d727dac88692c28f5709082bb25f867673e4af into 52f9379c7709eb53f15b875b7de9b1abfa17f298 --- .../CHANGELOG.md | 4 +++- .../azure-resourcemanager-webpubsub/README.md | 2 +- .../webpubsub/WebPubSubManager.java | 19 +++++++++++++++++-- .../WebPubSubHubsClientImpl.java | 9 +++++++-- ...bPrivateEndpointConnectionsClientImpl.java | 3 ++- ...bSharedPrivateLinkResourcesClientImpl.java | 5 +++-- .../implementation/WebPubSubsClientImpl.java | 16 +++++++++++----- 7 files changed, 44 insertions(+), 14 deletions(-) diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/CHANGELOG.md b/sdk/webpubsub/azure-resourcemanager-webpubsub/CHANGELOG.md index c422efb6998e4..716ad0e4969de 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/CHANGELOG.md +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2021-12-10) + +- 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-2021-10-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Features Added diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/README.md b/sdk/webpubsub/azure-resourcemanager-webpubsub/README.md index aed73f4e1fd99..22d6e16e903a8 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/README.md +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-webpubsub - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/WebPubSubManager.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/WebPubSubManager.java index 26f61ee4e121a..ff92d3b8014ae 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/WebPubSubManager.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/WebPubSubManager.java @@ -8,6 +8,7 @@ import com.azure.core.http.HttpClient; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpPipelineBuilder; +import com.azure.core.http.HttpPipelinePosition; import com.azure.core.http.policy.AddDatePolicy; import com.azure.core.http.policy.HttpLogOptions; import com.azure.core.http.policy.HttpLoggingPolicy; @@ -41,6 +42,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Objects; +import java.util.stream.Collectors; /** Entry point to WebPubSubManager. REST API for Azure WebPubSub Service. */ public final class WebPubSubManager { @@ -194,7 +196,7 @@ public WebPubSubManager authenticate(TokenCredential credential, AzureProfile pr .append("-") .append("com.azure.resourcemanager.webpubsub") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -217,11 +219,24 @@ public WebPubSubManager authenticate(TokenCredential credential, AzureProfile pr List policies = new ArrayList<>(); policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new RequestIdPolicy()); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies.addAll(this.policies); + policies + .addAll( + this + .policies + .stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsClientImpl.java index a10875455e574..a9b500ba4631d 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubHubsClientImpl.java @@ -632,7 +632,11 @@ private PollerFlux, WebPubSubHubInner> beginCreate return this .client .getLroResult( - mono, this.client.getHttpPipeline(), WebPubSubHubInner.class, WebPubSubHubInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + WebPubSubHubInner.class, + WebPubSubHubInner.class, + this.client.getContext()); } /** @@ -906,7 +910,8 @@ private PollerFlux, Void> beginDeleteAsync( Mono>> mono = deleteWithResponseAsync(hubName, resourceGroupName, resourceName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsClientImpl.java index 3e592fe99eb17..3fdcc4977f6ba 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubPrivateEndpointConnectionsClientImpl.java @@ -850,7 +850,8 @@ private PollerFlux, Void> beginDeleteAsync( deleteWithResponseAsync(privateEndpointConnectionName, resourceGroupName, resourceName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java index 931051e5fbc47..45c179f4f7a7b 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java @@ -670,7 +670,7 @@ private Mono>> createOrUpdateWithResponseAsync( this.client.getHttpPipeline(), SharedPrivateLinkResourceInner.class, SharedPrivateLinkResourceInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -987,7 +987,8 @@ private PollerFlux, Void> beginDeleteAsync( deleteWithResponseAsync(sharedPrivateLinkResourceName, resourceGroupName, resourceName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsClientImpl.java index e1e370a1914ad..47b0c2cadee80 100644 --- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsClientImpl.java +++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubsClientImpl.java @@ -1008,7 +1008,7 @@ private PollerFlux, WebPubSubResourceInner> b this.client.getHttpPipeline(), WebPubSubResourceInner.class, WebPubSubResourceInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -1266,7 +1266,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup Mono>> mono = deleteWithResponseAsync(resourceGroupName, resourceName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** @@ -1524,7 +1525,7 @@ private PollerFlux, WebPubSubResourceInner> b this.client.getHttpPipeline(), WebPubSubResourceInner.class, WebPubSubResourceInner.class, - Context.NONE); + this.client.getContext()); } /** @@ -1955,7 +1956,11 @@ private PollerFlux, WebPubSubKeysInner> beginRege return this .client .getLroResult( - mono, this.client.getHttpPipeline(), WebPubSubKeysInner.class, WebPubSubKeysInner.class, Context.NONE); + mono, + this.client.getHttpPipeline(), + WebPubSubKeysInner.class, + WebPubSubKeysInner.class, + this.client.getContext()); } /** @@ -2209,7 +2214,8 @@ private PollerFlux, Void> beginRestartAsync(String resourceGrou Mono>> mono = restartWithResponseAsync(resourceGroupName, resourceName); return this .client - .getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, Context.NONE); + .getLroResult( + mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /**