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/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRReplicasImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRReplicasImpl.java
new file mode 100644
index 000000000000..d67130303805
--- /dev/null
+++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRReplicasImpl.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.signalr.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.signalr.fluent.SignalRReplicasClient;
+import com.azure.resourcemanager.signalr.fluent.models.ReplicaInner;
+import com.azure.resourcemanager.signalr.models.Replica;
+import com.azure.resourcemanager.signalr.models.SignalRReplicas;
+
+public final class SignalRReplicasImpl implements SignalRReplicas {
+ private static final ClientLogger LOGGER = new ClientLogger(SignalRReplicasImpl.class);
+
+ private final SignalRReplicasClient innerClient;
+
+ private final com.azure.resourcemanager.signalr.SignalRManager serviceManager;
+
+ public SignalRReplicasImpl(
+ SignalRReplicasClient innerClient, com.azure.resourcemanager.signalr.SignalRManager 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, "signalR");
+ if (resourceName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'signalR'.", 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, "signalR");
+ if (resourceName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'signalR'.", 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, "signalR");
+ if (resourceName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'signalR'.", 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, "signalR");
+ if (resourceName == null) {
+ throw LOGGER
+ .logExceptionAsError(
+ new IllegalArgumentException(
+ String.format("The resource ID '%s' is not valid. Missing path segment 'signalR'.", 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 SignalRReplicasClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.signalr.SignalRManager manager() {
+ return this.serviceManager;
+ }
+
+ public ReplicaImpl define(String name) {
+ return new ReplicaImpl(name, this.manager());
+ }
+}
diff --git a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRSharedPrivateLinkResourcesClientImpl.java b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRSharedPrivateLinkResourcesClientImpl.java
index 7ca5e0b93aad..01dda9936c60 100644
--- a/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRSharedPrivateLinkResourcesClientImpl.java
+++ b/sdk/signalr/azure-resourcemanager-signalr/src/main/java/com/azure/resourcemanager/signalr/implementation/SignalRSharedPrivateLinkResourcesClientImpl.java
@@ -72,8 +72,7 @@ public final class SignalRSharedPrivateLinkResourcesClientImpl implements Signal
public interface SignalRSharedPrivateLinkResourcesService {
@Headers({"Content-Type: application/json"})
@Get(
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService"
- + "/signalR/{resourceName}/sharedPrivateLinkResources")
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> list(
@@ -87,8 +86,7 @@ Mono> list(
@Headers({"Content-Type: application/json"})
@Get(
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService"
- + "/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}")
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> get(
@@ -103,8 +101,7 @@ Mono> get(
@Headers({"Content-Type: application/json"})
@Put(
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService"
- + "/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}")
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}")
@ExpectedResponses({200, 201})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdate(
@@ -120,8 +117,7 @@ Mono>> createOrUpdate(
@Headers({"Content-Type: application/json"})
@Delete(
- "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService"
- + "/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}")
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{resourceName}/sharedPrivateLinkResources/{sharedPrivateLinkResourceName}")
@ExpectedResponses({200, 202, 204})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> delete(
@@ -148,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.
@@ -207,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.
@@ -264,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.
@@ -281,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.
@@ -301,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.
@@ -317,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.
@@ -336,8 +326,7 @@ public PagedIterable