restartAsync(
+ String resourceGroupName, String resourceName, String replicaName, Context context) {
+ return beginRestartAsync(resourceGroupName, resourceName, replicaName, context)
+ .last()
+ .flatMap(this.client::getLroFinalResultOrError);
+ }
+
+ /**
+ * Operation to restart a replica.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the resource.
+ * @param replicaName The name of the replica.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void restart(String resourceGroupName, String resourceName, String replicaName) {
+ restartAsync(resourceGroupName, resourceName, replicaName).block();
+ }
+
+ /**
+ * Operation to restart a replica.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param resourceName The name of the resource.
+ * @param replicaName The name of the replica.
+ * @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.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void restart(String resourceGroupName, String resourceName, String replicaName, Context context) {
+ restartAsync(resourceGroupName, resourceName, replicaName, context).block();
+ }
+
+ /**
+ * Get the next page of items.
+ *
+ * @param nextLink The URL to get the next list of items
+ * 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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(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.listNext(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 URL to get the next list of items
+ * 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 the response body along with {@link PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listNextSinglePageAsync(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
+ .listNext(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/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasImpl.java
new file mode 100644
index 000000000000..6dba7fb39ffe
--- /dev/null
+++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubReplicasImpl.java
@@ -0,0 +1,196 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.webpubsub.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.webpubsub.fluent.WebPubSubReplicasClient;
+import com.azure.resourcemanager.webpubsub.fluent.models.ReplicaInner;
+import com.azure.resourcemanager.webpubsub.models.Replica;
+import com.azure.resourcemanager.webpubsub.models.WebPubSubReplicas;
+
+public final class WebPubSubReplicasImpl implements WebPubSubReplicas {
+ private static final ClientLogger LOGGER = new ClientLogger(WebPubSubReplicasImpl.class);
+
+ private final WebPubSubReplicasClient innerClient;
+
+ private final com.azure.resourcemanager.webpubsub.WebPubSubManager serviceManager;
+
+ public WebPubSubReplicasImpl(
+ WebPubSubReplicasClient innerClient, com.azure.resourcemanager.webpubsub.WebPubSubManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable list(String resourceGroupName, String resourceName) {
+ PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName);
+ return Utils.mapPage(inner, inner1 -> new ReplicaImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable list(String resourceGroupName, String resourceName, Context context) {
+ PagedIterable inner = this.serviceClient().list(resourceGroupName, resourceName, context);
+ return Utils.mapPage(inner, inner1 -> new ReplicaImpl(inner1, this.manager()));
+ }
+
+ public Response getWithResponse(
+ String resourceGroupName, String resourceName, String replicaName, Context context) {
+ Response inner =
+ this.serviceClient().getWithResponse(resourceGroupName, resourceName, replicaName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new ReplicaImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public Replica get(String resourceGroupName, String resourceName, String replicaName) {
+ ReplicaInner inner = this.serviceClient().get(resourceGroupName, resourceName, replicaName);
+ if (inner != null) {
+ return new ReplicaImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response deleteWithResponse(
+ String resourceGroupName, String resourceName, String replicaName, Context context) {
+ return this.serviceClient().deleteWithResponse(resourceGroupName, resourceName, replicaName, context);
+ }
+
+ public void delete(String resourceGroupName, String resourceName, String replicaName) {
+ this.serviceClient().delete(resourceGroupName, resourceName, replicaName);
+ }
+
+ public void restart(String resourceGroupName, String resourceName, String replicaName) {
+ this.serviceClient().restart(resourceGroupName, resourceName, replicaName);
+ }
+
+ public void restart(String resourceGroupName, String resourceName, String replicaName, Context context) {
+ this.serviceClient().restart(resourceGroupName, resourceName, replicaName, context);
+ }
+
+ public Replica getById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String resourceName = Utils.getValueFromIdByName(id, "webPubSub");
+ if (resourceName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id)));
+ }
+ String replicaName = Utils.getValueFromIdByName(id, "replicas");
+ if (replicaName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, resourceName, replicaName, Context.NONE).getValue();
+ }
+
+ public Response getByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String resourceName = Utils.getValueFromIdByName(id, "webPubSub");
+ if (resourceName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id)));
+ }
+ String replicaName = Utils.getValueFromIdByName(id, "replicas");
+ if (replicaName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id)));
+ }
+ return this.getWithResponse(resourceGroupName, resourceName, replicaName, context);
+ }
+
+ public void deleteById(String id) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String resourceName = Utils.getValueFromIdByName(id, "webPubSub");
+ if (resourceName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id)));
+ }
+ String replicaName = Utils.getValueFromIdByName(id, "replicas");
+ if (replicaName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id)));
+ }
+ this.deleteWithResponse(resourceGroupName, resourceName, replicaName, Context.NONE);
+ }
+
+ public Response deleteByIdWithResponse(String id, Context context) {
+ String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups");
+ if (resourceGroupName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String
+ .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id)));
+ }
+ String resourceName = Utils.getValueFromIdByName(id, "webPubSub");
+ if (resourceName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'webPubSub'.", id)));
+ }
+ String replicaName = Utils.getValueFromIdByName(id, "replicas");
+ if (replicaName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'replicas'.", id)));
+ }
+ return this.deleteWithResponse(resourceGroupName, resourceName, replicaName, context);
+ }
+
+ private WebPubSubReplicasClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.webpubsub.WebPubSubManager manager() {
+ return this.serviceManager;
+ }
+
+ public ReplicaImpl define(String name) {
+ return new ReplicaImpl(name, this.manager());
+ }
+}
diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubResourceImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubResourceImpl.java
index c587d21c607d..9d423a93cb48 100644
--- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubResourceImpl.java
+++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubResourceImpl.java
@@ -18,6 +18,7 @@
import com.azure.resourcemanager.webpubsub.models.RegenerateKeyParameters;
import com.azure.resourcemanager.webpubsub.models.ResourceLogConfiguration;
import com.azure.resourcemanager.webpubsub.models.ResourceSku;
+import com.azure.resourcemanager.webpubsub.models.ServiceKind;
import com.azure.resourcemanager.webpubsub.models.SharedPrivateLinkResource;
import com.azure.resourcemanager.webpubsub.models.WebPubSubKeys;
import com.azure.resourcemanager.webpubsub.models.WebPubSubNetworkACLs;
@@ -63,6 +64,10 @@ public ResourceSku sku() {
return this.innerModel().sku();
}
+ public ServiceKind kind() {
+ return this.innerModel().kind();
+ }
+
public ManagedIdentity identity() {
return this.innerModel().identity();
}
@@ -302,6 +307,11 @@ public WebPubSubResourceImpl withSku(ResourceSku sku) {
return this;
}
+ public WebPubSubResourceImpl withKind(ServiceKind kind) {
+ this.innerModel().withKind(kind);
+ return this;
+ }
+
public WebPubSubResourceImpl withIdentity(ManagedIdentity identity) {
this.innerModel().withIdentity(identity);
return this;
diff --git a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java
index 3060051f276c..7ce399b986a8 100644
--- a/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java
+++ b/sdk/webpubsub/azure-resourcemanager-webpubsub/src/main/java/com/azure/resourcemanager/webpubsub/implementation/WebPubSubSharedPrivateLinkResourcesClientImpl.java
@@ -144,8 +144,7 @@ Mono> listNext(
/**
* List shared private link resources.
*
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
@@ -203,8 +202,7 @@ private Mono> listSinglePageAsync(
/**
* List shared private link resources.
*
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -260,8 +258,7 @@ private Mono> listSinglePageAsync(
/**
* List shared private link resources.
*
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
@@ -277,8 +274,7 @@ private PagedFlux listAsync(String resourceGroup
/**
* List shared private link resources.
*
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -297,8 +293,7 @@ private PagedFlux listAsync(
/**
* List shared private link resources.
*
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
@@ -313,8 +308,7 @@ public PagedIterable list(String resourceGroupNa
/**
* List shared private link resources.
*
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -332,8 +326,7 @@ public PagedIterable list(
* Get the specified shared private link resource.
*
* @param sharedPrivateLinkResourceName The name of the shared private link resource.
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
@@ -390,8 +383,7 @@ private Mono> getWithResponseAsync(
* Get the specified shared private link resource.
*
* @param sharedPrivateLinkResourceName The name of the shared private link resource.
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -446,8 +438,7 @@ private Mono> getWithResponseAsync(
* Get the specified shared private link resource.
*
* @param sharedPrivateLinkResourceName The name of the shared private link resource.
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
@@ -465,8 +456,7 @@ private Mono getAsync(
* Get the specified shared private link resource.
*
* @param sharedPrivateLinkResourceName The name of the shared private link resource.
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -484,8 +474,7 @@ public Response getWithResponse(
* Get the specified shared private link resource.
*
* @param sharedPrivateLinkResourceName The name of the shared private link resource.
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
@@ -502,8 +491,7 @@ public SharedPrivateLinkResourceInner get(
* Create or update a shared private link resource.
*
* @param sharedPrivateLinkResourceName The name of the shared private link resource.
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param parameters The shared private link resource.
* @throws IllegalArgumentException thrown if parameters fail the validation.
@@ -570,8 +558,7 @@ private Mono>> createOrUpdateWithResponseAsync(
* Create or update a shared private link resource.
*
* @param sharedPrivateLinkResourceName The name of the shared private link resource.
- * @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value
- * from the Azure Resource Manager API or the portal.
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param resourceName The name of the resource.
* @param parameters The shared private link resource.
* @param context The context to associate with this operation.
@@ -637,8 +624,7 @@ private Mono