updateByHostPoolWithResponse(
+ String resourceGroupName,
+ String hostPoolName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnection connection,
+ Context context) {
+ return updateByHostPoolWithResponseAsync(
+ resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, context)
+ .block();
+ }
+
+ /**
+ * Approve or reject a private endpoint connection.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param hostPoolName The name of the host pool within the specified resource group.
+ * @param privateEndpointConnectionName The name of the private endpoint connection associated with the Azure
+ * resource.
+ * @param connection Object containing the updated connection.
+ * @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 Private Endpoint Connection resource.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public PrivateEndpointConnectionWithSystemDataInner updateByHostPool(
+ String resourceGroupName,
+ String hostPoolName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnection connection) {
+ return updateByHostPoolWithResponse(
+ resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, Context.NONE)
+ .getValue();
+ }
+
+ /**
+ * 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 list of private endpoint connection associated with the specified storage account along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByWorkspaceNextSinglePageAsync(
+ 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.listByWorkspaceNext(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 list of private endpoint connection associated with the specified storage account along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByWorkspaceNextSinglePageAsync(
+ 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
+ .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * 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 list of private endpoint connection associated with the specified storage account along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByHostPoolNextSinglePageAsync(
+ 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.listByHostPoolNext(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 list of private endpoint connection associated with the specified storage account along with {@link
+ * PagedResponse} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByHostPoolNextSinglePageAsync(
+ 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
+ .listByHostPoolNext(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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java
new file mode 100644
index 000000000000..9c1e1c9a0ca7
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateEndpointConnectionsImpl.java
@@ -0,0 +1,229 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.desktopvirtualization.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.desktopvirtualization.fluent.PrivateEndpointConnectionsClient;
+import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateEndpointConnectionWithSystemDataInner;
+import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnection;
+import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnectionWithSystemData;
+import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnections;
+
+public final class PrivateEndpointConnectionsImpl implements PrivateEndpointConnections {
+ private static final ClientLogger LOGGER = new ClientLogger(PrivateEndpointConnectionsImpl.class);
+
+ private final PrivateEndpointConnectionsClient innerClient;
+
+ private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager;
+
+ public PrivateEndpointConnectionsImpl(
+ PrivateEndpointConnectionsClient innerClient,
+ com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listByWorkspace(
+ String resourceGroupName, String workspaceName) {
+ PagedIterable inner =
+ this.serviceClient().listByWorkspace(resourceGroupName, workspaceName);
+ return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByWorkspace(
+ String resourceGroupName, String workspaceName, Context context) {
+ PagedIterable inner =
+ this.serviceClient().listByWorkspace(resourceGroupName, workspaceName, context);
+ return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager()));
+ }
+
+ public Response getByWorkspaceWithResponse(
+ String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) {
+ Response inner =
+ this
+ .serviceClient()
+ .getByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public PrivateEndpointConnectionWithSystemData getByWorkspace(
+ String resourceGroupName, String workspaceName, String privateEndpointConnectionName) {
+ PrivateEndpointConnectionWithSystemDataInner inner =
+ this.serviceClient().getByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName);
+ if (inner != null) {
+ return new PrivateEndpointConnectionWithSystemDataImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response deleteByWorkspaceWithResponse(
+ String resourceGroupName, String workspaceName, String privateEndpointConnectionName, Context context) {
+ return this
+ .serviceClient()
+ .deleteByWorkspaceWithResponse(resourceGroupName, workspaceName, privateEndpointConnectionName, context);
+ }
+
+ public void deleteByWorkspace(
+ String resourceGroupName, String workspaceName, String privateEndpointConnectionName) {
+ this.serviceClient().deleteByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName);
+ }
+
+ public Response updateByWorkspaceWithResponse(
+ String resourceGroupName,
+ String workspaceName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnection connection,
+ Context context) {
+ Response inner =
+ this
+ .serviceClient()
+ .updateByWorkspaceWithResponse(
+ resourceGroupName, workspaceName, privateEndpointConnectionName, connection, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public PrivateEndpointConnectionWithSystemData updateByWorkspace(
+ String resourceGroupName,
+ String workspaceName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnection connection) {
+ PrivateEndpointConnectionWithSystemDataInner inner =
+ this
+ .serviceClient()
+ .updateByWorkspace(resourceGroupName, workspaceName, privateEndpointConnectionName, connection);
+ if (inner != null) {
+ return new PrivateEndpointConnectionWithSystemDataImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public PagedIterable listByHostPool(
+ String resourceGroupName, String hostPoolName) {
+ PagedIterable inner =
+ this.serviceClient().listByHostPool(resourceGroupName, hostPoolName);
+ return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByHostPool(
+ String resourceGroupName,
+ String hostPoolName,
+ Integer pageSize,
+ Boolean isDescending,
+ Integer initialSkip,
+ Context context) {
+ PagedIterable inner =
+ this
+ .serviceClient()
+ .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context);
+ return Utils.mapPage(inner, inner1 -> new PrivateEndpointConnectionWithSystemDataImpl(inner1, this.manager()));
+ }
+
+ public Response getByHostPoolWithResponse(
+ String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context) {
+ Response inner =
+ this
+ .serviceClient()
+ .getByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public PrivateEndpointConnectionWithSystemData getByHostPool(
+ String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) {
+ PrivateEndpointConnectionWithSystemDataInner inner =
+ this.serviceClient().getByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName);
+ if (inner != null) {
+ return new PrivateEndpointConnectionWithSystemDataImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ public Response deleteByHostPoolWithResponse(
+ String resourceGroupName, String hostPoolName, String privateEndpointConnectionName, Context context) {
+ return this
+ .serviceClient()
+ .deleteByHostPoolWithResponse(resourceGroupName, hostPoolName, privateEndpointConnectionName, context);
+ }
+
+ public void deleteByHostPool(String resourceGroupName, String hostPoolName, String privateEndpointConnectionName) {
+ this.serviceClient().deleteByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName);
+ }
+
+ public Response updateByHostPoolWithResponse(
+ String resourceGroupName,
+ String hostPoolName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnection connection,
+ Context context) {
+ Response inner =
+ this
+ .serviceClient()
+ .updateByHostPoolWithResponse(
+ resourceGroupName, hostPoolName, privateEndpointConnectionName, connection, context);
+ if (inner != null) {
+ return new SimpleResponse<>(
+ inner.getRequest(),
+ inner.getStatusCode(),
+ inner.getHeaders(),
+ new PrivateEndpointConnectionWithSystemDataImpl(inner.getValue(), this.manager()));
+ } else {
+ return null;
+ }
+ }
+
+ public PrivateEndpointConnectionWithSystemData updateByHostPool(
+ String resourceGroupName,
+ String hostPoolName,
+ String privateEndpointConnectionName,
+ PrivateEndpointConnection connection) {
+ PrivateEndpointConnectionWithSystemDataInner inner =
+ this
+ .serviceClient()
+ .updateByHostPool(resourceGroupName, hostPoolName, privateEndpointConnectionName, connection);
+ if (inner != null) {
+ return new PrivateEndpointConnectionWithSystemDataImpl(inner, this.manager());
+ } else {
+ return null;
+ }
+ }
+
+ private PrivateEndpointConnectionsClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourceImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourceImpl.java
new file mode 100644
index 000000000000..5719a5128e9e
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourceImpl.java
@@ -0,0 +1,65 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.desktopvirtualization.implementation;
+
+import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner;
+import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResource;
+import java.util.Collections;
+import java.util.List;
+
+public final class PrivateLinkResourceImpl implements PrivateLinkResource {
+ private PrivateLinkResourceInner innerObject;
+
+ private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager;
+
+ PrivateLinkResourceImpl(
+ PrivateLinkResourceInner innerObject,
+ com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ }
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public String groupId() {
+ return this.innerModel().groupId();
+ }
+
+ public List requiredMembers() {
+ List inner = this.innerModel().requiredMembers();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public List requiredZoneNames() {
+ List inner = this.innerModel().requiredZoneNames();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public PrivateLinkResourceInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesClientImpl.java
new file mode 100644
index 000000000000..7900ce2c695b
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesClientImpl.java
@@ -0,0 +1,758 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.desktopvirtualization.implementation;
+
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+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;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.desktopvirtualization.fluent.PrivateLinkResourcesClient;
+import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner;
+import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResourceListResult;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in PrivateLinkResourcesClient. */
+public final class PrivateLinkResourcesClientImpl implements PrivateLinkResourcesClient {
+ /** The proxy service used to perform REST calls. */
+ private final PrivateLinkResourcesService service;
+
+ /** The service client containing this operation class. */
+ private final DesktopVirtualizationApiClientImpl client;
+
+ /**
+ * Initializes an instance of PrivateLinkResourcesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ PrivateLinkResourcesClientImpl(DesktopVirtualizationApiClientImpl client) {
+ this.service =
+ RestProxy
+ .create(PrivateLinkResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DesktopVirtualizationApiClientPrivateLinkResources to be used by the
+ * proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "DesktopVirtualizatio")
+ public interface PrivateLinkResourcesService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/workspaces/{workspaceName}/privateLinkResources")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByWorkspace(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("workspaceName") String workspaceName,
+ @QueryParam("pageSize") Integer pageSize,
+ @QueryParam("isDescending") Boolean isDescending,
+ @QueryParam("initialSkip") Integer initialSkip,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/privateLinkResources")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByHostPool(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("hostPoolName") String hostPoolName,
+ @QueryParam("pageSize") Integer pageSize,
+ @QueryParam("isDescending") Boolean isDescending,
+ @QueryParam("initialSkip") Integer initialSkip,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByWorkspaceNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listByHostPoolNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * List the private link resources available for this workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param workspaceName The name of the workspace.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByWorkspaceSinglePageAsync(
+ String resourceGroupName, String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByWorkspace(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ workspaceName,
+ pageSize,
+ isDescending,
+ initialSkip,
+ 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()));
+ }
+
+ /**
+ * List the private link resources available for this workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param workspaceName The name of the workspace.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByWorkspaceSinglePageAsync(
+ String resourceGroupName,
+ String workspaceName,
+ Integer pageSize,
+ Boolean isDescending,
+ Integer initialSkip,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (workspaceName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter workspaceName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByWorkspace(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ workspaceName,
+ pageSize,
+ isDescending,
+ initialSkip,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List the private link resources available for this workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param workspaceName The name of the workspace.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 private link resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByWorkspaceAsync(
+ String resourceGroupName, String workspaceName, Integer pageSize, Boolean isDescending, Integer initialSkip) {
+ return new PagedFlux<>(
+ () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip),
+ nextLink -> listByWorkspaceNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the private link resources available for this workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param workspaceName The name of the workspace.
+ * @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 private link resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByWorkspaceAsync(String resourceGroupName, String workspaceName) {
+ final Integer pageSize = null;
+ final Boolean isDescending = null;
+ final Integer initialSkip = null;
+ return new PagedFlux<>(
+ () -> listByWorkspaceSinglePageAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip),
+ nextLink -> listByWorkspaceNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the private link resources available for this workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param workspaceName The name of the workspace.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 private link resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByWorkspaceAsync(
+ String resourceGroupName,
+ String workspaceName,
+ Integer pageSize,
+ Boolean isDescending,
+ Integer initialSkip,
+ Context context) {
+ return new PagedFlux<>(
+ () ->
+ listByWorkspaceSinglePageAsync(
+ resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, context),
+ nextLink -> listByWorkspaceNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List the private link resources available for this workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param workspaceName The name of the workspace.
+ * @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 private link resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) {
+ final Integer pageSize = null;
+ final Boolean isDescending = null;
+ final Integer initialSkip = null;
+ return new PagedIterable<>(
+ listByWorkspaceAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip));
+ }
+
+ /**
+ * List the private link resources available for this workspace.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param workspaceName The name of the workspace.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 private link resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByWorkspace(
+ String resourceGroupName,
+ String workspaceName,
+ Integer pageSize,
+ Boolean isDescending,
+ Integer initialSkip,
+ Context context) {
+ return new PagedIterable<>(
+ listByWorkspaceAsync(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, context));
+ }
+
+ /**
+ * List the private link resources available for this hostpool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param hostPoolName The name of the host pool within the specified resource group.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByHostPoolSinglePageAsync(
+ String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (hostPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .listByHostPool(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ hostPoolName,
+ pageSize,
+ isDescending,
+ initialSkip,
+ 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()));
+ }
+
+ /**
+ * List the private link resources available for this hostpool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param hostPoolName The name of the host pool within the specified resource group.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByHostPoolSinglePageAsync(
+ String resourceGroupName,
+ String hostPoolName,
+ Integer pageSize,
+ Boolean isDescending,
+ Integer initialSkip,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (hostPoolName == null) {
+ return Mono.error(new IllegalArgumentException("Parameter hostPoolName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .listByHostPool(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ hostPoolName,
+ pageSize,
+ isDescending,
+ initialSkip,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List the private link resources available for this hostpool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param hostPoolName The name of the host pool within the specified resource group.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 private link resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByHostPoolAsync(
+ String resourceGroupName, String hostPoolName, Integer pageSize, Boolean isDescending, Integer initialSkip) {
+ return new PagedFlux<>(
+ () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip),
+ nextLink -> listByHostPoolNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the private link resources available for this hostpool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param hostPoolName The name of the host pool within the specified resource group.
+ * @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 private link resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listByHostPoolAsync(String resourceGroupName, String hostPoolName) {
+ final Integer pageSize = null;
+ final Boolean isDescending = null;
+ final Integer initialSkip = null;
+ return new PagedFlux<>(
+ () -> listByHostPoolSinglePageAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip),
+ nextLink -> listByHostPoolNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List the private link resources available for this hostpool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param hostPoolName The name of the host pool within the specified resource group.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 private link resources as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listByHostPoolAsync(
+ String resourceGroupName,
+ String hostPoolName,
+ Integer pageSize,
+ Boolean isDescending,
+ Integer initialSkip,
+ Context context) {
+ return new PagedFlux<>(
+ () ->
+ listByHostPoolSinglePageAsync(
+ resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context),
+ nextLink -> listByHostPoolNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List the private link resources available for this hostpool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param hostPoolName The name of the host pool within the specified resource group.
+ * @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 private link resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) {
+ final Integer pageSize = null;
+ final Boolean isDescending = null;
+ final Integer initialSkip = null;
+ return new PagedIterable<>(
+ listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip));
+ }
+
+ /**
+ * List the private link resources available for this hostpool.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param hostPoolName The name of the host pool within the specified resource group.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 private link resources as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable listByHostPool(
+ String resourceGroupName,
+ String hostPoolName,
+ Integer pageSize,
+ Boolean isDescending,
+ Integer initialSkip,
+ Context context) {
+ return new PagedIterable<>(
+ listByHostPoolAsync(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context));
+ }
+
+ /**
+ * 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 a list of private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByWorkspaceNextSinglePageAsync(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.listByWorkspaceNext(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 a list of private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByWorkspaceNextSinglePageAsync(
+ 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
+ .listByWorkspaceNext(nextLink, this.client.getEndpoint(), accept, context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * 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 a list of private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByHostPoolNextSinglePageAsync(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.listByHostPoolNext(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 a list of private link resources along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listByHostPoolNextSinglePageAsync(
+ 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
+ .listByHostPoolNext(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/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesImpl.java
new file mode 100644
index 000000000000..bf1f3ace3c3a
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/PrivateLinkResourcesImpl.java
@@ -0,0 +1,76 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.desktopvirtualization.implementation;
+
+import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.util.Context;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.resourcemanager.desktopvirtualization.fluent.PrivateLinkResourcesClient;
+import com.azure.resourcemanager.desktopvirtualization.fluent.models.PrivateLinkResourceInner;
+import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResource;
+import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResources;
+
+public final class PrivateLinkResourcesImpl implements PrivateLinkResources {
+ private static final ClientLogger LOGGER = new ClientLogger(PrivateLinkResourcesImpl.class);
+
+ private final PrivateLinkResourcesClient innerClient;
+
+ private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager;
+
+ public PrivateLinkResourcesImpl(
+ PrivateLinkResourcesClient innerClient,
+ com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) {
+ this.innerClient = innerClient;
+ this.serviceManager = serviceManager;
+ }
+
+ public PagedIterable listByWorkspace(String resourceGroupName, String workspaceName) {
+ PagedIterable inner =
+ this.serviceClient().listByWorkspace(resourceGroupName, workspaceName);
+ return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByWorkspace(
+ String resourceGroupName,
+ String workspaceName,
+ Integer pageSize,
+ Boolean isDescending,
+ Integer initialSkip,
+ Context context) {
+ PagedIterable inner =
+ this
+ .serviceClient()
+ .listByWorkspace(resourceGroupName, workspaceName, pageSize, isDescending, initialSkip, context);
+ return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByHostPool(String resourceGroupName, String hostPoolName) {
+ PagedIterable inner =
+ this.serviceClient().listByHostPool(resourceGroupName, hostPoolName);
+ return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager()));
+ }
+
+ public PagedIterable listByHostPool(
+ String resourceGroupName,
+ String hostPoolName,
+ Integer pageSize,
+ Boolean isDescending,
+ Integer initialSkip,
+ Context context) {
+ PagedIterable inner =
+ this
+ .serviceClient()
+ .listByHostPool(resourceGroupName, hostPoolName, pageSize, isDescending, initialSkip, context);
+ return Utils.mapPage(inner, inner1 -> new PrivateLinkResourceImpl(inner1, this.manager()));
+ }
+
+ private PrivateLinkResourcesClient serviceClient() {
+ return this.innerClient;
+ }
+
+ private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() {
+ return this.serviceManager;
+ }
+}
diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalScheduleImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalScheduleImpl.java
new file mode 100644
index 000000000000..61281fff0eeb
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalScheduleImpl.java
@@ -0,0 +1,536 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.desktopvirtualization.implementation;
+
+import com.azure.core.management.SystemData;
+import com.azure.core.util.Context;
+import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleInner;
+import com.azure.resourcemanager.desktopvirtualization.models.DayOfWeek;
+import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedule;
+import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatch;
+import com.azure.resourcemanager.desktopvirtualization.models.SessionHandlingOperation;
+import com.azure.resourcemanager.desktopvirtualization.models.SetStartVMOnConnect;
+import com.azure.resourcemanager.desktopvirtualization.models.StartupBehavior;
+import com.azure.resourcemanager.desktopvirtualization.models.Time;
+import java.util.Collections;
+import java.util.List;
+
+public final class ScalingPlanPersonalScheduleImpl
+ implements ScalingPlanPersonalSchedule, ScalingPlanPersonalSchedule.Definition, ScalingPlanPersonalSchedule.Update {
+ private ScalingPlanPersonalScheduleInner innerObject;
+
+ private final com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager;
+
+ public String id() {
+ return this.innerModel().id();
+ }
+
+ public String name() {
+ return this.innerModel().name();
+ }
+
+ public String type() {
+ return this.innerModel().type();
+ }
+
+ public SystemData systemData() {
+ return this.innerModel().systemData();
+ }
+
+ public List daysOfWeek() {
+ List inner = this.innerModel().daysOfWeek();
+ if (inner != null) {
+ return Collections.unmodifiableList(inner);
+ } else {
+ return Collections.emptyList();
+ }
+ }
+
+ public Time rampUpStartTime() {
+ return this.innerModel().rampUpStartTime();
+ }
+
+ public StartupBehavior rampUpAutoStartHosts() {
+ return this.innerModel().rampUpAutoStartHosts();
+ }
+
+ public SetStartVMOnConnect rampUpStartVMOnConnect() {
+ return this.innerModel().rampUpStartVMOnConnect();
+ }
+
+ public SessionHandlingOperation rampUpActionOnDisconnect() {
+ return this.innerModel().rampUpActionOnDisconnect();
+ }
+
+ public Integer rampUpMinutesToWaitOnDisconnect() {
+ return this.innerModel().rampUpMinutesToWaitOnDisconnect();
+ }
+
+ public SessionHandlingOperation rampUpActionOnLogoff() {
+ return this.innerModel().rampUpActionOnLogoff();
+ }
+
+ public Integer rampUpMinutesToWaitOnLogoff() {
+ return this.innerModel().rampUpMinutesToWaitOnLogoff();
+ }
+
+ public Time peakStartTime() {
+ return this.innerModel().peakStartTime();
+ }
+
+ public SetStartVMOnConnect peakStartVMOnConnect() {
+ return this.innerModel().peakStartVMOnConnect();
+ }
+
+ public SessionHandlingOperation peakActionOnDisconnect() {
+ return this.innerModel().peakActionOnDisconnect();
+ }
+
+ public Integer peakMinutesToWaitOnDisconnect() {
+ return this.innerModel().peakMinutesToWaitOnDisconnect();
+ }
+
+ public SessionHandlingOperation peakActionOnLogoff() {
+ return this.innerModel().peakActionOnLogoff();
+ }
+
+ public Integer peakMinutesToWaitOnLogoff() {
+ return this.innerModel().peakMinutesToWaitOnLogoff();
+ }
+
+ public Time rampDownStartTime() {
+ return this.innerModel().rampDownStartTime();
+ }
+
+ public SetStartVMOnConnect rampDownStartVMOnConnect() {
+ return this.innerModel().rampDownStartVMOnConnect();
+ }
+
+ public SessionHandlingOperation rampDownActionOnDisconnect() {
+ return this.innerModel().rampDownActionOnDisconnect();
+ }
+
+ public Integer rampDownMinutesToWaitOnDisconnect() {
+ return this.innerModel().rampDownMinutesToWaitOnDisconnect();
+ }
+
+ public SessionHandlingOperation rampDownActionOnLogoff() {
+ return this.innerModel().rampDownActionOnLogoff();
+ }
+
+ public Integer rampDownMinutesToWaitOnLogoff() {
+ return this.innerModel().rampDownMinutesToWaitOnLogoff();
+ }
+
+ public Time offPeakStartTime() {
+ return this.innerModel().offPeakStartTime();
+ }
+
+ public SetStartVMOnConnect offPeakStartVMOnConnect() {
+ return this.innerModel().offPeakStartVMOnConnect();
+ }
+
+ public SessionHandlingOperation offPeakActionOnDisconnect() {
+ return this.innerModel().offPeakActionOnDisconnect();
+ }
+
+ public Integer offPeakMinutesToWaitOnDisconnect() {
+ return this.innerModel().offPeakMinutesToWaitOnDisconnect();
+ }
+
+ public SessionHandlingOperation offPeakActionOnLogoff() {
+ return this.innerModel().offPeakActionOnLogoff();
+ }
+
+ public Integer offPeakMinutesToWaitOnLogoff() {
+ return this.innerModel().offPeakMinutesToWaitOnLogoff();
+ }
+
+ public String resourceGroupName() {
+ return resourceGroupName;
+ }
+
+ public ScalingPlanPersonalScheduleInner innerModel() {
+ return this.innerObject;
+ }
+
+ private com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager manager() {
+ return this.serviceManager;
+ }
+
+ private String resourceGroupName;
+
+ private String scalingPlanName;
+
+ private String scalingPlanScheduleName;
+
+ private ScalingPlanPersonalSchedulePatch updateScalingPlanSchedule;
+
+ public ScalingPlanPersonalScheduleImpl withExistingScalingPlan(String resourceGroupName, String scalingPlanName) {
+ this.resourceGroupName = resourceGroupName;
+ this.scalingPlanName = scalingPlanName;
+ return this;
+ }
+
+ public ScalingPlanPersonalSchedule create() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getScalingPlanPersonalSchedules()
+ .createWithResponse(
+ resourceGroupName, scalingPlanName, scalingPlanScheduleName, this.innerModel(), Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public ScalingPlanPersonalSchedule create(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getScalingPlanPersonalSchedules()
+ .createWithResponse(
+ resourceGroupName, scalingPlanName, scalingPlanScheduleName, this.innerModel(), context)
+ .getValue();
+ return this;
+ }
+
+ ScalingPlanPersonalScheduleImpl(
+ String name, com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) {
+ this.innerObject = new ScalingPlanPersonalScheduleInner();
+ this.serviceManager = serviceManager;
+ this.scalingPlanScheduleName = name;
+ }
+
+ public ScalingPlanPersonalScheduleImpl update() {
+ this.updateScalingPlanSchedule = new ScalingPlanPersonalSchedulePatch();
+ return this;
+ }
+
+ public ScalingPlanPersonalSchedule apply() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getScalingPlanPersonalSchedules()
+ .updateWithResponse(
+ resourceGroupName,
+ scalingPlanName,
+ scalingPlanScheduleName,
+ updateScalingPlanSchedule,
+ Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public ScalingPlanPersonalSchedule apply(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getScalingPlanPersonalSchedules()
+ .updateWithResponse(
+ resourceGroupName, scalingPlanName, scalingPlanScheduleName, updateScalingPlanSchedule, context)
+ .getValue();
+ return this;
+ }
+
+ ScalingPlanPersonalScheduleImpl(
+ ScalingPlanPersonalScheduleInner innerObject,
+ com.azure.resourcemanager.desktopvirtualization.DesktopVirtualizationManager serviceManager) {
+ this.innerObject = innerObject;
+ this.serviceManager = serviceManager;
+ this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups");
+ this.scalingPlanName = Utils.getValueFromIdByName(innerObject.id(), "scalingPlans");
+ this.scalingPlanScheduleName = Utils.getValueFromIdByName(innerObject.id(), "personalSchedules");
+ }
+
+ public ScalingPlanPersonalSchedule refresh() {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getScalingPlanPersonalSchedules()
+ .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE)
+ .getValue();
+ return this;
+ }
+
+ public ScalingPlanPersonalSchedule refresh(Context context) {
+ this.innerObject =
+ serviceManager
+ .serviceClient()
+ .getScalingPlanPersonalSchedules()
+ .getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context)
+ .getValue();
+ return this;
+ }
+
+ public ScalingPlanPersonalScheduleImpl withDaysOfWeek(List daysOfWeek) {
+ if (isInCreateMode()) {
+ this.innerModel().withDaysOfWeek(daysOfWeek);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withDaysOfWeek(daysOfWeek);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampUpStartTime(Time rampUpStartTime) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampUpStartTime(rampUpStartTime);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampUpStartTime(rampUpStartTime);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampUpAutoStartHosts(StartupBehavior rampUpAutoStartHosts) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampUpAutoStartHosts(rampUpAutoStartHosts);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampUpAutoStartHosts(rampUpAutoStartHosts);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampUpStartVMOnConnect(SetStartVMOnConnect rampUpStartVMOnConnect) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampUpStartVMOnConnect(rampUpStartVMOnConnect);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampUpStartVMOnConnect(rampUpStartVMOnConnect);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampUpActionOnDisconnect(
+ SessionHandlingOperation rampUpActionOnDisconnect) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampUpActionOnDisconnect(rampUpActionOnDisconnect);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampUpActionOnDisconnect(rampUpActionOnDisconnect);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampUpMinutesToWaitOnDisconnect(
+ Integer rampUpMinutesToWaitOnDisconnect) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampUpMinutesToWaitOnDisconnect(rampUpMinutesToWaitOnDisconnect);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampUpMinutesToWaitOnDisconnect(rampUpMinutesToWaitOnDisconnect);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampUpActionOnLogoff(SessionHandlingOperation rampUpActionOnLogoff) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampUpActionOnLogoff(rampUpActionOnLogoff);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampUpActionOnLogoff(rampUpActionOnLogoff);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampUpMinutesToWaitOnLogoff(Integer rampUpMinutesToWaitOnLogoff) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampUpMinutesToWaitOnLogoff(rampUpMinutesToWaitOnLogoff);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampUpMinutesToWaitOnLogoff(rampUpMinutesToWaitOnLogoff);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withPeakStartTime(Time peakStartTime) {
+ if (isInCreateMode()) {
+ this.innerModel().withPeakStartTime(peakStartTime);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withPeakStartTime(peakStartTime);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withPeakStartVMOnConnect(SetStartVMOnConnect peakStartVMOnConnect) {
+ if (isInCreateMode()) {
+ this.innerModel().withPeakStartVMOnConnect(peakStartVMOnConnect);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withPeakStartVMOnConnect(peakStartVMOnConnect);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withPeakActionOnDisconnect(SessionHandlingOperation peakActionOnDisconnect) {
+ if (isInCreateMode()) {
+ this.innerModel().withPeakActionOnDisconnect(peakActionOnDisconnect);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withPeakActionOnDisconnect(peakActionOnDisconnect);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withPeakMinutesToWaitOnDisconnect(Integer peakMinutesToWaitOnDisconnect) {
+ if (isInCreateMode()) {
+ this.innerModel().withPeakMinutesToWaitOnDisconnect(peakMinutesToWaitOnDisconnect);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withPeakMinutesToWaitOnDisconnect(peakMinutesToWaitOnDisconnect);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withPeakActionOnLogoff(SessionHandlingOperation peakActionOnLogoff) {
+ if (isInCreateMode()) {
+ this.innerModel().withPeakActionOnLogoff(peakActionOnLogoff);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withPeakActionOnLogoff(peakActionOnLogoff);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withPeakMinutesToWaitOnLogoff(Integer peakMinutesToWaitOnLogoff) {
+ if (isInCreateMode()) {
+ this.innerModel().withPeakMinutesToWaitOnLogoff(peakMinutesToWaitOnLogoff);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withPeakMinutesToWaitOnLogoff(peakMinutesToWaitOnLogoff);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampDownStartTime(Time rampDownStartTime) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampDownStartTime(rampDownStartTime);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampDownStartTime(rampDownStartTime);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampDownStartVMOnConnect(SetStartVMOnConnect rampDownStartVMOnConnect) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampDownStartVMOnConnect(rampDownStartVMOnConnect);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampDownStartVMOnConnect(rampDownStartVMOnConnect);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampDownActionOnDisconnect(
+ SessionHandlingOperation rampDownActionOnDisconnect) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampDownActionOnDisconnect(rampDownActionOnDisconnect);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampDownActionOnDisconnect(rampDownActionOnDisconnect);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampDownMinutesToWaitOnDisconnect(
+ Integer rampDownMinutesToWaitOnDisconnect) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampDownMinutesToWaitOnDisconnect(rampDownMinutesToWaitOnDisconnect);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampDownMinutesToWaitOnDisconnect(rampDownMinutesToWaitOnDisconnect);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampDownActionOnLogoff(SessionHandlingOperation rampDownActionOnLogoff) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampDownActionOnLogoff(rampDownActionOnLogoff);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampDownActionOnLogoff(rampDownActionOnLogoff);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withRampDownMinutesToWaitOnLogoff(Integer rampDownMinutesToWaitOnLogoff) {
+ if (isInCreateMode()) {
+ this.innerModel().withRampDownMinutesToWaitOnLogoff(rampDownMinutesToWaitOnLogoff);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withRampDownMinutesToWaitOnLogoff(rampDownMinutesToWaitOnLogoff);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withOffPeakStartTime(Time offPeakStartTime) {
+ if (isInCreateMode()) {
+ this.innerModel().withOffPeakStartTime(offPeakStartTime);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withOffPeakStartTime(offPeakStartTime);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withOffPeakStartVMOnConnect(SetStartVMOnConnect offPeakStartVMOnConnect) {
+ if (isInCreateMode()) {
+ this.innerModel().withOffPeakStartVMOnConnect(offPeakStartVMOnConnect);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withOffPeakStartVMOnConnect(offPeakStartVMOnConnect);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withOffPeakActionOnDisconnect(
+ SessionHandlingOperation offPeakActionOnDisconnect) {
+ if (isInCreateMode()) {
+ this.innerModel().withOffPeakActionOnDisconnect(offPeakActionOnDisconnect);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withOffPeakActionOnDisconnect(offPeakActionOnDisconnect);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withOffPeakMinutesToWaitOnDisconnect(
+ Integer offPeakMinutesToWaitOnDisconnect) {
+ if (isInCreateMode()) {
+ this.innerModel().withOffPeakMinutesToWaitOnDisconnect(offPeakMinutesToWaitOnDisconnect);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withOffPeakMinutesToWaitOnDisconnect(offPeakMinutesToWaitOnDisconnect);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withOffPeakActionOnLogoff(SessionHandlingOperation offPeakActionOnLogoff) {
+ if (isInCreateMode()) {
+ this.innerModel().withOffPeakActionOnLogoff(offPeakActionOnLogoff);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withOffPeakActionOnLogoff(offPeakActionOnLogoff);
+ return this;
+ }
+ }
+
+ public ScalingPlanPersonalScheduleImpl withOffPeakMinutesToWaitOnLogoff(Integer offPeakMinutesToWaitOnLogoff) {
+ if (isInCreateMode()) {
+ this.innerModel().withOffPeakMinutesToWaitOnLogoff(offPeakMinutesToWaitOnLogoff);
+ return this;
+ } else {
+ this.updateScalingPlanSchedule.withOffPeakMinutesToWaitOnLogoff(offPeakMinutesToWaitOnLogoff);
+ return this;
+ }
+ }
+
+ private boolean isInCreateMode() {
+ return this.innerModel().id() == null;
+ }
+}
diff --git a/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesClientImpl.java b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesClientImpl.java
new file mode 100644
index 000000000000..9003c60dcb0e
--- /dev/null
+++ b/sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/implementation/ScalingPlanPersonalSchedulesClientImpl.java
@@ -0,0 +1,1197 @@
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License.
+// Code generated by Microsoft (R) AutoRest Code Generator.
+
+package com.azure.resourcemanager.desktopvirtualization.implementation;
+
+import com.azure.core.annotation.BodyParam;
+import com.azure.core.annotation.Delete;
+import com.azure.core.annotation.ExpectedResponses;
+import com.azure.core.annotation.Get;
+import com.azure.core.annotation.HeaderParam;
+import com.azure.core.annotation.Headers;
+import com.azure.core.annotation.Host;
+import com.azure.core.annotation.HostParam;
+import com.azure.core.annotation.Patch;
+import com.azure.core.annotation.PathParam;
+import com.azure.core.annotation.Put;
+import com.azure.core.annotation.QueryParam;
+import com.azure.core.annotation.ReturnType;
+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;
+import com.azure.core.util.Context;
+import com.azure.core.util.FluxUtil;
+import com.azure.resourcemanager.desktopvirtualization.fluent.ScalingPlanPersonalSchedulesClient;
+import com.azure.resourcemanager.desktopvirtualization.fluent.models.ScalingPlanPersonalScheduleInner;
+import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalScheduleList;
+import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPersonalSchedulePatch;
+import reactor.core.publisher.Mono;
+
+/** An instance of this class provides access to all the operations defined in ScalingPlanPersonalSchedulesClient. */
+public final class ScalingPlanPersonalSchedulesClientImpl implements ScalingPlanPersonalSchedulesClient {
+ /** The proxy service used to perform REST calls. */
+ private final ScalingPlanPersonalSchedulesService service;
+
+ /** The service client containing this operation class. */
+ private final DesktopVirtualizationApiClientImpl client;
+
+ /**
+ * Initializes an instance of ScalingPlanPersonalSchedulesClientImpl.
+ *
+ * @param client the instance of the service client containing this operation class.
+ */
+ ScalingPlanPersonalSchedulesClientImpl(DesktopVirtualizationApiClientImpl client) {
+ this.service =
+ RestProxy
+ .create(
+ ScalingPlanPersonalSchedulesService.class, client.getHttpPipeline(), client.getSerializerAdapter());
+ this.client = client;
+ }
+
+ /**
+ * The interface defining all the services for DesktopVirtualizationApiClientScalingPlanPersonalSchedules to be used
+ * by the proxy service to perform REST calls.
+ */
+ @Host("{$host}")
+ @ServiceInterface(name = "DesktopVirtualizatio")
+ public interface ScalingPlanPersonalSchedulesService {
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> get(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("scalingPlanName") String scalingPlanName,
+ @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Put(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}")
+ @ExpectedResponses({200, 201})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> create(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("scalingPlanName") String scalingPlanName,
+ @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName,
+ @BodyParam("application/json") ScalingPlanPersonalScheduleInner scalingPlanSchedule,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Delete(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}")
+ @ExpectedResponses({200, 204})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> delete(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("scalingPlanName") String scalingPlanName,
+ @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Patch(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules/{scalingPlanScheduleName}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> update(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("scalingPlanName") String scalingPlanName,
+ @PathParam("scalingPlanScheduleName") String scalingPlanScheduleName,
+ @BodyParam("application/json") ScalingPlanPersonalSchedulePatch scalingPlanSchedule,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get(
+ "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/scalingPlans/{scalingPlanName}/personalSchedules")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> list(
+ @HostParam("$host") String endpoint,
+ @QueryParam("api-version") String apiVersion,
+ @PathParam("subscriptionId") String subscriptionId,
+ @PathParam("resourceGroupName") String resourceGroupName,
+ @PathParam("scalingPlanName") String scalingPlanName,
+ @QueryParam("pageSize") Integer pageSize,
+ @QueryParam("isDescending") Boolean isDescending,
+ @QueryParam("initialSkip") Integer initialSkip,
+ @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Headers({"Content-Type: application/json"})
+ @Get("{nextLink}")
+ @ExpectedResponses({200})
+ @UnexpectedResponseExceptionType(ManagementException.class)
+ Mono> listNext(
+ @PathParam(value = "nextLink", encoded = true) String nextLink,
+ @HostParam("$host") String endpoint,
+ @HeaderParam("Accept") String accept,
+ Context context);
+ }
+
+ /**
+ * Get a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @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 ScalingPlanPersonalSchedule along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> getWithResponseAsync(
+ String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (scalingPlanName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null."));
+ }
+ if (scalingPlanScheduleName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ scalingPlanName,
+ scalingPlanScheduleName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Get a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @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 ScalingPlanPersonalSchedule along with {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> getWithResponseAsync(
+ String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (scalingPlanName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null."));
+ }
+ if (scalingPlanScheduleName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .get(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ scalingPlanName,
+ scalingPlanScheduleName,
+ accept,
+ context);
+ }
+
+ /**
+ * Get a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @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 ScalingPlanPersonalSchedule on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono getAsync(
+ String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) {
+ return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Get a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @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 ScalingPlanPersonalSchedule along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response getWithResponse(
+ String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) {
+ return getWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block();
+ }
+
+ /**
+ * Get a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @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 ScalingPlanPersonalSchedule.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ScalingPlanPersonalScheduleInner get(
+ String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) {
+ return getWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE).getValue();
+ }
+
+ /**
+ * Create or update a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions.
+ * @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 represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> createWithResponseAsync(
+ String resourceGroupName,
+ String scalingPlanName,
+ String scalingPlanScheduleName,
+ ScalingPlanPersonalScheduleInner scalingPlanSchedule) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (scalingPlanName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null."));
+ }
+ if (scalingPlanScheduleName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null."));
+ }
+ if (scalingPlanSchedule == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter scalingPlanSchedule is required and cannot be null."));
+ } else {
+ scalingPlanSchedule.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .create(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ scalingPlanName,
+ scalingPlanScheduleName,
+ scalingPlanSchedule,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Create or update a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions.
+ * @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 represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> createWithResponseAsync(
+ String resourceGroupName,
+ String scalingPlanName,
+ String scalingPlanScheduleName,
+ ScalingPlanPersonalScheduleInner scalingPlanSchedule,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (scalingPlanName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null."));
+ }
+ if (scalingPlanScheduleName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null."));
+ }
+ if (scalingPlanSchedule == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter scalingPlanSchedule is required and cannot be null."));
+ } else {
+ scalingPlanSchedule.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .create(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ scalingPlanName,
+ scalingPlanScheduleName,
+ scalingPlanSchedule,
+ accept,
+ context);
+ }
+
+ /**
+ * Create or update a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions.
+ * @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 represents a ScalingPlanPersonalSchedule definition on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono createAsync(
+ String resourceGroupName,
+ String scalingPlanName,
+ String scalingPlanScheduleName,
+ ScalingPlanPersonalScheduleInner scalingPlanSchedule) {
+ return createWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Create or update a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions.
+ * @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 represents a ScalingPlanPersonalSchedule definition along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response createWithResponse(
+ String resourceGroupName,
+ String scalingPlanName,
+ String scalingPlanScheduleName,
+ ScalingPlanPersonalScheduleInner scalingPlanSchedule,
+ Context context) {
+ return createWithResponseAsync(
+ resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, context)
+ .block();
+ }
+
+ /**
+ * Create or update a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions.
+ * @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 represents a ScalingPlanPersonalSchedule definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ScalingPlanPersonalScheduleInner create(
+ String resourceGroupName,
+ String scalingPlanName,
+ String scalingPlanScheduleName,
+ ScalingPlanPersonalScheduleInner scalingPlanSchedule) {
+ return createWithResponse(
+ resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, Context.NONE)
+ .getValue();
+ }
+
+ /**
+ * Remove a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @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 {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> deleteWithResponseAsync(
+ String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (scalingPlanName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null."));
+ }
+ if (scalingPlanScheduleName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ scalingPlanName,
+ scalingPlanScheduleName,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Remove a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @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 {@link Response} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> deleteWithResponseAsync(
+ String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (scalingPlanName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null."));
+ }
+ if (scalingPlanScheduleName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .delete(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ scalingPlanName,
+ scalingPlanScheduleName,
+ accept,
+ context);
+ }
+
+ /**
+ * Remove a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @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 {@link Mono} that completes when a successful response is received.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono deleteAsync(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) {
+ return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName)
+ .flatMap(ignored -> Mono.empty());
+ }
+
+ /**
+ * Remove a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @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 {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response deleteWithResponse(
+ String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName, Context context) {
+ return deleteWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, context).block();
+ }
+
+ /**
+ * Remove a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @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 delete(String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) {
+ deleteWithResponse(resourceGroupName, scalingPlanName, scalingPlanScheduleName, Context.NONE);
+ }
+
+ /**
+ * Update a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions.
+ * @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 represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> updateWithResponseAsync(
+ String resourceGroupName,
+ String scalingPlanName,
+ String scalingPlanScheduleName,
+ ScalingPlanPersonalSchedulePatch scalingPlanSchedule) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (scalingPlanName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null."));
+ }
+ if (scalingPlanScheduleName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null."));
+ }
+ if (scalingPlanSchedule != null) {
+ scalingPlanSchedule.validate();
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ scalingPlanName,
+ scalingPlanScheduleName,
+ scalingPlanSchedule,
+ accept,
+ context))
+ .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
+ }
+
+ /**
+ * Update a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions.
+ * @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 represents a ScalingPlanPersonalSchedule definition along with {@link Response} on successful completion
+ * of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> updateWithResponseAsync(
+ String resourceGroupName,
+ String scalingPlanName,
+ String scalingPlanScheduleName,
+ ScalingPlanPersonalSchedulePatch scalingPlanSchedule,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (scalingPlanName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null."));
+ }
+ if (scalingPlanScheduleName == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException("Parameter scalingPlanScheduleName is required and cannot be null."));
+ }
+ if (scalingPlanSchedule != null) {
+ scalingPlanSchedule.validate();
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .update(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ scalingPlanName,
+ scalingPlanScheduleName,
+ scalingPlanSchedule,
+ accept,
+ context);
+ }
+
+ /**
+ * Update a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @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 represents a ScalingPlanPersonalSchedule definition on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono updateAsync(
+ String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) {
+ final ScalingPlanPersonalSchedulePatch scalingPlanSchedule = null;
+ return updateWithResponseAsync(resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule)
+ .flatMap(res -> Mono.justOrEmpty(res.getValue()));
+ }
+
+ /**
+ * Update a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @param scalingPlanSchedule Object containing ScalingPlanPersonalSchedule definitions.
+ * @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 represents a ScalingPlanPersonalSchedule definition along with {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response updateWithResponse(
+ String resourceGroupName,
+ String scalingPlanName,
+ String scalingPlanScheduleName,
+ ScalingPlanPersonalSchedulePatch scalingPlanSchedule,
+ Context context) {
+ return updateWithResponseAsync(
+ resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, context)
+ .block();
+ }
+
+ /**
+ * Update a ScalingPlanPersonalSchedule.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param scalingPlanScheduleName The name of the ScalingPlanSchedule.
+ * @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 represents a ScalingPlanPersonalSchedule definition.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ScalingPlanPersonalScheduleInner update(
+ String resourceGroupName, String scalingPlanName, String scalingPlanScheduleName) {
+ final ScalingPlanPersonalSchedulePatch scalingPlanSchedule = null;
+ return updateWithResponse(
+ resourceGroupName, scalingPlanName, scalingPlanScheduleName, scalingPlanSchedule, Context.NONE)
+ .getValue();
+ }
+
+ /**
+ * List ScalingPlanPersonalSchedules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String resourceGroupName, String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (scalingPlanName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ return FluxUtil
+ .withContext(
+ context ->
+ service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ scalingPlanName,
+ pageSize,
+ isDescending,
+ initialSkip,
+ 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()));
+ }
+
+ /**
+ * List ScalingPlanPersonalSchedules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono> listSinglePageAsync(
+ String resourceGroupName,
+ String scalingPlanName,
+ Integer pageSize,
+ Boolean isDescending,
+ Integer initialSkip,
+ Context context) {
+ if (this.client.getEndpoint() == null) {
+ return Mono
+ .error(
+ new IllegalArgumentException(
+ "Parameter this.client.getEndpoint() 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."));
+ }
+ if (resourceGroupName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
+ }
+ if (scalingPlanName == null) {
+ return Mono
+ .error(new IllegalArgumentException("Parameter scalingPlanName is required and cannot be null."));
+ }
+ final String accept = "application/json";
+ context = this.client.mergeContext(context);
+ return service
+ .list(
+ this.client.getEndpoint(),
+ this.client.getApiVersion(),
+ this.client.getSubscriptionId(),
+ resourceGroupName,
+ scalingPlanName,
+ pageSize,
+ isDescending,
+ initialSkip,
+ accept,
+ context)
+ .map(
+ res ->
+ new PagedResponseBase<>(
+ res.getRequest(),
+ res.getStatusCode(),
+ res.getHeaders(),
+ res.getValue().value(),
+ res.getValue().nextLink(),
+ null));
+ }
+
+ /**
+ * List ScalingPlanPersonalSchedules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAsync(
+ String resourceGroupName, String scalingPlanName, Integer pageSize, Boolean isDescending, Integer initialSkip) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List ScalingPlanPersonalSchedules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @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 scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedFlux listAsync(String resourceGroupName, String scalingPlanName) {
+ final Integer pageSize = null;
+ final Boolean isDescending = null;
+ final Integer initialSkip = null;
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip),
+ nextLink -> listNextSinglePageAsync(nextLink));
+ }
+
+ /**
+ * List ScalingPlanPersonalSchedules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 scalingPlanPersonalScheduleList as paginated response with {@link PagedFlux}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ private PagedFlux listAsync(
+ String resourceGroupName,
+ String scalingPlanName,
+ Integer pageSize,
+ Boolean isDescending,
+ Integer initialSkip,
+ Context context) {
+ return new PagedFlux<>(
+ () -> listSinglePageAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context),
+ nextLink -> listNextSinglePageAsync(nextLink, context));
+ }
+
+ /**
+ * List ScalingPlanPersonalSchedules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @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 scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(String resourceGroupName, String scalingPlanName) {
+ final Integer pageSize = null;
+ final Boolean isDescending = null;
+ final Integer initialSkip = null;
+ return new PagedIterable<>(listAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip));
+ }
+
+ /**
+ * List ScalingPlanPersonalSchedules.
+ *
+ * @param resourceGroupName The name of the resource group. The name is case insensitive.
+ * @param scalingPlanName The name of the scaling plan.
+ * @param pageSize Number of items per page.
+ * @param isDescending Indicates whether the collection is descending.
+ * @param initialSkip Initial number of items to skip.
+ * @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 scalingPlanPersonalScheduleList as paginated response with {@link PagedIterable}.
+ */
+ @ServiceMethod(returns = ReturnType.COLLECTION)
+ public PagedIterable list(
+ String resourceGroupName,
+ String scalingPlanName,
+ Integer pageSize,
+ Boolean isDescending,
+ Integer initialSkip,
+ Context context) {
+ return new PagedIterable<>(
+ listAsync(resourceGroupName, scalingPlanName, pageSize, isDescending, initialSkip, context));
+ }
+
+ /**
+ * 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 scalingPlanPersonalScheduleList 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 scalingPlanPersonalScheduleList along with {@link PagedResponse} on successful completion of {@link
+ * Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ private Mono