From 602e70e05ffe03e83e603a0a5c5ab0552d239cf1 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 24 Mar 2021 23:27:05 +0000 Subject: [PATCH] CodeGen from PR 12795 in Azure/azure-rest-api-specs Merge 891cb79ac8b99c26a1bca23ed9adc718934ef647 into 961799e77f5e9b81208384a1c6ce3a6bc9e84a93 --- .../CHANGELOG.md | 3 +- .../README.md | 2 +- .../pom.xml | 2 +- .../RedisEnterpriseManager.java | 2 +- .../implementation/AccessKeysImpl.java | 8 +-- .../implementation/ClusterImpl.java | 10 ++-- .../implementation/DatabaseImpl.java | 10 ++-- .../implementation/DatabasesClientImpl.java | 20 +++---- .../implementation/DatabasesImpl.java | 8 +-- .../implementation/OperationImpl.java | 8 +-- .../implementation/OperationStatusImpl.java | 9 +-- .../implementation/OperationsClientImpl.java | 4 +- .../implementation/OperationsImpl.java | 8 +-- .../OperationsStatusClientImpl.java | 2 +- .../implementation/OperationsStatusImpl.java | 9 +-- .../PrivateEndpointConnectionImpl.java | 12 ++-- .../PrivateEndpointConnectionsClientImpl.java | 8 +-- .../PrivateEndpointConnectionsImpl.java | 8 +-- .../PrivateLinkResourceImpl.java | 9 +-- .../PrivateLinkResourcesClientImpl.java | 2 +- .../PrivateLinkResourcesImpl.java | 9 +-- .../RedisEnterprisesClientImpl.java | 16 +++--- .../implementation/RedisEnterprisesImpl.java | 9 +-- .../redisenterprise/implementation/Utils.java | 56 +++++++++++-------- 24 files changed, 125 insertions(+), 109 deletions(-) diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md index 5803e48baaa86..184686d5b4a75 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/CHANGELOG.md @@ -1,7 +1,8 @@ # Release History -## 1.0.0-beta.3 (Unreleased) +## 1.0.0-beta.1 (2021-03-24) +- Azure Resource Manager RedisEnterprise client library for Java. This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## 1.0.0-beta.2 (2021-03-02) diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md index ae327d5ed31cf..29b371b81dd20 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-redisenterprise - 1.0.0-beta.2 + 1.0.0-beta.3 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml index 06b38f0ad607e..2bb572ef0bd7e 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/pom.xml @@ -13,7 +13,7 @@ jar Microsoft Azure SDK for RedisEnterprise Management - This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-03. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt + This package contains Microsoft Azure SDK for RedisEnterprise Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. REST API for managing Redis Enterprise resources in Azure. Package tag package-2021-03. https://github.com/Azure/azure-sdk-for-java diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java index 606d8367c5173..a18bf03d12ed3 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/RedisEnterpriseManager.java @@ -178,7 +178,7 @@ public RedisEnterpriseManager authenticate(TokenCredential credential, AzureProf .append("-") .append("com.azure.resourcemanager.redisenterprise") .append("/") - .append("1.0.0-beta.2"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder .append(" (") diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessKeysImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessKeysImpl.java index 86a7ab68c6f52..35d13f564ed3e 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessKeysImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/AccessKeysImpl.java @@ -4,16 +4,16 @@ package com.azure.resourcemanager.redisenterprise.implementation; -import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.models.AccessKeysInner; import com.azure.resourcemanager.redisenterprise.models.AccessKeys; public final class AccessKeysImpl implements AccessKeys { private AccessKeysInner innerObject; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; - AccessKeysImpl(AccessKeysInner innerObject, RedisEnterpriseManager serviceManager) { + AccessKeysImpl( + AccessKeysInner innerObject, com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -30,7 +30,7 @@ public AccessKeysInner innerModel() { return this.innerObject; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ClusterImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ClusterImpl.java index 6f9b2f3a48e93..f862768b8cd46 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ClusterImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/ClusterImpl.java @@ -6,7 +6,6 @@ import com.azure.core.management.Region; import com.azure.core.util.Context; -import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.models.ClusterInner; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.redisenterprise.models.Cluster; @@ -24,7 +23,7 @@ public final class ClusterImpl implements Cluster, Cluster.Definition, Cluster.Update { private ClusterInner innerObject; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; public String id() { return this.innerModel().id(); @@ -110,7 +109,7 @@ public ClusterInner innerModel() { return this.innerObject; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } @@ -143,7 +142,7 @@ public Cluster create(Context context) { return this; } - ClusterImpl(String name, RedisEnterpriseManager serviceManager) { + ClusterImpl(String name, com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerObject = new ClusterInner(); this.serviceManager = serviceManager; this.clusterName = name; @@ -172,7 +171,8 @@ public Cluster apply(Context context) { return this; } - ClusterImpl(ClusterInner innerObject, RedisEnterpriseManager serviceManager) { + ClusterImpl( + ClusterInner innerObject, com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java index 7c03c0b183434..33f11b78af91a 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabaseImpl.java @@ -6,7 +6,6 @@ import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseInner; import com.azure.resourcemanager.redisenterprise.models.AccessKeys; import com.azure.resourcemanager.redisenterprise.models.ClusteringPolicy; @@ -27,7 +26,7 @@ public final class DatabaseImpl implements Database, Database.Definition, Database.Update { private DatabaseInner innerObject; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; public String id() { return this.innerModel().id(); @@ -82,7 +81,7 @@ public DatabaseInner innerModel() { return this.innerObject; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } @@ -118,7 +117,7 @@ public Database create(Context context) { return this; } - DatabaseImpl(String name, RedisEnterpriseManager serviceManager) { + DatabaseImpl(String name, com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerObject = new DatabaseInner(); this.serviceManager = serviceManager; this.databaseName = name; @@ -147,7 +146,8 @@ public Database apply(Context context) { return this; } - DatabaseImpl(DatabaseInner innerObject, RedisEnterpriseManager serviceManager) { + DatabaseImpl( + DatabaseInner innerObject, com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java index 3604fa08a0a66..54ab0fc95e91c 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesClientImpl.java @@ -287,7 +287,7 @@ private Mono> listByClusterSinglePageAsync( 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())); } /** @@ -468,7 +468,7 @@ private Mono>> createWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -749,7 +749,7 @@ private Mono>> updateWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1023,7 +1023,7 @@ private Mono> getWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1185,7 +1185,7 @@ private Mono>> deleteWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1435,7 +1435,7 @@ private Mono> listKeysWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1604,7 +1604,7 @@ private Mono>> regenerateKeyWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1906,7 +1906,7 @@ private Mono>> importMethodWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2204,7 +2204,7 @@ private Mono>> exportWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -2476,7 +2476,7 @@ private Mono> listByClusterNextSinglePageAsync(Stri 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/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesImpl.java index a449620ac0f95..ba5e7d21e6bcb 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/DatabasesImpl.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.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.DatabasesClient; import com.azure.resourcemanager.redisenterprise.fluent.models.AccessKeysInner; import com.azure.resourcemanager.redisenterprise.fluent.models.DatabaseInner; @@ -26,9 +25,10 @@ public final class DatabasesImpl implements Databases { private final DatabasesClient innerClient; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; - public DatabasesImpl(DatabasesClient innerClient, RedisEnterpriseManager serviceManager) { + public DatabasesImpl( + DatabasesClient innerClient, com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -266,7 +266,7 @@ private DatabasesClient serviceClient() { return this.innerClient; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationImpl.java index 9f8f93bf6caa0..0d21741190863 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.redisenterprise.implementation; -import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.models.OperationInner; import com.azure.resourcemanager.redisenterprise.models.ActionType; import com.azure.resourcemanager.redisenterprise.models.Operation; @@ -14,9 +13,10 @@ public final class OperationImpl implements Operation { private OperationInner innerObject; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; - OperationImpl(OperationInner innerObject, RedisEnterpriseManager serviceManager) { + OperationImpl( + OperationInner innerObject, com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -45,7 +45,7 @@ public OperationInner innerModel() { return this.innerObject; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationStatusImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationStatusImpl.java index 0ad5102158e94..e1054230d9aee 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationStatusImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationStatusImpl.java @@ -5,16 +5,17 @@ package com.azure.resourcemanager.redisenterprise.implementation; import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.models.OperationStatusInner; import com.azure.resourcemanager.redisenterprise.models.OperationStatus; public final class OperationStatusImpl implements OperationStatus { private OperationStatusInner innerObject; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; - OperationStatusImpl(OperationStatusInner innerObject, RedisEnterpriseManager serviceManager) { + OperationStatusImpl( + OperationStatusInner innerObject, + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -47,7 +48,7 @@ public OperationStatusInner innerModel() { return this.innerObject; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsClientImpl.java index 30127b8241f6b..ff7fe368b167d 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/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/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsImpl.java index 38c0e31b2c9c2..7294254d61851 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/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.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.OperationsClient; import com.azure.resourcemanager.redisenterprise.fluent.models.OperationInner; import com.azure.resourcemanager.redisenterprise.models.Operation; @@ -19,9 +18,10 @@ public final class OperationsImpl implements Operations { private final OperationsClient innerClient; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; - public OperationsImpl(OperationsClient innerClient, RedisEnterpriseManager serviceManager) { + public OperationsImpl( + OperationsClient innerClient, com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -40,7 +40,7 @@ private OperationsClient serviceClient() { return this.innerClient; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusClientImpl.java index bc5bcfe5424bf..bdbf3695552bf 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusClientImpl.java @@ -113,7 +113,7 @@ private Mono> getWithResponseAsync(String locatio this.client.getSubscriptionId(), 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/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusImpl.java index ec091b780370c..c2f5bea88b123 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/OperationsStatusImpl.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.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.OperationsStatusClient; import com.azure.resourcemanager.redisenterprise.fluent.models.OperationStatusInner; import com.azure.resourcemanager.redisenterprise.models.OperationStatus; @@ -20,9 +19,11 @@ public final class OperationsStatusImpl implements OperationsStatus { private final OperationsStatusClient innerClient; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; - public OperationsStatusImpl(OperationsStatusClient innerClient, RedisEnterpriseManager serviceManager) { + public OperationsStatusImpl( + OperationsStatusClient innerClient, + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -53,7 +54,7 @@ private OperationsStatusClient serviceClient() { return this.innerClient; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionImpl.java index d8e2e522cc295..6eeba93d56c29 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionImpl.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.redisenterprise.implementation; import com.azure.core.util.Context; -import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpoint; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnection; @@ -16,7 +15,7 @@ public final class PrivateEndpointConnectionImpl implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update { private PrivateEndpointConnectionInner innerObject; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; public String id() { return this.innerModel().id(); @@ -46,7 +45,7 @@ public PrivateEndpointConnectionInner innerModel() { return this.innerObject; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } @@ -80,7 +79,8 @@ public PrivateEndpointConnection create(Context context) { return this; } - PrivateEndpointConnectionImpl(String name, RedisEnterpriseManager serviceManager) { + PrivateEndpointConnectionImpl( + String name, com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerObject = new PrivateEndpointConnectionInner(); this.serviceManager = serviceManager; this.privateEndpointConnectionName = name; @@ -108,7 +108,9 @@ public PrivateEndpointConnection apply(Context context) { return this; } - PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, RedisEnterpriseManager serviceManager) { + PrivateEndpointConnectionImpl( + PrivateEndpointConnectionInner innerObject, + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java index e307c37438cf2..fc91282f51e76 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsClientImpl.java @@ -183,7 +183,7 @@ private Mono> listSinglePageAsync( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -354,7 +354,7 @@ private Mono> getWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -539,7 +539,7 @@ private Mono>> putWithResponseAsync( properties, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -870,7 +870,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/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.java index 8ec5f10e045c7..8a95be421c719 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateEndpointConnectionsImpl.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.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateEndpointConnectionInner; import com.azure.resourcemanager.redisenterprise.models.PrivateEndpointConnection; @@ -21,10 +20,11 @@ public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConn private final PrivateEndpointConnectionsClient innerClient; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; public PrivateEndpointConnectionsImpl( - PrivateEndpointConnectionsClient innerClient, RedisEnterpriseManager serviceManager) { + PrivateEndpointConnectionsClient innerClient, + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -206,7 +206,7 @@ private PrivateEndpointConnectionsClient serviceClient() { return this.innerClient; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourceImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourceImpl.java index 9bb64bcb52941..20f4e9d62591f 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourceImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourceImpl.java @@ -4,7 +4,6 @@ package com.azure.resourcemanager.redisenterprise.implementation; -import com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.redisenterprise.models.PrivateLinkResource; import java.util.Collections; @@ -13,9 +12,11 @@ public final class PrivateLinkResourceImpl implements PrivateLinkResource { private PrivateLinkResourceInner innerObject; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; - PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, RedisEnterpriseManager serviceManager) { + PrivateLinkResourceImpl( + PrivateLinkResourceInner innerObject, + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -58,7 +59,7 @@ public PrivateLinkResourceInner innerModel() { return this.innerObject; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesClientImpl.java index 23b72fd1bc91f..1cd3d2783832f 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesClientImpl.java @@ -125,7 +125,7 @@ private Mono> listByClusterSinglePageAsy res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.java index 72d6e66a02fc2..0b970581ca4a9 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/PrivateLinkResourcesImpl.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.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.redisenterprise.fluent.models.PrivateLinkResourceInner; import com.azure.resourcemanager.redisenterprise.models.PrivateLinkResource; @@ -19,9 +18,11 @@ public final class PrivateLinkResourcesImpl implements PrivateLinkResources { private final PrivateLinkResourcesClient innerClient; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; - public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, RedisEnterpriseManager serviceManager) { + public PrivateLinkResourcesImpl( + PrivateLinkResourcesClient innerClient, + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -43,7 +44,7 @@ private PrivateLinkResourcesClient serviceClient() { return this.innerClient; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java index 1c0ee5ce2b23e..d7f70e4b5c4bb 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesClientImpl.java @@ -229,7 +229,7 @@ private Mono>> createWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -488,7 +488,7 @@ private Mono>> updateWithResponseAsync( parameters, accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -740,7 +740,7 @@ private Mono>> deleteWithResponseAsync(String resource this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -967,7 +967,7 @@ private Mono> getByResourceGroupWithResponseAsync( this.client.getSubscriptionId(), accept, context)) - .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()))); + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1119,7 +1119,7 @@ private Mono> listByResourceGroupSinglePageAsync(Str 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())); } /** @@ -1275,7 +1275,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())); } /** @@ -1407,7 +1407,7 @@ private Mono> listByResourceGroupNextSinglePageAsync 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())); } /** @@ -1478,7 +1478,7 @@ private Mono> listNextSinglePageAsync(String nextLin 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/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesImpl.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesImpl.java index 88f565d073c39..55823f7b895ff 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesImpl.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/RedisEnterprisesImpl.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.redisenterprise.RedisEnterpriseManager; import com.azure.resourcemanager.redisenterprise.fluent.RedisEnterprisesClient; import com.azure.resourcemanager.redisenterprise.fluent.models.ClusterInner; import com.azure.resourcemanager.redisenterprise.models.Cluster; @@ -21,9 +20,11 @@ public final class RedisEnterprisesImpl implements RedisEnterprises { private final RedisEnterprisesClient innerClient; - private final RedisEnterpriseManager serviceManager; + private final com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager; - public RedisEnterprisesImpl(RedisEnterprisesClient innerClient, RedisEnterpriseManager serviceManager) { + public RedisEnterprisesImpl( + RedisEnterprisesClient innerClient, + com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager serviceManager) { this.innerClient = innerClient; this.serviceManager = serviceManager; } @@ -164,7 +165,7 @@ private RedisEnterprisesClient serviceClient() { return this.innerClient; } - private RedisEnterpriseManager manager() { + private com.azure.resourcemanager.redisenterprise.RedisEnterpriseManager manager() { return this.serviceManager; } diff --git a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/Utils.java b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/Utils.java index a745c7c647903..6d2c2ff2db617 100644 --- a/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/Utils.java +++ b/sdk/redisenterprise/azure-resourcemanager-redisenterprise/src/main/java/com/azure/resourcemanager/redisenterprise/implementation/Utils.java @@ -17,7 +17,7 @@ import java.util.function.Function; import java.util.stream.Collectors; import java.util.stream.Stream; -import reactor.core.publisher.Mono; +import reactor.core.publisher.Flux; final class Utils { static String getValueFromIdByName(String id, String name) { @@ -79,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); } }