From 07ecb2b8e0a4e4ef71bcfbf71ceebc3831f7b39a Mon Sep 17 00:00:00 2001 From: azure-sdk Date: Fri, 7 May 2021 18:54:46 +0000 Subject: [PATCH] [Automation] Generate Fluent Lite from iothub#package-2020-03 --- .../azure-resourcemanager-iothub/CHANGELOG.md | 15 ++- .../azure-resourcemanager-iothub/README.md | 2 +- .../azure-resourcemanager-iothub/pom.xml | 2 +- .../resourcemanager/iothub/IotHubManager.java | 3 +- .../iothub/fluent/IotHubResourcesClient.java | 15 ++- .../CertificateDescriptionImpl.java | 24 ++--- .../CertificateListDescriptionImpl.java | 8 +- .../CertificateWithNonceDescriptionImpl.java | 8 +- .../CertificatesClientImpl.java | 12 +-- .../implementation/CertificatesImpl.java | 8 +- .../EndpointHealthDataImpl.java | 8 +- .../EventHubConsumerGroupInfoImpl.java | 8 +- .../GroupIdInformationImpl.java | 8 +- .../implementation/IotHubDescriptionImpl.java | 10 +- .../IotHubNameAvailabilityInfoImpl.java | 8 +- .../IotHubQuotaMetricInfoImpl.java | 8 +- .../IotHubResourcesClientImpl.java | 98 +++++++++++-------- .../implementation/IotHubResourcesImpl.java | 8 +- .../IotHubSkuDescriptionImpl.java | 8 +- .../implementation/IotHubsClientImpl.java | 2 +- .../iothub/implementation/IotHubsImpl.java | 7 +- .../implementation/JobResponseImpl.java | 7 +- .../iothub/implementation/OperationImpl.java | 7 +- .../implementation/OperationsClientImpl.java | 4 +- .../iothub/implementation/OperationsImpl.java | 7 +- .../PrivateEndpointConnectionImpl.java | 8 +- .../PrivateEndpointConnectionsClientImpl.java | 8 +- .../PrivateEndpointConnectionsImpl.java | 8 +- .../PrivateLinkResourcesImpl.java | 8 +- ...vateLinkResourcesOperationsClientImpl.java | 4 +- .../PrivateLinkResourcesOperationsImpl.java | 8 +- .../RegistryStatisticsImpl.java | 8 +- .../ResourceProviderCommonsClientImpl.java | 2 +- .../ResourceProviderCommonsImpl.java | 8 +- ...dAccessSignatureAuthorizationRuleImpl.java | 8 +- .../TestAllRoutesResultImpl.java | 8 +- .../implementation/TestRouteResultImpl.java | 8 +- .../UserSubscriptionQuotaListResultImpl.java | 8 +- .../iothub/implementation/Utils.java | 57 ++++++----- .../iothub/models/CertificateDescription.java | 6 +- 40 files changed, 243 insertions(+), 209 deletions(-) diff --git a/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md b/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md index 08071a43b46bd..2f49e33bec5ab 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md +++ b/sdk/iothub/azure-resourcemanager-iothub/CHANGELOG.md @@ -1,7 +1,20 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.2 (2021-05-07) +- Azure Resource Manager IotHub client library for Java. This package contains Microsoft Azure SDK for IotHub Management SDK. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-2020-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). + +### Breaking Change + +#### `models.CertificateDescription$Update` was modified + +* `withIfMatch(java.lang.String)` was removed + +### New Feature + +#### `models.CertificateDescription$Update` was modified + +* `ifMatch(java.lang.String)` was added ## 1.0.0-beta.1 (2021-03-02) diff --git a/sdk/iothub/azure-resourcemanager-iothub/README.md b/sdk/iothub/azure-resourcemanager-iothub/README.md index 6bb6bc4963b7a..4def32a71c363 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/README.md +++ b/sdk/iothub/azure-resourcemanager-iothub/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-iothub - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/iothub/azure-resourcemanager-iothub/pom.xml b/sdk/iothub/azure-resourcemanager-iothub/pom.xml index 32a7d4424e913..b00755be77216 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/pom.xml +++ b/sdk/iothub/azure-resourcemanager-iothub/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for IotHub Management - This package contains Microsoft Azure SDK for IotHub Management SDK. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-2020-03. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + This package contains Microsoft Azure SDK for IotHub Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Use this API to manage the IoT hubs in your Azure subscription. Package tag package-2020-03. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java index caf6815db9058..2205321bb28c8 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/IotHubManager.java @@ -182,7 +182,7 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi .append("-") .append("com.azure.resourcemanager.iothub") .append("/") - .append("1.0.0-beta.1"); + .append("1.0.0-beta.2"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") @@ -209,6 +209,7 @@ public IotHubManager authenticate(TokenCredential credential, AzureProfile profi .add( new BearerTokenAuthenticationPolicy( credential, profile.getEnvironment().getManagementEndpoint() + "/.default")); + policies.addAll(this.policies); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java index 7ac5e999393de..1070f2767a212 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/fluent/IotHubResourcesClient.java @@ -64,7 +64,8 @@ Response getByResourceGroupWithResponse( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -84,7 +85,8 @@ SyncPoller, IotHubDescriptionInner> beginCrea /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -109,7 +111,8 @@ SyncPoller, IotHubDescriptionInner> beginCrea /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -129,7 +132,8 @@ IotHubDescriptionInner createOrUpdate( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -147,7 +151,8 @@ IotHubDescriptionInner createOrUpdate( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateDescriptionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateDescriptionImpl.java index f6fdfbacb4ffd..7c3ff835f4371 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateDescriptionImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateDescriptionImpl.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.iothub.implementation; import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.CertificateDescriptionInner; import com.azure.resourcemanager.iothub.models.CertificateBodyDescription; import com.azure.resourcemanager.iothub.models.CertificateDescription; @@ -15,7 +14,7 @@ public final class CertificateDescriptionImpl implements CertificateDescription, CertificateDescription.Definition, CertificateDescription.Update { private CertificateDescriptionInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; public String id() { return this.innerModel().id(); @@ -41,7 +40,7 @@ public CertificateDescriptionInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } @@ -97,7 +96,7 @@ public CertificateDescription create(Context context) { return this; } - CertificateDescriptionImpl(String name, IotHubManager serviceManager) { + CertificateDescriptionImpl(String name, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = new CertificateDescriptionInner(); this.serviceManager = serviceManager; this.certificateName = name; @@ -143,7 +142,8 @@ public CertificateDescription apply(Context context) { return this; } - CertificateDescriptionImpl(CertificateDescriptionInner innerObject, IotHubManager serviceManager) { + CertificateDescriptionImpl( + CertificateDescriptionInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); @@ -182,13 +182,13 @@ public CertificateDescriptionImpl withCertificate(String certificate) { } public CertificateDescriptionImpl withIfMatch(String ifMatch) { - if (isInCreateMode()) { - this.createIfMatch = ifMatch; - return this; - } else { - this.updateIfMatch = ifMatch; - return this; - } + this.createIfMatch = ifMatch; + return this; + } + + public CertificateDescriptionImpl ifMatch(String ifMatch) { + this.updateIfMatch = ifMatch; + return this; } private boolean isInCreateMode() { diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateListDescriptionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateListDescriptionImpl.java index fb088b0a32e46..f8af1dfe73fc6 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateListDescriptionImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateListDescriptionImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.CertificateDescriptionInner; import com.azure.resourcemanager.iothub.fluent.models.CertificateListDescriptionInner; import com.azure.resourcemanager.iothub.models.CertificateDescription; @@ -16,9 +15,10 @@ public final class CertificateListDescriptionImpl implements CertificateListDescription { private CertificateListDescriptionInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - CertificateListDescriptionImpl(CertificateListDescriptionInner innerObject, IotHubManager serviceManager) { + CertificateListDescriptionImpl( + CertificateListDescriptionInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -41,7 +41,7 @@ public CertificateListDescriptionInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateWithNonceDescriptionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateWithNonceDescriptionImpl.java index 0376d3e2e301d..f88bf6f8006d7 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateWithNonceDescriptionImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificateWithNonceDescriptionImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.CertificateWithNonceDescriptionInner; import com.azure.resourcemanager.iothub.models.CertificatePropertiesWithNonce; import com.azure.resourcemanager.iothub.models.CertificateWithNonceDescription; @@ -12,10 +11,11 @@ public final class CertificateWithNonceDescriptionImpl implements CertificateWithNonceDescription { private CertificateWithNonceDescriptionInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; CertificateWithNonceDescriptionImpl( - CertificateWithNonceDescriptionInner innerObject, IotHubManager serviceManager) { + CertificateWithNonceDescriptionInner innerObject, + com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -44,7 +44,7 @@ public CertificateWithNonceDescriptionInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesClientImpl.java index ba2b12cf3ffaf..42570974a5c1f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesClientImpl.java @@ -209,7 +209,7 @@ private Mono> listByIotHubWithResponse resourceName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -364,7 +364,7 @@ private Mono> getWithResponseAsync( certificateName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -545,7 +545,7 @@ private Mono> createOrUpdateWithResponseAs certificateDescription, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -788,7 +788,7 @@ private Mono> deleteWithResponseAsync( ifMatch, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -959,7 +959,7 @@ private Mono> generateVerificatio ifMatch, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1159,7 +1159,7 @@ private Mono> verifyWithResponseAsync( certificateVerificationBody, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesImpl.java index a77db696aabd6..07c0bd873816b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/CertificatesImpl.java @@ -8,7 +8,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.CertificatesClient; import com.azure.resourcemanager.iothub.fluent.models.CertificateDescriptionInner; import com.azure.resourcemanager.iothub.fluent.models.CertificateListDescriptionInner; @@ -25,9 +24,10 @@ public final class CertificatesImpl implements Certificates { private final CertificatesClient innerClient; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - public CertificatesImpl(CertificatesClient innerClient, IotHubManager serviceManager) { + public CertificatesImpl( + CertificatesClient innerClient, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -271,7 +271,7 @@ private CertificatesClient serviceClient() { return this.innerClient; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EndpointHealthDataImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EndpointHealthDataImpl.java index 8651c1880c91f..1508cdf252a65 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EndpointHealthDataImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EndpointHealthDataImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.EndpointHealthDataInner; import com.azure.resourcemanager.iothub.models.EndpointHealthData; import com.azure.resourcemanager.iothub.models.EndpointHealthStatus; @@ -12,9 +11,10 @@ public final class EndpointHealthDataImpl implements EndpointHealthData { private EndpointHealthDataInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - EndpointHealthDataImpl(EndpointHealthDataInner innerObject, IotHubManager serviceManager) { + EndpointHealthDataImpl( + EndpointHealthDataInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -31,7 +31,7 @@ public EndpointHealthDataInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EventHubConsumerGroupInfoImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EventHubConsumerGroupInfoImpl.java index eccfc30e7d7f8..fb7945732d370 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EventHubConsumerGroupInfoImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/EventHubConsumerGroupInfoImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.EventHubConsumerGroupInfoInner; import com.azure.resourcemanager.iothub.models.EventHubConsumerGroupInfo; import java.util.Collections; @@ -13,9 +12,10 @@ public final class EventHubConsumerGroupInfoImpl implements EventHubConsumerGroupInfo { private EventHubConsumerGroupInfoInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - EventHubConsumerGroupInfoImpl(EventHubConsumerGroupInfoInner innerObject, IotHubManager serviceManager) { + EventHubConsumerGroupInfoImpl( + EventHubConsumerGroupInfoInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -49,7 +49,7 @@ public EventHubConsumerGroupInfoInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/GroupIdInformationImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/GroupIdInformationImpl.java index 2a4b7cc3d9db0..f59f807fb09d6 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/GroupIdInformationImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/GroupIdInformationImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner; import com.azure.resourcemanager.iothub.models.GroupIdInformation; import com.azure.resourcemanager.iothub.models.GroupIdInformationProperties; @@ -12,9 +11,10 @@ public final class GroupIdInformationImpl implements GroupIdInformation { private GroupIdInformationInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - GroupIdInformationImpl(GroupIdInformationInner innerObject, IotHubManager serviceManager) { + GroupIdInformationImpl( + GroupIdInformationInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -39,7 +39,7 @@ public GroupIdInformationInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubDescriptionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubDescriptionImpl.java index b981fb1ce4c1e..f095491e588a0 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubDescriptionImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubDescriptionImpl.java @@ -8,7 +8,6 @@ import com.azure.core.http.rest.Response; import com.azure.core.management.Region; import com.azure.core.util.Context; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.IotHubDescriptionInner; import com.azure.resourcemanager.iothub.models.ExportDevicesRequest; import com.azure.resourcemanager.iothub.models.ImportDevicesRequest; @@ -25,7 +24,7 @@ public final class IotHubDescriptionImpl implements IotHubDescription, IotHubDescription.Definition, IotHubDescription.Update { private IotHubDescriptionInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; public String id() { return this.innerModel().id(); @@ -76,7 +75,7 @@ public IotHubDescriptionInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } @@ -111,7 +110,7 @@ public IotHubDescription create(Context context) { return this; } - IotHubDescriptionImpl(String name, IotHubManager serviceManager) { + IotHubDescriptionImpl(String name, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = new IotHubDescriptionInner(); this.serviceManager = serviceManager; this.resourceName = name; @@ -141,7 +140,8 @@ public IotHubDescription apply(Context context) { return this; } - IotHubDescriptionImpl(IotHubDescriptionInner innerObject, IotHubManager serviceManager) { + IotHubDescriptionImpl( + IotHubDescriptionInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubNameAvailabilityInfoImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubNameAvailabilityInfoImpl.java index 630ffccd4b67d..dd131206d8821 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubNameAvailabilityInfoImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubNameAvailabilityInfoImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.IotHubNameAvailabilityInfoInner; import com.azure.resourcemanager.iothub.models.IotHubNameAvailabilityInfo; import com.azure.resourcemanager.iothub.models.IotHubNameUnavailabilityReason; @@ -12,9 +11,10 @@ public final class IotHubNameAvailabilityInfoImpl implements IotHubNameAvailabilityInfo { private IotHubNameAvailabilityInfoInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - IotHubNameAvailabilityInfoImpl(IotHubNameAvailabilityInfoInner innerObject, IotHubManager serviceManager) { + IotHubNameAvailabilityInfoImpl( + IotHubNameAvailabilityInfoInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -35,7 +35,7 @@ public IotHubNameAvailabilityInfoInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubQuotaMetricInfoImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubQuotaMetricInfoImpl.java index e42e748285efe..f6f4212c0843e 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubQuotaMetricInfoImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubQuotaMetricInfoImpl.java @@ -4,16 +4,16 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.IotHubQuotaMetricInfoInner; import com.azure.resourcemanager.iothub.models.IotHubQuotaMetricInfo; public final class IotHubQuotaMetricInfoImpl implements IotHubQuotaMetricInfo { private IotHubQuotaMetricInfoInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - IotHubQuotaMetricInfoImpl(IotHubQuotaMetricInfoInner innerObject, IotHubManager serviceManager) { + IotHubQuotaMetricInfoImpl( + IotHubQuotaMetricInfoInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -34,7 +34,7 @@ public IotHubQuotaMetricInfoInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java index 38c5108481168..23a3dcfb5f869 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesClientImpl.java @@ -569,7 +569,7 @@ private Mono> getByResourceGroupWithResponseAsy resourceName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -676,7 +676,8 @@ public Response getByResourceGroupWithResponse( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -731,13 +732,14 @@ private Mono>> createOrUpdateWithResponseAsync( iotHubDescription, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -800,7 +802,8 @@ private Mono>> createOrUpdateWithResponseAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -830,7 +833,8 @@ private PollerFlux, IotHubDescriptionInner> b /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -866,7 +870,8 @@ private PollerFlux, IotHubDescriptionInner> b /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -887,7 +892,8 @@ public SyncPoller, IotHubDescriptionInner> be /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -914,7 +920,8 @@ public SyncPoller, IotHubDescriptionInner> be /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -937,7 +944,8 @@ private Mono createOrUpdateAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -959,7 +967,8 @@ private Mono createOrUpdateAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -987,7 +996,8 @@ private Mono createOrUpdateAsync( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -1008,7 +1018,8 @@ public IotHubDescriptionInner createOrUpdate( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -1028,7 +1039,8 @@ public IotHubDescriptionInner createOrUpdate( /** * Create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve the IoT hub * metadata and security metadata, and then combine them with the modified values in a new body to update the IoT - * hub. + * hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to + * default, which may lead to unexpected behavior. * * @param resourceGroupName The name of the resource group that contains the IoT hub. * @param resourceName The name of the IoT hub. @@ -1103,7 +1115,7 @@ private Mono>> updateWithResponseAsync( iotHubTags, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1364,7 +1376,7 @@ private Mono>> deleteWithResponseAsync(String resource resourceName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1601,7 +1613,7 @@ private Mono> listSinglePageAsync() { res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1749,7 +1761,7 @@ private Mono> listByResourceGroupSinglePag res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1909,7 +1921,7 @@ private Mono> getStatsWithResponseAsync( resourceName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2067,7 +2079,7 @@ private Mono> getValidSkusSinglePageAsy res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2253,7 +2265,7 @@ private Mono> listEventHubConsumer res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2451,7 +2463,7 @@ private Mono> getEventHubConsumerGroupW name, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2632,7 +2644,7 @@ private Mono> createEventHubConsumerGro name, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2813,7 +2825,7 @@ private Mono> deleteEventHubConsumerGroupWithResponseAsync( name, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2985,7 +2997,7 @@ private Mono> listJobsSinglePageAsync( res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -3165,7 +3177,7 @@ private Mono> getJobWithResponseAsync( jobId, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -3335,7 +3347,7 @@ private Mono> getQuotaMetricsSinglePag res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -3515,7 +3527,7 @@ private Mono> getEndpointHealthSinglePage res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -3684,7 +3696,7 @@ private Mono> checkNameAvailabilityWit operationInputs, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -3838,7 +3850,7 @@ private Mono> testAllRoutesWithResponseAsync( input, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -4006,7 +4018,7 @@ private Mono> testRouteWithResponseAsync( input, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -4176,7 +4188,7 @@ private Mono> listKey res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -4360,7 +4372,7 @@ private Mono> getKeysForKe keyName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -4534,7 +4546,7 @@ private Mono> exportDevicesWithResponseAsync( exportDevicesParameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -4717,7 +4729,7 @@ private Mono> importDevicesWithResponseAsync( importDevicesParameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -4877,7 +4889,7 @@ private Mono> listBySubscriptionNextSingle res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -4950,7 +4962,7 @@ private Mono> listByResourceGroupNextSingl res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -5022,7 +5034,7 @@ private Mono> getValidSkusNextSinglePag res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -5096,7 +5108,7 @@ private Mono> listEventHubConsumer res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -5168,7 +5180,7 @@ private Mono> listJobsNextSinglePageAsync(String res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -5239,7 +5251,7 @@ private Mono> getQuotaMetricsNextSingl res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -5311,7 +5323,7 @@ private Mono> getEndpointHealthNextSingle res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -5384,7 +5396,7 @@ private Mono> listKey res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesImpl.java index 267842c48ba60..5e9ee7c3509b9 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubResourcesImpl.java @@ -9,7 +9,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.IotHubResourcesClient; import com.azure.resourcemanager.iothub.fluent.models.EndpointHealthDataInner; import com.azure.resourcemanager.iothub.fluent.models.EventHubConsumerGroupInfoInner; @@ -46,9 +45,10 @@ public final class IotHubResourcesImpl implements IotHubResources { private final IotHubResourcesClient innerClient; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - public IotHubResourcesImpl(IotHubResourcesClient innerClient, IotHubManager serviceManager) { + public IotHubResourcesImpl( + IotHubResourcesClient innerClient, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -550,7 +550,7 @@ private IotHubResourcesClient serviceClient() { return this.innerClient; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubSkuDescriptionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubSkuDescriptionImpl.java index 25d8472772841..7eaf686911f6e 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubSkuDescriptionImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubSkuDescriptionImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.IotHubSkuDescriptionInner; import com.azure.resourcemanager.iothub.models.IotHubCapacity; import com.azure.resourcemanager.iothub.models.IotHubSkuDescription; @@ -13,9 +12,10 @@ public final class IotHubSkuDescriptionImpl implements IotHubSkuDescription { private IotHubSkuDescriptionInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - IotHubSkuDescriptionImpl(IotHubSkuDescriptionInner innerObject, IotHubManager serviceManager) { + IotHubSkuDescriptionImpl( + IotHubSkuDescriptionInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -36,7 +36,7 @@ public IotHubSkuDescriptionInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java index 858554288623d..d42e8e128b89b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsClientImpl.java @@ -130,7 +130,7 @@ private Mono>> manualFailoverWithResponseAsync( failoverInput, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsImpl.java index a4d108035a19e..2ee870445f974 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/IotHubsImpl.java @@ -6,7 +6,6 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.IotHubsClient; import com.azure.resourcemanager.iothub.models.FailoverInput; import com.azure.resourcemanager.iothub.models.IotHubs; @@ -17,9 +16,9 @@ public final class IotHubsImpl implements IotHubs { private final IotHubsClient innerClient; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - public IotHubsImpl(IotHubsClient innerClient, IotHubManager serviceManager) { + public IotHubsImpl(IotHubsClient innerClient, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -37,7 +36,7 @@ private IotHubsClient serviceClient() { return this.innerClient; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/JobResponseImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/JobResponseImpl.java index 4b3aa398cbc52..654ba0244d281 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/JobResponseImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/JobResponseImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.JobResponseInner; import com.azure.resourcemanager.iothub.models.JobResponse; import com.azure.resourcemanager.iothub.models.JobStatus; @@ -14,9 +13,9 @@ public final class JobResponseImpl implements JobResponse { private JobResponseInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - JobResponseImpl(JobResponseInner innerObject, IotHubManager serviceManager) { + JobResponseImpl(JobResponseInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -57,7 +56,7 @@ public JobResponseInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationImpl.java index 7d755e0011bc0..6cac9e2c1f0a8 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.OperationInner; import com.azure.resourcemanager.iothub.models.Operation; import com.azure.resourcemanager.iothub.models.OperationDisplay; @@ -12,9 +11,9 @@ public final class OperationImpl implements Operation { private OperationInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - OperationImpl(OperationInner innerObject, IotHubManager serviceManager) { + OperationImpl(OperationInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -31,7 +30,7 @@ public OperationInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsClientImpl.java index 547a43f92307a..94e4d156d134e 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsClientImpl.java @@ -108,7 +108,7 @@ private Mono> listSinglePageAsync() { res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -228,7 +228,7 @@ private Mono> listNextSinglePageAsync(String nextL res.getValue().value(), res.getValue().nextLink(), null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsImpl.java index 44790e1967431..dcb6e102be616 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/OperationsImpl.java @@ -7,7 +7,6 @@ import com.azure.core.http.rest.PagedIterable; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.OperationsClient; import com.azure.resourcemanager.iothub.fluent.models.OperationInner; import com.azure.resourcemanager.iothub.models.Operation; @@ -19,9 +18,9 @@ public final class OperationsImpl implements Operations { private final OperationsClient innerClient; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - public OperationsImpl(OperationsClient innerClient, IotHubManager serviceManager) { + public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -40,7 +39,7 @@ private OperationsClient serviceClient() { return this.innerClient; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionImpl.java index 90ba410f07210..72ea847ab7a2a 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.iothub.models.PrivateEndpointConnection; import com.azure.resourcemanager.iothub.models.PrivateEndpointConnectionProperties; @@ -12,9 +11,10 @@ public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection { private PrivateEndpointConnectionInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, IotHubManager serviceManager) { + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -39,7 +39,7 @@ public PrivateEndpointConnectionInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsClientImpl.java index 1835cd3339f13..513136f571370 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsClientImpl.java @@ -175,7 +175,7 @@ private Mono>> listWithResponseAsy resourceName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -332,7 +332,7 @@ private Mono> getWithResponseAsync( privateEndpointConnectionName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -515,7 +515,7 @@ private Mono>> updateWithResponseAsync( privateEndpointConnection, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -849,7 +849,7 @@ private Mono>> deleteWithResponseAsync( privateEndpointConnectionName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsImpl.java index a5943d4f224d1..364d3408cb34a 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateEndpointConnectionsImpl.java @@ -8,7 +8,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.iothub.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.iothub.models.PrivateEndpointConnection; @@ -23,9 +22,10 @@ public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConn private final PrivateEndpointConnectionsClient innerClient; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, IotHubManager serviceManager) { + public PrivateEndpointConnectionsImpl( + PrivateEndpointConnectionsClient innerClient, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -151,7 +151,7 @@ private PrivateEndpointConnectionsClient serviceClient() { return this.innerClient; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesImpl.java index 94e53c7a80992..f7212884839b5 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner; import com.azure.resourcemanager.iothub.fluent.models.PrivateLinkResourcesInner; import com.azure.resourcemanager.iothub.models.GroupIdInformation; @@ -16,9 +15,10 @@ public final class PrivateLinkResourcesImpl implements PrivateLinkResources { private PrivateLinkResourcesInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - PrivateLinkResourcesImpl(PrivateLinkResourcesInner innerObject, IotHubManager serviceManager) { + PrivateLinkResourcesImpl( + PrivateLinkResourcesInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -41,7 +41,7 @@ public PrivateLinkResourcesInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsClientImpl.java index 5a5f18c8bca70..47f4f23acf59c 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsClientImpl.java @@ -136,7 +136,7 @@ private Mono> listWithResponseAsync( resourceName, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -290,7 +290,7 @@ private Mono> getWithResponseAsync( groupId, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsImpl.java index 2d3abdded3edd..aa81656c3702f 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/PrivateLinkResourcesOperationsImpl.java @@ -8,7 +8,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.PrivateLinkResourcesOperationsClient; import com.azure.resourcemanager.iothub.fluent.models.GroupIdInformationInner; import com.azure.resourcemanager.iothub.fluent.models.PrivateLinkResourcesInner; @@ -22,10 +21,11 @@ public final class PrivateLinkResourcesOperationsImpl implements PrivateLinkReso private final PrivateLinkResourcesOperationsClient innerClient; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; public PrivateLinkResourcesOperationsImpl( - PrivateLinkResourcesOperationsClient innerClient, IotHubManager serviceManager) { + PrivateLinkResourcesOperationsClient innerClient, + com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -82,7 +82,7 @@ private PrivateLinkResourcesOperationsClient serviceClient() { return this.innerClient; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/RegistryStatisticsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/RegistryStatisticsImpl.java index b9a87a1539ce8..e0c8ad2d14b3c 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/RegistryStatisticsImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/RegistryStatisticsImpl.java @@ -4,16 +4,16 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.RegistryStatisticsInner; import com.azure.resourcemanager.iothub.models.RegistryStatistics; public final class RegistryStatisticsImpl implements RegistryStatistics { private RegistryStatisticsInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - RegistryStatisticsImpl(RegistryStatisticsInner innerObject, IotHubManager serviceManager) { + RegistryStatisticsImpl( + RegistryStatisticsInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -34,7 +34,7 @@ public RegistryStatisticsInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsClientImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsClientImpl.java index ed6a7ca710131..c11fc0d42545d 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsClientImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsClientImpl.java @@ -99,7 +99,7 @@ private Mono> getSubscriptionQuot this.client.getApiVersion(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsImpl.java index e6cb3786eee5e..baa39c4baf87c 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/ResourceProviderCommonsImpl.java @@ -8,7 +8,6 @@ import com.azure.core.http.rest.SimpleResponse; import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.ResourceProviderCommonsClient; import com.azure.resourcemanager.iothub.fluent.models.UserSubscriptionQuotaListResultInner; import com.azure.resourcemanager.iothub.models.ResourceProviderCommons; @@ -20,9 +19,10 @@ public final class ResourceProviderCommonsImpl implements ResourceProviderCommon private final ResourceProviderCommonsClient innerClient; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - public ResourceProviderCommonsImpl(ResourceProviderCommonsClient innerClient, IotHubManager serviceManager) { + public ResourceProviderCommonsImpl( + ResourceProviderCommonsClient innerClient, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -54,7 +54,7 @@ private ResourceProviderCommonsClient serviceClient() { return this.innerClient; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/SharedAccessSignatureAuthorizationRuleImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/SharedAccessSignatureAuthorizationRuleImpl.java index 150d9d3570da7..fada962f9d65b 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/SharedAccessSignatureAuthorizationRuleImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/SharedAccessSignatureAuthorizationRuleImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.SharedAccessSignatureAuthorizationRuleInner; import com.azure.resourcemanager.iothub.models.AccessRights; import com.azure.resourcemanager.iothub.models.SharedAccessSignatureAuthorizationRule; @@ -12,10 +11,11 @@ public final class SharedAccessSignatureAuthorizationRuleImpl implements SharedAccessSignatureAuthorizationRule { private SharedAccessSignatureAuthorizationRuleInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; SharedAccessSignatureAuthorizationRuleImpl( - SharedAccessSignatureAuthorizationRuleInner innerObject, IotHubManager serviceManager) { + SharedAccessSignatureAuthorizationRuleInner innerObject, + com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -40,7 +40,7 @@ public SharedAccessSignatureAuthorizationRuleInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestAllRoutesResultImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestAllRoutesResultImpl.java index 4af9568b52ede..c0ef483667ead 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestAllRoutesResultImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestAllRoutesResultImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.TestAllRoutesResultInner; import com.azure.resourcemanager.iothub.models.MatchedRoute; import com.azure.resourcemanager.iothub.models.TestAllRoutesResult; @@ -14,9 +13,10 @@ public final class TestAllRoutesResultImpl implements TestAllRoutesResult { private TestAllRoutesResultInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - TestAllRoutesResultImpl(TestAllRoutesResultInner innerObject, IotHubManager serviceManager) { + TestAllRoutesResultImpl( + TestAllRoutesResultInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -34,7 +34,7 @@ public TestAllRoutesResultInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestRouteResultImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestRouteResultImpl.java index 1c2440653f39b..842ae33f991e7 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestRouteResultImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/TestRouteResultImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.TestRouteResultInner; import com.azure.resourcemanager.iothub.models.TestResultStatus; import com.azure.resourcemanager.iothub.models.TestRouteResult; @@ -13,9 +12,10 @@ public final class TestRouteResultImpl implements TestRouteResult { private TestRouteResultInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; - TestRouteResultImpl(TestRouteResultInner innerObject, IotHubManager serviceManager) { + TestRouteResultImpl( + TestRouteResultInner innerObject, com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -32,7 +32,7 @@ public TestRouteResultInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/UserSubscriptionQuotaListResultImpl.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/UserSubscriptionQuotaListResultImpl.java index 2d567ed3f87e8..84e80070519c5 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/UserSubscriptionQuotaListResultImpl.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/UserSubscriptionQuotaListResultImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.iothub.implementation; -import com.azure.resourcemanager.iothub.IotHubManager; import com.azure.resourcemanager.iothub.fluent.models.UserSubscriptionQuotaListResultInner; import com.azure.resourcemanager.iothub.models.UserSubscriptionQuota; import com.azure.resourcemanager.iothub.models.UserSubscriptionQuotaListResult; @@ -14,10 +13,11 @@ public final class UserSubscriptionQuotaListResultImpl implements UserSubscriptionQuotaListResult { private UserSubscriptionQuotaListResultInner innerObject; - private final IotHubManager serviceManager; + private final com.azure.resourcemanager.iothub.IotHubManager serviceManager; UserSubscriptionQuotaListResultImpl( - UserSubscriptionQuotaListResultInner innerObject, IotHubManager serviceManager) { + UserSubscriptionQuotaListResultInner innerObject, + com.azure.resourcemanager.iothub.IotHubManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -39,7 +39,7 @@ public UserSubscriptionQuotaListResultInner innerModel() { return this.innerObject; } - private IotHubManager manager() { + private com.azure.resourcemanager.iothub.IotHubManager manager() { return this.serviceManager; } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/Utils.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/Utils.java index b95b868cf0fba..cea847d94b273 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/Utils.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/implementation/Utils.java @@ -9,8 +9,6 @@ import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.CoreUtils; -import reactor.core.publisher.Mono; - import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -19,6 +17,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; +import reactor.core.publisher.Flux; final class Utils { static String getValueFromIdByName(String id, String name) { @@ -80,76 +79,84 @@ static PagedIterable mapPage(PagedIterable pageIterable, Function extends PagedIterable { - private final PagedIterable pageIterable; + private final PagedIterable pagedIterable; private final Function mapper; private final Function, PagedResponse> pageMapper; - private PagedIterableImpl(PagedIterable pageIterable, Function mapper) { - super(new PagedFlux(() -> Mono.empty())); - this.pageIterable = pageIterable; + private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { + super( + PagedFlux + .create( + () -> + (continuationToken, pageSize) -> + Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); + this.pagedIterable = pagedIterable; this.mapper = mapper; - this.pageMapper = - page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); + this.pageMapper = getPageMapper(mapper); + } + + private static Function, PagedResponse> getPageMapper(Function mapper) { + return page -> + new PagedResponseBase( + page.getRequest(), + page.getStatusCode(), + page.getHeaders(), + page.getElements().stream().map(mapper).collect(Collectors.toList()), + page.getContinuationToken(), + null); } @Override public Stream stream() { - return pageIterable.stream().map(mapper); + return pagedIterable.stream().map(mapper); } @Override public Stream> streamByPage() { - return pageIterable.streamByPage().map(pageMapper); + return pagedIterable.streamByPage().map(pageMapper); } @Override public Stream> streamByPage(String continuationToken) { - return pageIterable.streamByPage(continuationToken).map(pageMapper); + return pagedIterable.streamByPage(continuationToken).map(pageMapper); } @Override public Stream> streamByPage(int preferredPageSize) { - return pageIterable.streamByPage(preferredPageSize).map(pageMapper); + return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); } @Override public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pageIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); + return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); } @Override public Iterator iterator() { - return new IteratorImpl(pageIterable.iterator(), mapper); + return new IteratorImpl(pagedIterable.iterator(), mapper); } @Override public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pageIterable.iterableByPage(), pageMapper); + return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(continuationToken), pageMapper); + pagedIterable.iterableByPage(continuationToken), pageMapper); } @Override public Iterable> iterableByPage(int preferredPageSize) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(preferredPageSize), pageMapper); + pagedIterable.iterableByPage(preferredPageSize), pageMapper); } @Override public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { return new IterableImpl, PagedResponse>( - pageIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); + pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); } } diff --git a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateDescription.java b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateDescription.java index 1229ac59f6757..f3d8ed2aa2c42 100644 --- a/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateDescription.java +++ b/sdk/iothub/azure-resourcemanager-iothub/src/main/java/com/azure/resourcemanager/iothub/models/CertificateDescription.java @@ -124,7 +124,7 @@ interface WithIfMatch { CertificateDescription.Update update(); /** The template for CertificateDescription update. */ - interface Update extends UpdateStages.WithCertificate, UpdateStages.WithIfMatch { + interface Update extends UpdateStages.WithCertificate, UpdateStages.WithifMatch { /** * Executes the update request. * @@ -155,7 +155,7 @@ interface WithCertificate { Update withCertificate(String certificate); } /** The stage of the CertificateDescription update allowing to specify ifMatch. */ - interface WithIfMatch { + interface WithifMatch { /** * Specifies the ifMatch property: ETag of the Certificate. Do not specify for creating a brand new * certificate. Required to update an existing certificate.. @@ -164,7 +164,7 @@ interface WithIfMatch { * update an existing certificate. * @return the next definition stage. */ - Update withIfMatch(String ifMatch); + Update ifMatch(String ifMatch); } } /**