diff --git a/sdk/mysql/azure-resourcemanager-mysql/CHANGELOG.md b/sdk/mysql/azure-resourcemanager-mysql/CHANGELOG.md
index dd07f456f3b3..d1ccd6faaafe 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/CHANGELOG.md
+++ b/sdk/mysql/azure-resourcemanager-mysql/CHANGELOG.md
@@ -1,7 +1,8 @@
# Release History
-## 1.0.0-beta.2 (Unreleased)
+## 1.0.0-beta.1 (2021-03-29)
+- Azure Resource Manager MySql client library for Java. This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-2020-01-01. 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.1 (2020-12-16)
diff --git a/sdk/mysql/azure-resourcemanager-mysql/README.md b/sdk/mysql/azure-resourcemanager-mysql/README.md
index e29907e7656d..04e1a823412d 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/README.md
+++ b/sdk/mysql/azure-resourcemanager-mysql/README.md
@@ -4,6 +4,20 @@ Azure Resource Manager MySql client library for Java.
This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-2020-01-01. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
+## We'd love to hear your feedback
+
+We're always working on improving our products and the way we communicate with our users. So we'd love to learn what's working and how we can do better.
+
+If you haven't already, please take a few minutes to [complete this short survey][survey] we have put together.
+
+Thank you in advance for your collaboration. We really appreciate your time!
+
+## Documentation
+
+Various documentation is available to help you get started
+
+- [API reference documentation][docs]
+
## Getting started
### Prerequisites
@@ -18,7 +32,7 @@ This package contains Microsoft Azure SDK for MySql Management SDK. The Microsof
com.azure.resourcemanager
azure-resourcemanager-mysql
- 1.0.0-beta.1
+ 1.0.0-beta.2
```
[//]: # ({x-version-update-end})
@@ -75,6 +89,8 @@ For details on contributing to this repository, see the [contributing guide](htt
1. Create new Pull Request
+[survey]: https://microsoft.qualtrics.com/jfe/form/SV_ehN0lIk2FKEBkwd?Q_CHL=DOCS
+[docs]: https://azure.github.io/azure-sdk-for-java/
[jdk]: https://docs.microsoft.com/java/azure/jdk/
[azure_subscription]: https://azure.microsoft.com/free/
[azure_identity]: https://github.com/Azure/azure-sdk-for-java/blob/master/sdk/identity/azure-identity
diff --git a/sdk/mysql/azure-resourcemanager-mysql/pom.xml b/sdk/mysql/azure-resourcemanager-mysql/pom.xml
index b92b65e0c611..597eca1b2f24 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/pom.xml
+++ b/sdk/mysql/azure-resourcemanager-mysql/pom.xml
@@ -13,7 +13,7 @@
jar
Microsoft Azure SDK for MySql Management
- This package contains Microsoft Azure SDK for MySql Management SDK. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-2020-01-01. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
+ This package contains Microsoft Azure SDK for MySql Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Microsoft Azure management API provides create, read, update, and delete functionality for Azure MySQL resources including servers, databases, firewall rules, VNET rules, log files and configurations with new business model. Package tag package-2020-01-01.
https://github.com/Azure/azure-sdk-for-java
@@ -41,6 +41,11 @@
+
+ com.azure
+ azure-core
+ 1.14.1
+
com.azure
azure-core-management
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/MySqlManager.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/MySqlManager.java
index db534585121a..93f6dc2b0984 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/MySqlManager.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/MySqlManager.java
@@ -256,17 +256,31 @@ public MySqlManager authenticate(TokenCredential credential, AzureProfile profil
Objects.requireNonNull(credential, "'credential' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
+ StringBuilder userAgentBuilder = new StringBuilder();
+ userAgentBuilder
+ .append("azsdk-java")
+ .append("-")
+ .append("com.azure.resourcemanager.mysql")
+ .append("/")
+ .append("1.0.0-beta.1");
+ if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
+ userAgentBuilder
+ .append(" (")
+ .append(Configuration.getGlobalConfiguration().get("java.version"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.name"))
+ .append("; ")
+ .append(Configuration.getGlobalConfiguration().get("os.version"))
+ .append("; auto-generated)");
+ } else {
+ userAgentBuilder.append(" (auto-generated)");
+ }
+
if (retryPolicy == null) {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
}
List policies = new ArrayList<>();
- policies
- .add(
- new UserAgentPolicy(
- null,
- "com.azure.resourcemanager.mysql",
- "1.0.0-beta.1",
- Configuration.getGlobalConfiguration()));
+ policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new RequestIdPolicy());
HttpPolicyProviders.addBeforeRetryPolicies(policies);
policies.add(retryPolicy);
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/fluent/ServerSecurityAlertPoliciesClient.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/fluent/ServerSecurityAlertPoliciesClient.java
index 243818bf8ba4..9651ca5802e4 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/fluent/ServerSecurityAlertPoliciesClient.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/fluent/ServerSecurityAlertPoliciesClient.java
@@ -6,6 +6,7 @@
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
@@ -125,4 +126,32 @@ ServerSecurityAlertPolicyInner createOrUpdate(
SecurityAlertPolicyName securityAlertPolicyName,
ServerSecurityAlertPolicyInner parameters,
Context context);
+
+ /**
+ * Get the server's threat detection policies.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the server's threat detection policies.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByServer(String resourceGroupName, String serverName);
+
+ /**
+ * Get the server's threat detection policies.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the server's threat detection policies.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ PagedIterable listByServer(
+ String resourceGroupName, String serverName, Context context);
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/AdvisorImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/AdvisorImpl.java
index 857775ec316a..bc6d68a41f38 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/AdvisorImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/AdvisorImpl.java
@@ -4,16 +4,15 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.AdvisorInner;
import com.azure.resourcemanager.mysql.models.Advisor;
public final class AdvisorImpl implements Advisor {
private AdvisorInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- AdvisorImpl(AdvisorInner innerObject, MySqlManager serviceManager) {
+ AdvisorImpl(AdvisorInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -38,7 +37,7 @@ public AdvisorInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/AdvisorsClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/AdvisorsClientImpl.java
index a7fe778ba9ef..9b9634b8ce07 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/AdvisorsClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/AdvisorsClientImpl.java
@@ -151,7 +151,7 @@ private Mono> getWithResponseAsync(
advisorName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -318,7 +318,7 @@ private Mono> listByServerSinglePageAsync(String res
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()));
}
/**
@@ -475,7 +475,7 @@ private Mono> listByServerNextSinglePageAsync(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()));
}
/**
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/AdvisorsImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/AdvisorsImpl.java
index e482b0664a0f..503bfe0f806e 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/AdvisorsImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/AdvisorsImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.AdvisorsClient;
import com.azure.resourcemanager.mysql.fluent.models.AdvisorInner;
import com.azure.resourcemanager.mysql.models.Advisor;
@@ -21,9 +20,9 @@ public final class AdvisorsImpl implements Advisors {
private final AdvisorsClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public AdvisorsImpl(AdvisorsClient innerClient, MySqlManager serviceManager) {
+ public AdvisorsImpl(AdvisorsClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -54,19 +53,19 @@ public Response getWithResponse(
public PagedIterable listByServer(String resourceGroupName, String serverName) {
PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName);
- return inner.mapPage(inner1 -> new AdvisorImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new AdvisorImpl(inner1, this.manager()));
}
public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) {
PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName, context);
- return inner.mapPage(inner1 -> new AdvisorImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new AdvisorImpl(inner1, this.manager()));
}
private AdvisorsClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/CheckNameAvailabilitiesClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/CheckNameAvailabilitiesClientImpl.java
index 28489af79a5a..fdc35a8e727e 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/CheckNameAvailabilitiesClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/CheckNameAvailabilitiesClientImpl.java
@@ -114,7 +114,7 @@ private Mono> executeWithResponseAsync(
nameAvailabilityRequest,
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/CheckNameAvailabilitiesImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/CheckNameAvailabilitiesImpl.java
index 1592ed2cd5a3..40f2a17eca75 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/CheckNameAvailabilitiesImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/CheckNameAvailabilitiesImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.CheckNameAvailabilitiesClient;
import com.azure.resourcemanager.mysql.fluent.models.NameAvailabilityInner;
import com.azure.resourcemanager.mysql.models.CheckNameAvailabilities;
@@ -21,9 +20,10 @@ public final class CheckNameAvailabilitiesImpl implements CheckNameAvailabilitie
private final CheckNameAvailabilitiesClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public CheckNameAvailabilitiesImpl(CheckNameAvailabilitiesClient innerClient, MySqlManager serviceManager) {
+ public CheckNameAvailabilitiesImpl(
+ CheckNameAvailabilitiesClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -56,7 +56,7 @@ private CheckNameAvailabilitiesClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationImpl.java
index a4f779f824f6..c68da8a58e50 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationImpl.java
@@ -5,14 +5,13 @@
package com.azure.resourcemanager.mysql.implementation;
import com.azure.core.util.Context;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.ConfigurationInner;
import com.azure.resourcemanager.mysql.models.Configuration;
public final class ConfigurationImpl implements Configuration, Configuration.Definition, Configuration.Update {
private ConfigurationInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
public String id() {
return this.innerModel().id();
@@ -54,7 +53,7 @@ public ConfigurationInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
@@ -88,7 +87,7 @@ public Configuration create(Context context) {
return this;
}
- ConfigurationImpl(String name, MySqlManager serviceManager) {
+ ConfigurationImpl(String name, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = new ConfigurationInner();
this.serviceManager = serviceManager;
this.configurationName = name;
@@ -116,7 +115,7 @@ public Configuration apply(Context context) {
return this;
}
- ConfigurationImpl(ConfigurationInner innerObject, MySqlManager serviceManager) {
+ ConfigurationImpl(ConfigurationInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationListResultImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationListResultImpl.java
index 60febe925187..d5192feb67cf 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationListResultImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationListResultImpl.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.ConfigurationInner;
import com.azure.resourcemanager.mysql.fluent.models.ConfigurationListResultInner;
import com.azure.resourcemanager.mysql.models.Configuration;
@@ -16,9 +15,10 @@
public final class ConfigurationListResultImpl implements ConfigurationListResult {
private ConfigurationListResultInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- ConfigurationListResultImpl(ConfigurationListResultInner innerObject, MySqlManager serviceManager) {
+ ConfigurationListResultImpl(
+ ConfigurationListResultInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -41,7 +41,7 @@ public ConfigurationListResultInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationsClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationsClientImpl.java
index 7a20b5e59a02..439dc2b33527 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationsClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationsClientImpl.java
@@ -174,7 +174,7 @@ private Mono>> createOrUpdateWithResponseAsync(
parameters,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -473,7 +473,7 @@ private Mono> getWithResponseAsync(
configurationName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -637,7 +637,7 @@ private Mono> listByServerSinglePageAsync(
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationsImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationsImpl.java
index fe0001cf4ff2..44889ea5d16c 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationsImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ConfigurationsImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.ConfigurationsClient;
import com.azure.resourcemanager.mysql.fluent.models.ConfigurationInner;
import com.azure.resourcemanager.mysql.models.Configuration;
@@ -21,9 +20,10 @@ public final class ConfigurationsImpl implements Configurations {
private final ConfigurationsClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public ConfigurationsImpl(ConfigurationsClient innerClient, MySqlManager serviceManager) {
+ public ConfigurationsImpl(
+ ConfigurationsClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -54,13 +54,13 @@ public Response getWithResponse(
public PagedIterable listByServer(String resourceGroupName, String serverName) {
PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName);
- return inner.mapPage(inner1 -> new ConfigurationImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager()));
}
public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName, context);
- return inner.mapPage(inner1 -> new ConfigurationImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new ConfigurationImpl(inner1, this.manager()));
}
public Configuration getById(String id) {
@@ -121,7 +121,7 @@ private ConfigurationsClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/DatabaseImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/DatabaseImpl.java
index 1ada6056b1db..fab0f146e4d6 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/DatabaseImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/DatabaseImpl.java
@@ -5,14 +5,13 @@
package com.azure.resourcemanager.mysql.implementation;
import com.azure.core.util.Context;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.DatabaseInner;
import com.azure.resourcemanager.mysql.models.Database;
public final class DatabaseImpl implements Database, Database.Definition, Database.Update {
private DatabaseInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
public String id() {
return this.innerModel().id();
@@ -38,7 +37,7 @@ public DatabaseInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
@@ -72,7 +71,7 @@ public Database create(Context context) {
return this;
}
- DatabaseImpl(String name, MySqlManager serviceManager) {
+ DatabaseImpl(String name, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = new DatabaseInner();
this.serviceManager = serviceManager;
this.databaseName = name;
@@ -100,7 +99,7 @@ public Database apply(Context context) {
return this;
}
- DatabaseImpl(DatabaseInner innerObject, MySqlManager serviceManager) {
+ DatabaseImpl(DatabaseInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/DatabasesClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/DatabasesClientImpl.java
index 6df45fd5166e..fd26bb83c06c 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/DatabasesClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/DatabasesClientImpl.java
@@ -84,7 +84,7 @@ Mono>> createOrUpdate(
@HeaderParam("Accept") String accept,
Context context);
- @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Headers({"Content-Type: application/json"})
@Delete(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers"
+ "/{serverName}/databases/{databaseName}")
@@ -97,6 +97,7 @@ Mono>> delete(
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("serverName") String serverName,
@PathParam("databaseName") String databaseName,
+ @HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@@ -189,7 +190,7 @@ private Mono>> createOrUpdateWithResponseAsync(
parameters,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -452,6 +453,7 @@ private Mono>> deleteWithResponseAsync(
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String apiVersion = "2017-12-01";
+ final String accept = "application/json";
return FluxUtil
.withContext(
context ->
@@ -463,8 +465,9 @@ private Mono>> deleteWithResponseAsync(
resourceGroupName,
serverName,
databaseName,
+ accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -505,6 +508,7 @@ private Mono>> deleteWithResponseAsync(
return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null."));
}
final String apiVersion = "2017-12-01";
+ final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.delete(
@@ -514,6 +518,7 @@ private Mono>> deleteWithResponseAsync(
resourceGroupName,
serverName,
databaseName,
+ accept,
context);
}
@@ -714,7 +719,7 @@ private Mono> getWithResponseAsync(
databaseName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -877,7 +882,7 @@ private Mono> listByServerSinglePageAsync(
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/DatabasesImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/DatabasesImpl.java
index f47c755ddc1b..5fac40dea5b2 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/DatabasesImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.DatabasesClient;
import com.azure.resourcemanager.mysql.fluent.models.DatabaseInner;
import com.azure.resourcemanager.mysql.models.Database;
@@ -21,9 +20,9 @@ public final class DatabasesImpl implements Databases {
private final DatabasesClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public DatabasesImpl(DatabasesClient innerClient, MySqlManager serviceManager) {
+ public DatabasesImpl(DatabasesClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -62,12 +61,12 @@ public Response getWithResponse(
public PagedIterable listByServer(String resourceGroupName, String serverName) {
PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName);
- return inner.mapPage(inner1 -> new DatabaseImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new DatabaseImpl(inner1, this.manager()));
}
public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) {
PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName, context);
- return inner.mapPage(inner1 -> new DatabaseImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new DatabaseImpl(inner1, this.manager()));
}
public Database getById(String id) {
@@ -178,7 +177,7 @@ private DatabasesClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/FirewallRuleImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/FirewallRuleImpl.java
index 73c1528b15c7..cd109ad0b995 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/FirewallRuleImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/FirewallRuleImpl.java
@@ -5,14 +5,13 @@
package com.azure.resourcemanager.mysql.implementation;
import com.azure.core.util.Context;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.FirewallRuleInner;
import com.azure.resourcemanager.mysql.models.FirewallRule;
public final class FirewallRuleImpl implements FirewallRule, FirewallRule.Definition, FirewallRule.Update {
private FirewallRuleInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
public String id() {
return this.innerModel().id();
@@ -38,7 +37,7 @@ public FirewallRuleInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
@@ -72,7 +71,7 @@ public FirewallRule create(Context context) {
return this;
}
- FirewallRuleImpl(String name, MySqlManager serviceManager) {
+ FirewallRuleImpl(String name, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = new FirewallRuleInner();
this.serviceManager = serviceManager;
this.firewallRuleName = name;
@@ -100,7 +99,7 @@ public FirewallRule apply(Context context) {
return this;
}
- FirewallRuleImpl(FirewallRuleInner innerObject, MySqlManager serviceManager) {
+ FirewallRuleImpl(FirewallRuleInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/FirewallRulesClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/FirewallRulesClientImpl.java
index c0c8c286cad0..31ee741bbdce 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/FirewallRulesClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/FirewallRulesClientImpl.java
@@ -84,7 +84,7 @@ Mono>> createOrUpdate(
@HeaderParam("Accept") String accept,
Context context);
- @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Headers({"Content-Type: application/json"})
@Delete(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers"
+ "/{serverName}/firewallRules/{firewallRuleName}")
@@ -97,6 +97,7 @@ Mono>> delete(
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("serverName") String serverName,
@PathParam("firewallRuleName") String firewallRuleName,
+ @HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@@ -190,7 +191,7 @@ private Mono>> createOrUpdateWithResponseAsync(
parameters,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -475,6 +476,7 @@ private Mono>> deleteWithResponseAsync(
.error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
}
final String apiVersion = "2017-12-01";
+ final String accept = "application/json";
return FluxUtil
.withContext(
context ->
@@ -486,8 +488,9 @@ private Mono>> deleteWithResponseAsync(
resourceGroupName,
serverName,
firewallRuleName,
+ accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -529,6 +532,7 @@ private Mono>> deleteWithResponseAsync(
.error(new IllegalArgumentException("Parameter firewallRuleName is required and cannot be null."));
}
final String apiVersion = "2017-12-01";
+ final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.delete(
@@ -538,6 +542,7 @@ private Mono>> deleteWithResponseAsync(
resourceGroupName,
serverName,
firewallRuleName,
+ accept,
context);
}
@@ -741,7 +746,7 @@ private Mono> getWithResponseAsync(
firewallRuleName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -905,7 +910,7 @@ private Mono> listByServerSinglePageAsync(
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/FirewallRulesImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/FirewallRulesImpl.java
index 0ea39867cabc..f3a5c1f8871a 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/FirewallRulesImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/FirewallRulesImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.FirewallRulesClient;
import com.azure.resourcemanager.mysql.fluent.models.FirewallRuleInner;
import com.azure.resourcemanager.mysql.models.FirewallRule;
@@ -21,9 +20,10 @@ public final class FirewallRulesImpl implements FirewallRules {
private final FirewallRulesClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public FirewallRulesImpl(FirewallRulesClient innerClient, MySqlManager serviceManager) {
+ public FirewallRulesImpl(
+ FirewallRulesClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -62,13 +62,13 @@ public Response getWithResponse(
public PagedIterable listByServer(String resourceGroupName, String serverName) {
PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName);
- return inner.mapPage(inner1 -> new FirewallRuleImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager()));
}
public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName, context);
- return inner.mapPage(inner1 -> new FirewallRuleImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new FirewallRuleImpl(inner1, this.manager()));
}
public FirewallRule getById(String id) {
@@ -179,7 +179,7 @@ private FirewallRulesClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedPerformanceTiersClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedPerformanceTiersClientImpl.java
index 10658d7557dd..cdc06051a384 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedPerformanceTiersClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedPerformanceTiersClientImpl.java
@@ -119,7 +119,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()));
}
/**
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedPerformanceTiersImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedPerformanceTiersImpl.java
index d909eebd2ba4..99cf39bc1bc0 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedPerformanceTiersImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedPerformanceTiersImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.LocationBasedPerformanceTiersClient;
import com.azure.resourcemanager.mysql.fluent.models.PerformanceTierPropertiesInner;
import com.azure.resourcemanager.mysql.models.LocationBasedPerformanceTiers;
@@ -19,29 +18,29 @@ public final class LocationBasedPerformanceTiersImpl implements LocationBasedPer
private final LocationBasedPerformanceTiersClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
public LocationBasedPerformanceTiersImpl(
- LocationBasedPerformanceTiersClient innerClient, MySqlManager serviceManager) {
+ LocationBasedPerformanceTiersClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
public PagedIterable list(String locationName) {
PagedIterable inner = this.serviceClient().list(locationName);
- return inner.mapPage(inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager()));
}
public PagedIterable list(String locationName, Context context) {
PagedIterable inner = this.serviceClient().list(locationName, context);
- return inner.mapPage(inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager()));
}
private LocationBasedPerformanceTiersClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsOperationStatusClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsOperationStatusClientImpl.java
index 40e26938c372..cc81714fc4d8 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsOperationStatusClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsOperationStatusClientImpl.java
@@ -125,7 +125,7 @@ private Mono> getWithRes
operationId,
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsOperationStatusImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsOperationStatusImpl.java
index ebebf09f809e..bf4c87905330 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsOperationStatusImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsOperationStatusImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.LocationBasedRecommendedActionSessionsOperationStatusClient;
import com.azure.resourcemanager.mysql.fluent.models.RecommendedActionSessionsOperationStatusInner;
import com.azure.resourcemanager.mysql.models.LocationBasedRecommendedActionSessionsOperationStatus;
@@ -23,10 +22,11 @@ public final class LocationBasedRecommendedActionSessionsOperationStatusImpl
private final LocationBasedRecommendedActionSessionsOperationStatusClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
public LocationBasedRecommendedActionSessionsOperationStatusImpl(
- LocationBasedRecommendedActionSessionsOperationStatusClient innerClient, MySqlManager serviceManager) {
+ LocationBasedRecommendedActionSessionsOperationStatusClient innerClient,
+ com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -59,7 +59,7 @@ private LocationBasedRecommendedActionSessionsOperationStatusClient serviceClien
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsResultsClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsResultsClientImpl.java
index 94d1eb6fc174..088096c0eb58 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsResultsClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsResultsClientImpl.java
@@ -147,7 +147,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()));
}
/**
@@ -302,7 +302,7 @@ private Mono> listNextSinglePageAsync(S
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsResultsImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsResultsImpl.java
index 5a7b0851e5b0..d932566eb519 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsResultsImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LocationBasedRecommendedActionSessionsResultsImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.LocationBasedRecommendedActionSessionsResultsClient;
import com.azure.resourcemanager.mysql.fluent.models.RecommendationActionInner;
import com.azure.resourcemanager.mysql.models.LocationBasedRecommendedActionSessionsResults;
@@ -21,29 +20,30 @@ public final class LocationBasedRecommendedActionSessionsResultsImpl
private final LocationBasedRecommendedActionSessionsResultsClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
public LocationBasedRecommendedActionSessionsResultsImpl(
- LocationBasedRecommendedActionSessionsResultsClient innerClient, MySqlManager serviceManager) {
+ LocationBasedRecommendedActionSessionsResultsClient innerClient,
+ com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
public PagedIterable list(String locationName, String operationId) {
PagedIterable inner = this.serviceClient().list(locationName, operationId);
- return inner.mapPage(inner1 -> new RecommendationActionImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new RecommendationActionImpl(inner1, this.manager()));
}
public PagedIterable list(String locationName, String operationId, Context context) {
PagedIterable inner = this.serviceClient().list(locationName, operationId, context);
- return inner.mapPage(inner1 -> new RecommendationActionImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new RecommendationActionImpl(inner1, this.manager()));
}
private LocationBasedRecommendedActionSessionsResultsClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LogFileImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LogFileImpl.java
index 69e6659f4466..9cede9d6e966 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LogFileImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LogFileImpl.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.LogFileInner;
import com.azure.resourcemanager.mysql.models.LogFile;
import java.time.OffsetDateTime;
@@ -12,9 +11,9 @@
public final class LogFileImpl implements LogFile {
private LogFileInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- LogFileImpl(LogFileInner innerObject, MySqlManager serviceManager) {
+ LogFileImpl(LogFileInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -55,7 +54,7 @@ public LogFileInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LogFilesClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LogFilesClientImpl.java
index b3bc0eda08e6..3cbcdc58d476 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LogFilesClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LogFilesClientImpl.java
@@ -123,7 +123,7 @@ private Mono> listByServerSinglePageAsync(String res
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LogFilesImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LogFilesImpl.java
index ff0f1c5c274b..5c27cf5112e2 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LogFilesImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/LogFilesImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.LogFilesClient;
import com.azure.resourcemanager.mysql.fluent.models.LogFileInner;
import com.azure.resourcemanager.mysql.models.LogFile;
@@ -19,28 +18,28 @@ public final class LogFilesImpl implements LogFiles {
private final LogFilesClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public LogFilesImpl(LogFilesClient innerClient, MySqlManager serviceManager) {
+ public LogFilesImpl(LogFilesClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
public PagedIterable listByServer(String resourceGroupName, String serverName) {
PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName);
- return inner.mapPage(inner1 -> new LogFileImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager()));
}
public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) {
PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName, context);
- return inner.mapPage(inner1 -> new LogFileImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new LogFileImpl(inner1, this.manager()));
}
private LogFilesClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/MySqlManagementClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/MySqlManagementClientImpl.java
index fcfd6a249462..7545e005d475 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/MySqlManagementClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/MySqlManagementClientImpl.java
@@ -571,7 +571,7 @@ public Mono getLroFinalResultOrError(AsyncPollResponse,
if (managementError.getCode() == null || managementError.getMessage() == null) {
managementError = null;
}
- } catch (IOException ioe) {
+ } catch (IOException | RuntimeException ioe) {
logger.logThrowableAsWarning(ioe);
}
}
@@ -600,7 +600,7 @@ private static final class HttpResponseImpl extends HttpResponse {
super(null);
this.statusCode = statusCode;
this.httpHeaders = httpHeaders;
- this.responseBody = responseBody.getBytes(StandardCharsets.UTF_8);
+ this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8);
}
public int getStatusCode() {
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/NameAvailabilityImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/NameAvailabilityImpl.java
index c32ac64932d5..d6c76f420df1 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/NameAvailabilityImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/NameAvailabilityImpl.java
@@ -4,16 +4,16 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.NameAvailabilityInner;
import com.azure.resourcemanager.mysql.models.NameAvailability;
public final class NameAvailabilityImpl implements NameAvailability {
private NameAvailabilityInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- NameAvailabilityImpl(NameAvailabilityInner innerObject, MySqlManager serviceManager) {
+ NameAvailabilityImpl(
+ NameAvailabilityInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -34,7 +34,7 @@ public NameAvailabilityInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/OperationListResultImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/OperationListResultImpl.java
index 59c3dd78dbda..5b38ae2b2325 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/OperationListResultImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/OperationListResultImpl.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.OperationListResultInner;
import com.azure.resourcemanager.mysql.models.Operation;
import com.azure.resourcemanager.mysql.models.OperationListResult;
@@ -14,9 +13,10 @@
public final class OperationListResultImpl implements OperationListResult {
private OperationListResultInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- OperationListResultImpl(OperationListResultInner innerObject, MySqlManager serviceManager) {
+ OperationListResultImpl(
+ OperationListResultInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -34,7 +34,7 @@ public OperationListResultInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/OperationsClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/OperationsClientImpl.java
index 30e64ef73bd7..ac08f22e6475 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/OperationsClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/OperationsClientImpl.java
@@ -83,7 +83,7 @@ private Mono> listWithResponseAsync() {
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, 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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/OperationsImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/OperationsImpl.java
index 058445547f43..f273fbbc05f5 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/OperationsImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/OperationsImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.OperationsClient;
import com.azure.resourcemanager.mysql.fluent.models.OperationListResultInner;
import com.azure.resourcemanager.mysql.models.OperationListResult;
@@ -20,9 +19,9 @@ public final class OperationsImpl implements Operations {
private final OperationsClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public OperationsImpl(OperationsClient innerClient, MySqlManager serviceManager) {
+ public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -53,7 +52,7 @@ private OperationsClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PerformanceTierPropertiesImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PerformanceTierPropertiesImpl.java
index 9b9073324d5a..793c3f308e68 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PerformanceTierPropertiesImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PerformanceTierPropertiesImpl.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.PerformanceTierPropertiesInner;
import com.azure.resourcemanager.mysql.models.PerformanceTierProperties;
import com.azure.resourcemanager.mysql.models.PerformanceTierServiceLevelObjectives;
@@ -14,9 +13,10 @@
public final class PerformanceTierPropertiesImpl implements PerformanceTierProperties {
private PerformanceTierPropertiesInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- PerformanceTierPropertiesImpl(PerformanceTierPropertiesInner innerObject, MySqlManager serviceManager) {
+ PerformanceTierPropertiesImpl(
+ PerformanceTierPropertiesInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -62,7 +62,7 @@ public PerformanceTierPropertiesInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateEndpointConnectionImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateEndpointConnectionImpl.java
index f88425d7d5d1..657f33f2f7c2 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateEndpointConnectionImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateEndpointConnectionImpl.java
@@ -5,7 +5,6 @@
package com.azure.resourcemanager.mysql.implementation;
import com.azure.core.util.Context;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.PrivateEndpointConnectionInner;
import com.azure.resourcemanager.mysql.models.PrivateEndpointConnection;
import com.azure.resourcemanager.mysql.models.PrivateEndpointProperty;
@@ -17,7 +16,7 @@ public final class PrivateEndpointConnectionImpl
implements PrivateEndpointConnection, PrivateEndpointConnection.Definition, PrivateEndpointConnection.Update {
private PrivateEndpointConnectionInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
public String id() {
return this.innerModel().id();
@@ -47,7 +46,7 @@ public PrivateEndpointConnectionInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
@@ -85,7 +84,7 @@ public PrivateEndpointConnection create(Context context) {
return this;
}
- PrivateEndpointConnectionImpl(String name, MySqlManager serviceManager) {
+ PrivateEndpointConnectionImpl(String name, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = new PrivateEndpointConnectionInner();
this.serviceManager = serviceManager;
this.privateEndpointConnectionName = name;
@@ -115,7 +114,8 @@ public PrivateEndpointConnection apply(Context context) {
return this;
}
- PrivateEndpointConnectionImpl(PrivateEndpointConnectionInner innerObject, MySqlManager serviceManager) {
+ PrivateEndpointConnectionImpl(
+ PrivateEndpointConnectionInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateEndpointConnectionsClientImpl.java
index c29bb49396fc..69ff8d128cca 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateEndpointConnectionsClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateEndpointConnectionsClientImpl.java
@@ -217,7 +217,7 @@ private Mono> getWithResponseAsync(
apiVersion,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -399,7 +399,7 @@ private Mono>> createOrUpdateWithResponseAsync(
parameters,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -729,7 +729,7 @@ private Mono>> deleteWithResponseAsync(
apiVersion,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -997,7 +997,7 @@ private Mono>> updateTagsWithResponseAsync(
parameters,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -1312,7 +1312,7 @@ private Mono> listByServerSinglePa
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()));
}
/**
@@ -1471,7 +1471,7 @@ private Mono> listByServerNextSing
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateEndpointConnectionsImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateEndpointConnectionsImpl.java
index 12fa4548b28d..c4d40a7ec294 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateEndpointConnectionsImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.PrivateEndpointConnectionsClient;
import com.azure.resourcemanager.mysql.fluent.models.PrivateEndpointConnectionInner;
import com.azure.resourcemanager.mysql.models.PrivateEndpointConnection;
@@ -21,9 +20,10 @@ public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConn
private final PrivateEndpointConnectionsClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public PrivateEndpointConnectionsImpl(PrivateEndpointConnectionsClient innerClient, MySqlManager serviceManager) {
+ public PrivateEndpointConnectionsImpl(
+ PrivateEndpointConnectionsClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -66,14 +66,14 @@ public void delete(
public PagedIterable listByServer(String resourceGroupName, String serverName) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName);
- return inner.mapPage(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager()));
}
public PagedIterable listByServer(
String resourceGroupName, String serverName, Context context) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName, context);
- return inner.mapPage(inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionImpl(inner1, this.manager()));
}
public PrivateEndpointConnection getById(String id) {
@@ -198,7 +198,7 @@ private PrivateEndpointConnectionsClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateLinkResourceImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateLinkResourceImpl.java
index 5b4464b099ef..dc1fc2913bbe 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateLinkResourceImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateLinkResourceImpl.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.PrivateLinkResourceInner;
import com.azure.resourcemanager.mysql.models.PrivateLinkResource;
import com.azure.resourcemanager.mysql.models.PrivateLinkResourceProperties;
@@ -12,9 +11,10 @@
public final class PrivateLinkResourceImpl implements PrivateLinkResource {
private PrivateLinkResourceInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- PrivateLinkResourceImpl(PrivateLinkResourceInner innerObject, MySqlManager serviceManager) {
+ PrivateLinkResourceImpl(
+ PrivateLinkResourceInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -39,7 +39,7 @@ public PrivateLinkResourceInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateLinkResourcesClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateLinkResourcesClientImpl.java
index afebdfe849e1..6a0ae40870ff 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateLinkResourcesClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateLinkResourcesClientImpl.java
@@ -157,7 +157,7 @@ private Mono> listByServerSinglePageAsyn
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()));
}
/**
@@ -335,7 +335,7 @@ private Mono> getWithResponseAsync(
apiVersion,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -480,7 +480,7 @@ private Mono> listByServerNextSinglePage
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateLinkResourcesImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateLinkResourcesImpl.java
index 27e39ef18ba1..571f8c05b6a9 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateLinkResourcesImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/PrivateLinkResourcesImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.PrivateLinkResourcesClient;
import com.azure.resourcemanager.mysql.fluent.models.PrivateLinkResourceInner;
import com.azure.resourcemanager.mysql.models.PrivateLinkResource;
@@ -21,9 +20,10 @@ public final class PrivateLinkResourcesImpl implements PrivateLinkResources {
private final PrivateLinkResourcesClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, MySqlManager serviceManager) {
+ public PrivateLinkResourcesImpl(
+ PrivateLinkResourcesClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -31,14 +31,14 @@ public PrivateLinkResourcesImpl(PrivateLinkResourcesClient innerClient, MySqlMan
public PagedIterable listByServer(String resourceGroupName, String serverName) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName);
- return inner.mapPage(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager()));
}
public PagedIterable listByServer(
String resourceGroupName, String serverName, Context context) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName, context);
- return inner.mapPage(inner1 -> new PrivateLinkResourceImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager()));
}
public PrivateLinkResource get(String resourceGroupName, String serverName, String groupName) {
@@ -69,7 +69,7 @@ private PrivateLinkResourcesClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryPerformanceInsightResetDataResultImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryPerformanceInsightResetDataResultImpl.java
index 84a4b1515473..57f059fd1838 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryPerformanceInsightResetDataResultImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryPerformanceInsightResetDataResultImpl.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.QueryPerformanceInsightResetDataResultInner;
import com.azure.resourcemanager.mysql.models.QueryPerformanceInsightResetDataResult;
import com.azure.resourcemanager.mysql.models.QueryPerformanceInsightResetDataResultState;
@@ -12,10 +11,11 @@
public final class QueryPerformanceInsightResetDataResultImpl implements QueryPerformanceInsightResetDataResult {
private QueryPerformanceInsightResetDataResultInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
QueryPerformanceInsightResetDataResultImpl(
- QueryPerformanceInsightResetDataResultInner innerObject, MySqlManager serviceManager) {
+ QueryPerformanceInsightResetDataResultInner innerObject,
+ com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -32,7 +32,7 @@ public QueryPerformanceInsightResetDataResultInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryStatisticImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryStatisticImpl.java
index e3cd4d0d1f9f..428b26592a84 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryStatisticImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryStatisticImpl.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.QueryStatisticInner;
import com.azure.resourcemanager.mysql.models.QueryStatistic;
import java.time.OffsetDateTime;
@@ -14,9 +13,9 @@
public final class QueryStatisticImpl implements QueryStatistic {
private QueryStatisticInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- QueryStatisticImpl(QueryStatisticInner innerObject, MySqlManager serviceManager) {
+ QueryStatisticImpl(QueryStatisticInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -82,7 +81,7 @@ public QueryStatisticInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryTextImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryTextImpl.java
index a546457b9158..632cada72f24 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryTextImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryTextImpl.java
@@ -4,16 +4,15 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.QueryTextInner;
import com.azure.resourcemanager.mysql.models.QueryText;
public final class QueryTextImpl implements QueryText {
private QueryTextInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- QueryTextImpl(QueryTextInner innerObject, MySqlManager serviceManager) {
+ QueryTextImpl(QueryTextInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -42,7 +41,7 @@ public QueryTextInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryTextsClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryTextsClientImpl.java
index 38b3841851ab..9ccefbf11b65 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryTextsClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryTextsClientImpl.java
@@ -156,7 +156,7 @@ private Mono> getWithResponseAsync(
queryId,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -331,7 +331,7 @@ private Mono> listByServerSinglePageAsync(
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()));
}
/**
@@ -503,7 +503,7 @@ private Mono> listByServerNextSinglePageAsync(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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryTextsImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryTextsImpl.java
index 7ea194eaa62b..34d794e24c70 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryTextsImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/QueryTextsImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.QueryTextsClient;
import com.azure.resourcemanager.mysql.fluent.models.QueryTextInner;
import com.azure.resourcemanager.mysql.models.QueryText;
@@ -22,9 +21,9 @@ public final class QueryTextsImpl implements QueryTexts {
private final QueryTextsClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public QueryTextsImpl(QueryTextsClient innerClient, MySqlManager serviceManager) {
+ public QueryTextsImpl(QueryTextsClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -56,21 +55,21 @@ public Response getWithResponse(
public PagedIterable listByServer(String resourceGroupName, String serverName, List queryIds) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName, queryIds);
- return inner.mapPage(inner1 -> new QueryTextImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new QueryTextImpl(inner1, this.manager()));
}
public PagedIterable listByServer(
String resourceGroupName, String serverName, List queryIds, Context context) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName, queryIds, context);
- return inner.mapPage(inner1 -> new QueryTextImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new QueryTextImpl(inner1, this.manager()));
}
private QueryTextsClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendationActionImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendationActionImpl.java
index 9af370077c0e..c1f1326b3423 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendationActionImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendationActionImpl.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.RecommendationActionInner;
import com.azure.resourcemanager.mysql.models.RecommendationAction;
import java.time.OffsetDateTime;
@@ -14,9 +13,10 @@
public final class RecommendationActionImpl implements RecommendationAction {
private RecommendationActionInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- RecommendationActionImpl(RecommendationActionInner innerObject, MySqlManager serviceManager) {
+ RecommendationActionImpl(
+ RecommendationActionInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -74,7 +74,7 @@ public RecommendationActionInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendedActionSessionsOperationStatusImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendedActionSessionsOperationStatusImpl.java
index 00ba68f2f6c0..bd2a6d48eb56 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendedActionSessionsOperationStatusImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendedActionSessionsOperationStatusImpl.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.RecommendedActionSessionsOperationStatusInner;
import com.azure.resourcemanager.mysql.models.RecommendedActionSessionsOperationStatus;
import java.time.OffsetDateTime;
@@ -12,10 +11,11 @@
public final class RecommendedActionSessionsOperationStatusImpl implements RecommendedActionSessionsOperationStatus {
private RecommendedActionSessionsOperationStatusInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
RecommendedActionSessionsOperationStatusImpl(
- RecommendedActionSessionsOperationStatusInner innerObject, MySqlManager serviceManager) {
+ RecommendedActionSessionsOperationStatusInner innerObject,
+ com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -36,7 +36,7 @@ public RecommendedActionSessionsOperationStatusInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendedActionsClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendedActionsClientImpl.java
index c9b9a3cb7224..a4b81edb1a2b 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendedActionsClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendedActionsClientImpl.java
@@ -161,7 +161,7 @@ private Mono> getWithResponseAsync(
recommendedActionName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -355,7 +355,7 @@ private Mono> listByServerSinglePageAsy
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()));
}
/**
@@ -551,7 +551,7 @@ private Mono> listByServerNextSinglePag
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendedActionsImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendedActionsImpl.java
index 97ef691b2ba5..e88c3245d860 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendedActionsImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecommendedActionsImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.RecommendedActionsClient;
import com.azure.resourcemanager.mysql.fluent.models.RecommendationActionInner;
import com.azure.resourcemanager.mysql.models.RecommendationAction;
@@ -21,9 +20,10 @@ public final class RecommendedActionsImpl implements RecommendedActions {
private final RecommendedActionsClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public RecommendedActionsImpl(RecommendedActionsClient innerClient, MySqlManager serviceManager) {
+ public RecommendedActionsImpl(
+ RecommendedActionsClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -64,21 +64,21 @@ public PagedIterable listByServer(
String resourceGroupName, String serverName, String advisorName) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName, advisorName);
- return inner.mapPage(inner1 -> new RecommendationActionImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new RecommendationActionImpl(inner1, this.manager()));
}
public PagedIterable listByServer(
String resourceGroupName, String serverName, String advisorName, String sessionId, Context context) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName, advisorName, sessionId, context);
- return inner.mapPage(inner1 -> new RecommendationActionImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new RecommendationActionImpl(inner1, this.manager()));
}
private RecommendedActionsClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecoverableServerResourceImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecoverableServerResourceImpl.java
index fbd884bdad71..428283606eea 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecoverableServerResourceImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecoverableServerResourceImpl.java
@@ -4,16 +4,16 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.RecoverableServerResourceInner;
import com.azure.resourcemanager.mysql.models.RecoverableServerResource;
public final class RecoverableServerResourceImpl implements RecoverableServerResource {
private RecoverableServerResourceInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- RecoverableServerResourceImpl(RecoverableServerResourceInner innerObject, MySqlManager serviceManager) {
+ RecoverableServerResourceImpl(
+ RecoverableServerResourceInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -58,7 +58,7 @@ public RecoverableServerResourceInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecoverableServersClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecoverableServersClientImpl.java
index 9f57ff064976..8520799a2393 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecoverableServersClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecoverableServersClientImpl.java
@@ -116,7 +116,7 @@ private Mono> getWithResponseAsync(
serverName,
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecoverableServersImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecoverableServersImpl.java
index 6169ebc16e48..23bcc4e57c2b 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecoverableServersImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/RecoverableServersImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.RecoverableServersClient;
import com.azure.resourcemanager.mysql.fluent.models.RecoverableServerResourceInner;
import com.azure.resourcemanager.mysql.models.RecoverableServerResource;
@@ -20,9 +19,10 @@ public final class RecoverableServersImpl implements RecoverableServers {
private final RecoverableServersClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public RecoverableServersImpl(RecoverableServersClient innerClient, MySqlManager serviceManager) {
+ public RecoverableServersImpl(
+ RecoverableServersClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -55,7 +55,7 @@ private RecoverableServersClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ReplicasClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ReplicasClientImpl.java
index e25195f8cb2c..c105560e95ff 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ReplicasClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ReplicasClientImpl.java
@@ -123,7 +123,7 @@ private Mono> listByServerSinglePageAsync(String reso
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ReplicasImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ReplicasImpl.java
index f5ca1f4ca03a..5c748495036f 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ReplicasImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ReplicasImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.ReplicasClient;
import com.azure.resourcemanager.mysql.fluent.models.ServerInner;
import com.azure.resourcemanager.mysql.models.Replicas;
@@ -19,28 +18,28 @@ public final class ReplicasImpl implements Replicas {
private final ReplicasClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public ReplicasImpl(ReplicasClient innerClient, MySqlManager serviceManager) {
+ public ReplicasImpl(ReplicasClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
public PagedIterable listByServer(String resourceGroupName, String serverName) {
PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName);
- return inner.mapPage(inner1 -> new ServerImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager()));
}
public PagedIterable listByServer(String resourceGroupName, String serverName, Context context) {
PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName, context);
- return inner.mapPage(inner1 -> new ServerImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager()));
}
private ReplicasClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ResourceProvidersClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ResourceProvidersClientImpl.java
index 8954f2b3db45..1aa2d52a0ff6 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ResourceProvidersClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ResourceProvidersClientImpl.java
@@ -137,7 +137,7 @@ Mono>> createRecommendedActionSession(
serverName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -299,7 +299,7 @@ private Mono>> createRecommendedActionSessionWithRespo
advisorName,
databaseName,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ResourceProvidersImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ResourceProvidersImpl.java
index 21c415a2765c..ea71baaca092 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ResourceProvidersImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ResourceProvidersImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.ResourceProvidersClient;
import com.azure.resourcemanager.mysql.fluent.models.QueryPerformanceInsightResetDataResultInner;
import com.azure.resourcemanager.mysql.models.QueryPerformanceInsightResetDataResult;
@@ -20,9 +19,10 @@ public final class ResourceProvidersImpl implements ResourceProviders {
private final ResourceProvidersClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public ResourceProvidersImpl(ResourceProvidersClient innerClient, MySqlManager serviceManager) {
+ public ResourceProvidersImpl(
+ ResourceProvidersClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -69,7 +69,7 @@ private ResourceProvidersClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerAdministratorResourceImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerAdministratorResourceImpl.java
index 3786b1e3f6cb..6a50416b6669 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerAdministratorResourceImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerAdministratorResourceImpl.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.ServerAdministratorResourceInner;
import com.azure.resourcemanager.mysql.models.AdministratorType;
import com.azure.resourcemanager.mysql.models.ServerAdministratorResource;
@@ -13,9 +12,10 @@
public final class ServerAdministratorResourceImpl implements ServerAdministratorResource {
private ServerAdministratorResourceInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- ServerAdministratorResourceImpl(ServerAdministratorResourceInner innerObject, MySqlManager serviceManager) {
+ ServerAdministratorResourceImpl(
+ ServerAdministratorResourceInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -52,7 +52,7 @@ public ServerAdministratorResourceInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerAdministratorsClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerAdministratorsClientImpl.java
index f74b43422596..033add050842 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerAdministratorsClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerAdministratorsClientImpl.java
@@ -71,7 +71,7 @@ private interface ServerAdministratorsService {
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers"
- + "/{serverName}/Administrators/activeDirectory")
+ + "/{serverName}/administrators/activeDirectory")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> get(
@@ -86,7 +86,7 @@ Mono> get(
@Headers({"Content-Type: application/json"})
@Put(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers"
- + "/{serverName}/Administrators/activeDirectory")
+ + "/{serverName}/administrators/activeDirectory")
@ExpectedResponses({200, 202})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdate(
@@ -102,7 +102,7 @@ Mono>> createOrUpdate(
@Headers({"Content-Type: application/json"})
@Delete(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers"
- + "/{serverName}/Administrators/activeDirectory")
+ + "/{serverName}/administrators/activeDirectory")
@ExpectedResponses({200, 202, 204})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> delete(
@@ -176,7 +176,7 @@ private Mono> getWithResponseAsync(
serverName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -335,7 +335,7 @@ private Mono>> createOrUpdateWithResponseAsync(
properties,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -612,7 +612,7 @@ private Mono>> deleteWithResponseAsync(String resource
serverName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -845,7 +845,7 @@ private Mono> listSinglePageAsyn
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerAdministratorsImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerAdministratorsImpl.java
index f13d381b4740..6cb400f54f2f 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerAdministratorsImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerAdministratorsImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.ServerAdministratorsClient;
import com.azure.resourcemanager.mysql.fluent.models.ServerAdministratorResourceInner;
import com.azure.resourcemanager.mysql.models.ServerAdministratorResource;
@@ -21,9 +20,10 @@ public final class ServerAdministratorsImpl implements ServerAdministrators {
private final ServerAdministratorsClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public ServerAdministratorsImpl(ServerAdministratorsClient innerClient, MySqlManager serviceManager) {
+ public ServerAdministratorsImpl(
+ ServerAdministratorsClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -85,21 +85,21 @@ public void delete(String resourceGroupName, String serverName, Context context)
public PagedIterable list(String resourceGroupName, String serverName) {
PagedIterable inner =
this.serviceClient().list(resourceGroupName, serverName);
- return inner.mapPage(inner1 -> new ServerAdministratorResourceImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new ServerAdministratorResourceImpl(inner1, this.manager()));
}
public PagedIterable list(
String resourceGroupName, String serverName, Context context) {
PagedIterable inner =
this.serviceClient().list(resourceGroupName, serverName, context);
- return inner.mapPage(inner1 -> new ServerAdministratorResourceImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new ServerAdministratorResourceImpl(inner1, this.manager()));
}
private ServerAdministratorsClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerBasedPerformanceTiersClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerBasedPerformanceTiersClientImpl.java
index accbcb323297..d46fda5ef660 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerBasedPerformanceTiersClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerBasedPerformanceTiersClientImpl.java
@@ -127,7 +127,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()));
}
/**
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerBasedPerformanceTiersImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerBasedPerformanceTiersImpl.java
index 55b74aeb1c64..ce61a6ff8f70 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerBasedPerformanceTiersImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerBasedPerformanceTiersImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.ServerBasedPerformanceTiersClient;
import com.azure.resourcemanager.mysql.fluent.models.PerformanceTierPropertiesInner;
import com.azure.resourcemanager.mysql.models.PerformanceTierProperties;
@@ -19,29 +18,30 @@ public final class ServerBasedPerformanceTiersImpl implements ServerBasedPerform
private final ServerBasedPerformanceTiersClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public ServerBasedPerformanceTiersImpl(ServerBasedPerformanceTiersClient innerClient, MySqlManager serviceManager) {
+ public ServerBasedPerformanceTiersImpl(
+ ServerBasedPerformanceTiersClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
public PagedIterable list(String resourceGroupName, String serverName) {
PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName);
- return inner.mapPage(inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager()));
}
public PagedIterable list(String resourceGroupName, String serverName, Context context) {
PagedIterable inner =
this.serviceClient().list(resourceGroupName, serverName, context);
- return inner.mapPage(inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new PerformanceTierPropertiesImpl(inner1, this.manager()));
}
private ServerBasedPerformanceTiersClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerImpl.java
index 55d6f59ec005..988fa6d2c020 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerImpl.java
@@ -6,7 +6,6 @@
import com.azure.core.management.Region;
import com.azure.core.util.Context;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.ServerInner;
import com.azure.resourcemanager.mysql.models.InfrastructureEncryption;
import com.azure.resourcemanager.mysql.models.MinimalTlsVersionEnum;
@@ -30,7 +29,7 @@
public final class ServerImpl implements Server, Server.Definition, Server.Update {
private ServerInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
public String id() {
return this.innerModel().id();
@@ -142,7 +141,7 @@ public ServerInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
@@ -177,7 +176,7 @@ public Server create(Context context) {
return this;
}
- ServerImpl(String name, MySqlManager serviceManager) {
+ ServerImpl(String name, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = new ServerInner();
this.serviceManager = serviceManager;
this.serverName = name;
@@ -207,7 +206,7 @@ public Server apply(Context context) {
return this;
}
- ServerImpl(ServerInner innerObject, MySqlManager serviceManager) {
+ ServerImpl(ServerInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerKeyImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerKeyImpl.java
index eb2ac07969af..cafe58e95fda 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerKeyImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerKeyImpl.java
@@ -5,7 +5,6 @@
package com.azure.resourcemanager.mysql.implementation;
import com.azure.core.util.Context;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.ServerKeyInner;
import com.azure.resourcemanager.mysql.models.ServerKey;
import com.azure.resourcemanager.mysql.models.ServerKeyType;
@@ -14,7 +13,7 @@
public final class ServerKeyImpl implements ServerKey, ServerKey.Definition, ServerKey.Update {
private ServerKeyInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
public String id() {
return this.innerModel().id();
@@ -48,7 +47,7 @@ public ServerKeyInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
@@ -82,7 +81,7 @@ public ServerKey create(Context context) {
return this;
}
- ServerKeyImpl(String name, MySqlManager serviceManager) {
+ ServerKeyImpl(String name, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = new ServerKeyInner();
this.serviceManager = serviceManager;
this.keyName = name;
@@ -110,7 +109,7 @@ public ServerKey apply(Context context) {
return this;
}
- ServerKeyImpl(ServerKeyInner innerObject, MySqlManager serviceManager) {
+ ServerKeyImpl(ServerKeyInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
this.serverName = Utils.getValueFromIdByName(innerObject.id(), "servers");
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerKeysClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerKeysClientImpl.java
index 30a3c886f666..bfc1f55c8f7b 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerKeysClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerKeysClientImpl.java
@@ -196,7 +196,7 @@ private Mono> listSinglePageAsync(String resourceG
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()));
}
/**
@@ -371,7 +371,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()));
}
/**
@@ -542,7 +542,7 @@ private Mono>> createOrUpdateWithResponseAsync(
parameters,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -818,7 +818,7 @@ private Mono>> deleteWithResponseAsync(
resourceGroupName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -1050,7 +1050,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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerKeysImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerKeysImpl.java
index bcab69784928..73c3b0e59254 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerKeysImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerKeysImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.ServerKeysClient;
import com.azure.resourcemanager.mysql.fluent.models.ServerKeyInner;
import com.azure.resourcemanager.mysql.models.ServerKey;
@@ -21,21 +20,21 @@ public final class ServerKeysImpl implements ServerKeys {
private final ServerKeysClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public ServerKeysImpl(ServerKeysClient innerClient, MySqlManager serviceManager) {
+ public ServerKeysImpl(ServerKeysClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
public PagedIterable list(String resourceGroupName, String serverName) {
PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName);
- return inner.mapPage(inner1 -> new ServerKeyImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new ServerKeyImpl(inner1, this.manager()));
}
public PagedIterable list(String resourceGroupName, String serverName, Context context) {
PagedIterable inner = this.serviceClient().list(resourceGroupName, serverName, context);
- return inner.mapPage(inner1 -> new ServerKeyImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new ServerKeyImpl(inner1, this.manager()));
}
public ServerKey get(String resourceGroupName, String serverName, String keyName) {
@@ -178,7 +177,7 @@ private ServerKeysClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerParametersClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerParametersClientImpl.java
index 314e7da2e335..7ab7db0d78c5 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerParametersClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerParametersClientImpl.java
@@ -130,7 +130,7 @@ private Mono>> listUpdateConfigurationsWithResponseAsy
value,
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerParametersImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerParametersImpl.java
index c478825b0037..356a5bd62ae3 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerParametersImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerParametersImpl.java
@@ -6,7 +6,6 @@
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.ServerParametersClient;
import com.azure.resourcemanager.mysql.fluent.models.ConfigurationListResultInner;
import com.azure.resourcemanager.mysql.models.ConfigurationListResult;
@@ -18,9 +17,10 @@ public final class ServerParametersImpl implements ServerParameters {
private final ServerParametersClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public ServerParametersImpl(ServerParametersClient innerClient, MySqlManager serviceManager) {
+ public ServerParametersImpl(
+ ServerParametersClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -51,7 +51,7 @@ private ServerParametersClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerSecurityAlertPoliciesClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerSecurityAlertPoliciesClientImpl.java
index 22ad4d276964..0969d03cbef0 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerSecurityAlertPoliciesClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerSecurityAlertPoliciesClientImpl.java
@@ -18,6 +18,10 @@
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
@@ -30,6 +34,7 @@
import com.azure.resourcemanager.mysql.fluent.ServerSecurityAlertPoliciesClient;
import com.azure.resourcemanager.mysql.fluent.models.ServerSecurityAlertPolicyInner;
import com.azure.resourcemanager.mysql.models.SecurityAlertPolicyName;
+import com.azure.resourcemanager.mysql.models.ServerSecurityAlertPolicyListResult;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
@@ -96,6 +101,31 @@ Mono>> createOrUpdate(
@BodyParam("application/json") ServerSecurityAlertPolicyInner parameters,
@HeaderParam("Accept") String accept,
Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBforMySQL/servers"
+ + "/{serverName}/securityAlertPolicies")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByServer(
+ @HostParam("$host") String endpoint,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("serverName") String serverName,
+ @PathParam("subscriptionId") String subscriptionId,
+ @QueryParam("api-version") String apiVersion,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByServerNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
}
/**
@@ -151,7 +181,7 @@ private Mono> getWithResponseAsync(
apiVersion,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -331,7 +361,7 @@ private Mono>> createOrUpdateWithResponseAsync(
parameters,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -602,4 +632,258 @@ public ServerSecurityAlertPolicyInner createOrUpdate(
Context context) {
return createOrUpdateAsync(resourceGroupName, serverName, securityAlertPolicyName, parameters, context).block();
}
+
+ /**
+ * Get the server's threat detection policies.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the server's threat detection policies.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerSinglePageAsync(
+ String resourceGroupName, String serverName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String apiVersion = "2017-12-01";
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByServer(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ serverName,
+ this.client.getSubscriptionId(),
+ apiVersion,
+ accept,
+ context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the server's threat detection policies.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the server's threat detection policies.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerSinglePageAsync(
+ String resourceGroupName, String serverName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (serverName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));
+ }
+ if (this.client.getSubscriptionId() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getSubscriptionId() is required and cannot be null."));
+ }
+ final String apiVersion = "2017-12-01";
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByServer(
+ this.client.getEndpoint(),
+ resourceGroupName,
+ serverName,
+ this.client.getSubscriptionId(),
+ apiVersion,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * Get the server's threat detection policies.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the server's threat detection policies.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByServerAsync(String resourceGroupName, String serverName) {
+ return new PagedFlux<>(
+ () -> listByServerSinglePageAsync(resourceGroupName, serverName),
+ nextLink -> listByServerNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * Get the server's threat detection policies.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the server's threat detection policies.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByServerAsync(
+ String resourceGroupName, String serverName, Context context) {
+ return new PagedFlux<>(
+ () -> listByServerSinglePageAsync(resourceGroupName, serverName, context),
+ nextLink -> listByServerNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * Get the server's threat detection policies.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the server's threat detection policies.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByServer(String resourceGroupName, String serverName) {
+ return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName));
+ }
+
+ /**
+ * Get the server's threat detection policies.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param serverName The name of the server.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the server's threat detection policies.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByServer(
+ String resourceGroupName, String serverName, Context context) {
+ return new PagedIterable<>(listByServerAsync(resourceGroupName, serverName, context));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of the server's security alert policies.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerNextSinglePageAsync(String nextLink) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(context -> service.listByServerNext(nextLink, this.client.getEndpoint(), accept, context))
+ .>map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The nextLink parameter.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws ManagementException thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return a list of the server's security alert policies.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByServerNextSinglePageAsync(
+ String nextLink, Context context) {
+ if (nextLink == null) {
+ return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
+ }
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByServerNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerSecurityAlertPoliciesImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerSecurityAlertPoliciesImpl.java
index f2452bef94c4..437e1365d42d 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerSecurityAlertPoliciesImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerSecurityAlertPoliciesImpl.java
@@ -4,11 +4,11 @@
package com.azure.resourcemanager.mysql.implementation;
+import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
import com.azure.core.util.logging.ClientLogger;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.ServerSecurityAlertPoliciesClient;
import com.azure.resourcemanager.mysql.fluent.models.ServerSecurityAlertPolicyInner;
import com.azure.resourcemanager.mysql.models.SecurityAlertPolicyName;
@@ -21,9 +21,10 @@ public final class ServerSecurityAlertPoliciesImpl implements ServerSecurityAler
private final ServerSecurityAlertPoliciesClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public ServerSecurityAlertPoliciesImpl(ServerSecurityAlertPoliciesClient innerClient, MySqlManager serviceManager) {
+ public ServerSecurityAlertPoliciesImpl(
+ ServerSecurityAlertPoliciesClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -54,6 +55,19 @@ public Response getWithResponse(
}
}
+ public PagedIterable listByServer(String resourceGroupName, String serverName) {
+ PagedIterable inner =
+ this.serviceClient().listByServer(resourceGroupName, serverName);
+ return Utils.mapPage(inner, inner1 -> new ServerSecurityAlertPolicyImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByServer(
+ String resourceGroupName, String serverName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByServer(resourceGroupName, serverName, context);
+ return Utils.mapPage(inner, inner1 -> new ServerSecurityAlertPolicyImpl(inner1, this.manager()));
+ }
+
public ServerSecurityAlertPolicy getById(String id) {
String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
if (resourceGroupName == null) {
@@ -118,7 +132,7 @@ private ServerSecurityAlertPoliciesClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerSecurityAlertPolicyImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerSecurityAlertPolicyImpl.java
index 75a38427edc8..79619bb853ee 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerSecurityAlertPolicyImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServerSecurityAlertPolicyImpl.java
@@ -5,7 +5,6 @@
package com.azure.resourcemanager.mysql.implementation;
import com.azure.core.util.Context;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.ServerSecurityAlertPolicyInner;
import com.azure.resourcemanager.mysql.models.SecurityAlertPolicyName;
import com.azure.resourcemanager.mysql.models.ServerSecurityAlertPolicy;
@@ -17,7 +16,7 @@ public final class ServerSecurityAlertPolicyImpl
implements ServerSecurityAlertPolicy, ServerSecurityAlertPolicy.Definition, ServerSecurityAlertPolicy.Update {
private ServerSecurityAlertPolicyInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
public String id() {
return this.innerModel().id();
@@ -73,7 +72,7 @@ public ServerSecurityAlertPolicyInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
@@ -108,7 +107,8 @@ public ServerSecurityAlertPolicy create(Context context) {
return this;
}
- ServerSecurityAlertPolicyImpl(SecurityAlertPolicyName name, MySqlManager serviceManager) {
+ ServerSecurityAlertPolicyImpl(
+ SecurityAlertPolicyName name, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = new ServerSecurityAlertPolicyInner();
this.serviceManager = serviceManager;
this.securityAlertPolicyName = name;
@@ -137,7 +137,8 @@ public ServerSecurityAlertPolicy apply(Context context) {
return this;
}
- ServerSecurityAlertPolicyImpl(ServerSecurityAlertPolicyInner innerObject, MySqlManager serviceManager) {
+ ServerSecurityAlertPolicyImpl(
+ ServerSecurityAlertPolicyInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServersClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServersClientImpl.java
index d5568d91c403..a0850719fea1 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServersClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServersClientImpl.java
@@ -103,7 +103,7 @@ Mono>> update(
@HeaderParam("Accept") String accept,
Context context);
- @Headers({"Accept: application/json;q=0.9", "Content-Type: application/json"})
+ @Headers({"Content-Type: application/json"})
@Delete(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DBForMySQL/servers"
+ "/{serverName}")
@@ -115,6 +115,7 @@ Mono>> delete(
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("serverName") String serverName,
+ @HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@@ -271,7 +272,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()));
}
/**
@@ -534,7 +535,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()));
}
/**
@@ -785,6 +786,7 @@ private Mono>> deleteWithResponseAsync(String resource
return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));
}
final String apiVersion = "2017-12-01";
+ final String accept = "application/json";
return FluxUtil
.withContext(
context ->
@@ -795,8 +797,9 @@ private Mono>> deleteWithResponseAsync(String resource
this.client.getSubscriptionId(),
resourceGroupName,
serverName,
+ accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -833,6 +836,7 @@ private Mono>> deleteWithResponseAsync(
return Mono.error(new IllegalArgumentException("Parameter serverName is required and cannot be null."));
}
final String apiVersion = "2017-12-01";
+ final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.delete(
@@ -841,6 +845,7 @@ private Mono>> deleteWithResponseAsync(
this.client.getSubscriptionId(),
resourceGroupName,
serverName,
+ accept,
context);
}
@@ -1023,7 +1028,7 @@ private Mono> getByResourceGroupWithResponseAsync(
serverName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -1172,7 +1177,7 @@ private Mono> listByResourceGroupSinglePageAsync(Stri
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()));
}
/**
@@ -1311,7 +1316,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()));
}
/**
@@ -1445,7 +1450,7 @@ private Mono>> restartWithResponseAsync(String resourc
serverName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -1673,7 +1678,7 @@ private Mono>> startWithResponseAsync(String resourceG
serverName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -1900,7 +1905,7 @@ private Mono>> stopWithResponseAsync(String resourceGr
serverName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -2135,7 +2140,7 @@ private Mono>> upgradeWithResponseAsync(
parameters,
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServersImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServersImpl.java
index 6077f14da50d..b3323a878063 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServersImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/ServersImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.ServersClient;
import com.azure.resourcemanager.mysql.fluent.models.ServerInner;
import com.azure.resourcemanager.mysql.models.Server;
@@ -22,9 +21,9 @@ public final class ServersImpl implements Servers {
private final ServersClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public ServersImpl(ServersClient innerClient, MySqlManager serviceManager) {
+ public ServersImpl(ServersClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -63,22 +62,22 @@ public Response getByResourceGroupWithResponse(
public PagedIterable listByResourceGroup(String resourceGroupName) {
PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName);
- return inner.mapPage(inner1 -> new ServerImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager()));
}
public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName, context);
- return inner.mapPage(inner1 -> new ServerImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager()));
}
public PagedIterable list() {
PagedIterable inner = this.serviceClient().list();
- return inner.mapPage(inner1 -> new ServerImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager()));
}
public PagedIterable list(Context context) {
PagedIterable inner = this.serviceClient().list(context);
- return inner.mapPage(inner1 -> new ServerImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new ServerImpl(inner1, this.manager()));
}
public void restart(String resourceGroupName, String serverName) {
@@ -194,7 +193,7 @@ private ServersClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/TopQueryStatisticsClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/TopQueryStatisticsClientImpl.java
index 11e5e0b8d2fc..758bbfa5b1a3 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/TopQueryStatisticsClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/TopQueryStatisticsClientImpl.java
@@ -156,7 +156,7 @@ private Mono> getWithResponseAsync(
queryStatisticId,
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> listByServerSinglePageAsync(
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()));
}
/**
@@ -504,7 +504,7 @@ private Mono> listByServerNextSinglePageAsync
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/TopQueryStatisticsImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/TopQueryStatisticsImpl.java
index bf90e8dc37ff..751027809387 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/TopQueryStatisticsImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/TopQueryStatisticsImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.TopQueryStatisticsClient;
import com.azure.resourcemanager.mysql.fluent.models.QueryStatisticInner;
import com.azure.resourcemanager.mysql.models.QueryStatistic;
@@ -22,9 +21,10 @@ public final class TopQueryStatisticsImpl implements TopQueryStatistics {
private final TopQueryStatisticsClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public TopQueryStatisticsImpl(TopQueryStatisticsClient innerClient, MySqlManager serviceManager) {
+ public TopQueryStatisticsImpl(
+ TopQueryStatisticsClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -57,21 +57,21 @@ public PagedIterable listByServer(
String resourceGroupName, String serverName, TopQueryStatisticsInput parameters) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName, parameters);
- return inner.mapPage(inner1 -> new QueryStatisticImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new QueryStatisticImpl(inner1, this.manager()));
}
public PagedIterable listByServer(
String resourceGroupName, String serverName, TopQueryStatisticsInput parameters, Context context) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName, parameters, context);
- return inner.mapPage(inner1 -> new QueryStatisticImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new QueryStatisticImpl(inner1, this.manager()));
}
private TopQueryStatisticsClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/Utils.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/Utils.java
index b567ce347ec1..a998b133ecf9 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/Utils.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/Utils.java
@@ -4,12 +4,20 @@
package com.azure.resourcemanager.mysql.implementation;
+import com.azure.core.http.rest.PagedFlux;
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.util.CoreUtils;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
+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) {
@@ -64,4 +72,133 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri
}
return null;
}
+
+ static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) {
+ return new PagedIterableImpl(pageIterable, mapper);
+ }
+
+ private static final class PagedIterableImpl extends PagedIterable {
+
+ private final PagedIterable pagedIterable;
+ private final Function mapper;
+ private final Function, PagedResponse> pageMapper;
+
+ 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 = 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 pagedIterable.stream().map(mapper);
+ }
+
+ @Override
+ public Stream> streamByPage() {
+ return pagedIterable.streamByPage().map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken) {
+ return pagedIterable.streamByPage(continuationToken).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(int preferredPageSize) {
+ return pagedIterable.streamByPage(preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Stream> streamByPage(String continuationToken, int preferredPageSize) {
+ return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper);
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl(pagedIterable.iterator(), mapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage() {
+ return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(preferredPageSize), pageMapper);
+ }
+
+ @Override
+ public Iterable> iterableByPage(String continuationToken, int preferredPageSize) {
+ return new IterableImpl, PagedResponse>(
+ pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper);
+ }
+ }
+
+ private static final class IteratorImpl implements Iterator {
+
+ private final Iterator iterator;
+ private final Function mapper;
+
+ private IteratorImpl(Iterator iterator, Function mapper) {
+ this.iterator = iterator;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public boolean hasNext() {
+ return iterator.hasNext();
+ }
+
+ @Override
+ public S next() {
+ return mapper.apply(iterator.next());
+ }
+
+ @Override
+ public void remove() {
+ iterator.remove();
+ }
+ }
+
+ private static final class IterableImpl implements Iterable {
+
+ private final Iterable iterable;
+ private final Function mapper;
+
+ private IterableImpl(Iterable iterable, Function mapper) {
+ this.iterable = iterable;
+ this.mapper = mapper;
+ }
+
+ @Override
+ public Iterator iterator() {
+ return new IteratorImpl(iterable.iterator(), mapper);
+ }
+ }
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/VirtualNetworkRuleImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/VirtualNetworkRuleImpl.java
index 6d46e5562c6a..31dddd7ea207 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/VirtualNetworkRuleImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/VirtualNetworkRuleImpl.java
@@ -5,7 +5,6 @@
package com.azure.resourcemanager.mysql.implementation;
import com.azure.core.util.Context;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.VirtualNetworkRuleInner;
import com.azure.resourcemanager.mysql.models.VirtualNetworkRule;
import com.azure.resourcemanager.mysql.models.VirtualNetworkRuleState;
@@ -14,7 +13,7 @@ public final class VirtualNetworkRuleImpl
implements VirtualNetworkRule, VirtualNetworkRule.Definition, VirtualNetworkRule.Update {
private VirtualNetworkRuleInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
public String id() {
return this.innerModel().id();
@@ -44,7 +43,7 @@ public VirtualNetworkRuleInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
@@ -78,7 +77,7 @@ public VirtualNetworkRule create(Context context) {
return this;
}
- VirtualNetworkRuleImpl(String name, MySqlManager serviceManager) {
+ VirtualNetworkRuleImpl(String name, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = new VirtualNetworkRuleInner();
this.serviceManager = serviceManager;
this.virtualNetworkRuleName = name;
@@ -106,7 +105,8 @@ public VirtualNetworkRule apply(Context context) {
return this;
}
- VirtualNetworkRuleImpl(VirtualNetworkRuleInner innerObject, MySqlManager serviceManager) {
+ VirtualNetworkRuleImpl(
+ VirtualNetworkRuleInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/VirtualNetworkRulesClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/VirtualNetworkRulesClientImpl.java
index 0b346129e469..4bef9ca333a1 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/VirtualNetworkRulesClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/VirtualNetworkRulesClientImpl.java
@@ -194,7 +194,7 @@ private Mono> getWithResponseAsync(
virtualNetworkRuleName,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -373,7 +373,7 @@ private Mono>> createOrUpdateWithResponseAsync(
parameters,
accept,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -693,7 +693,7 @@ private Mono>> deleteWithResponseAsync(
this.client.getSubscriptionId(),
apiVersion,
context))
- .subscriberContext(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext())));
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
@@ -951,7 +951,7 @@ private Mono> listByServerSinglePageAsync
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()));
}
/**
@@ -1110,7 +1110,7 @@ private Mono> listByServerNextSinglePageA
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/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/VirtualNetworkRulesImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/VirtualNetworkRulesImpl.java
index 870b4c64bbc5..046b7a20f774 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/VirtualNetworkRulesImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/VirtualNetworkRulesImpl.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.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.VirtualNetworkRulesClient;
import com.azure.resourcemanager.mysql.fluent.models.VirtualNetworkRuleInner;
import com.azure.resourcemanager.mysql.models.VirtualNetworkRule;
@@ -21,9 +20,10 @@ public final class VirtualNetworkRulesImpl implements VirtualNetworkRules {
private final VirtualNetworkRulesClient innerClient;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- public VirtualNetworkRulesImpl(VirtualNetworkRulesClient innerClient, MySqlManager serviceManager) {
+ public VirtualNetworkRulesImpl(
+ VirtualNetworkRulesClient innerClient, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerClient = innerClient;
this.serviceManager = serviceManager;
}
@@ -62,14 +62,14 @@ public void delete(String resourceGroupName, String serverName, String virtualNe
public PagedIterable listByServer(String resourceGroupName, String serverName) {
PagedIterable inner = this.serviceClient().listByServer(resourceGroupName, serverName);
- return inner.mapPage(inner1 -> new VirtualNetworkRuleImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new VirtualNetworkRuleImpl(inner1, this.manager()));
}
public PagedIterable listByServer(
String resourceGroupName, String serverName, Context context) {
PagedIterable inner =
this.serviceClient().listByServer(resourceGroupName, serverName, context);
- return inner.mapPage(inner1 -> new VirtualNetworkRuleImpl(inner1, this.manager()));
+ return Utils.mapPage(inner, inner1 -> new VirtualNetworkRuleImpl(inner1, this.manager()));
}
public VirtualNetworkRule getById(String id) {
@@ -188,7 +188,7 @@ private VirtualNetworkRulesClient serviceClient() {
return this.innerClient;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/WaitStatisticImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/WaitStatisticImpl.java
index 3e66a9e361fe..9e55828e0958 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/WaitStatisticImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/WaitStatisticImpl.java
@@ -4,7 +4,6 @@
package com.azure.resourcemanager.mysql.implementation;
-import com.azure.resourcemanager.mysql.MySqlManager;
import com.azure.resourcemanager.mysql.fluent.models.WaitStatisticInner;
import com.azure.resourcemanager.mysql.models.WaitStatistic;
import java.time.OffsetDateTime;
@@ -12,9 +11,9 @@
public final class WaitStatisticImpl implements WaitStatistic {
private WaitStatisticInner innerObject;
- private final MySqlManager serviceManager;
+ private final com.azure.resourcemanager.mysql.MySqlManager serviceManager;
- WaitStatisticImpl(WaitStatisticInner innerObject, MySqlManager serviceManager) {
+ WaitStatisticImpl(WaitStatisticInner innerObject, com.azure.resourcemanager.mysql.MySqlManager serviceManager) {
this.innerObject = innerObject;
this.serviceManager = serviceManager;
}
@@ -71,7 +70,7 @@ public WaitStatisticInner innerModel() {
return this.innerObject;
}
- private MySqlManager manager() {
+ private com.azure.resourcemanager.mysql.MySqlManager manager() {
return this.serviceManager;
}
}
diff --git a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/WaitStatisticsClientImpl.java b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/WaitStatisticsClientImpl.java
index 53efb85b163f..d2473a76971a 100644
--- a/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/WaitStatisticsClientImpl.java
+++ b/sdk/mysql/azure-resourcemanager-mysql/src/main/java/com/azure/resourcemanager/mysql/implementation/WaitStatisticsClientImpl.java
@@ -156,7 +156,7 @@ private Mono> getWithResponseAsync(
waitStatisticsId,
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