com.azure.resourcemanager.network.implementation.ApplicationGatewaysClientImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-network Show documentation
Show all versions of azure-resourcemanager-network Show documentation
This package contains Microsoft Azure Network Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.network.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.Post;
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.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.network.fluent.ApplicationGatewaysClient;
import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayAvailableSslOptionsInner;
import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayAvailableWafRuleSetsResultInner;
import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayBackendHealthInner;
import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayBackendHealthOnDemandInner;
import com.azure.resourcemanager.network.fluent.models.ApplicationGatewayInner;
import com.azure.resourcemanager.network.fluent.models.ApplicationGatewaySslPredefinedPolicyInner;
import com.azure.resourcemanager.network.models.ApplicationGatewayAvailableSslPredefinedPolicies;
import com.azure.resourcemanager.network.models.ApplicationGatewayListResult;
import com.azure.resourcemanager.network.models.ApplicationGatewayOnDemandProbe;
import com.azure.resourcemanager.network.models.ErrorException;
import com.azure.resourcemanager.network.models.TagsObject;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet;
import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing;
import java.nio.ByteBuffer;
import java.util.List;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
* An instance of this class provides access to all the operations defined in ApplicationGatewaysClient.
*/
public final class ApplicationGatewaysClientImpl implements InnerSupportsGet,
InnerSupportsListing, InnerSupportsDelete, ApplicationGatewaysClient {
/**
* The proxy service used to perform REST calls.
*/
private final ApplicationGatewaysService service;
/**
* The service client containing this operation class.
*/
private final NetworkManagementClientImpl client;
/**
* Initializes an instance of ApplicationGatewaysClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
ApplicationGatewaysClientImpl(NetworkManagementClientImpl client) {
this.service = RestProxy.create(ApplicationGatewaysService.class, client.getHttpPipeline(),
client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for NetworkManagementClientApplicationGateways to be used by the proxy
* service to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "NetworkManagementCli")
public interface ApplicationGatewaysService {
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> delete(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("applicationGatewayName") String applicationGatewayName,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getByResourceGroup(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("applicationGatewayName") String applicationGatewayName,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdate(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("applicationGatewayName") String applicationGatewayName,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@BodyParam("application/json") ApplicationGatewayInner parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> updateTags(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("applicationGatewayName") String applicationGatewayName,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@BodyParam("application/json") TagsObject parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByResourceGroup(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGateways")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> list(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/start")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> start(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("applicationGatewayName") String applicationGatewayName,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/stop")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> stop(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("applicationGatewayName") String applicationGatewayName,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/backendhealth")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> backendHealth(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("applicationGatewayName") String applicationGatewayName,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@QueryParam("$expand") String expand, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/applicationGateways/{applicationGatewayName}/getBackendHealthOnDemand")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> backendHealthOnDemand(@HostParam("$host") String endpoint,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("applicationGatewayName") String applicationGatewayName,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@QueryParam("$expand") String expand,
@BodyParam("application/json") ApplicationGatewayOnDemandProbe probeRequest,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableServerVariables")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ErrorException.class)
Mono>> listAvailableServerVariables(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableRequestHeaders")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ErrorException.class)
Mono>> listAvailableRequestHeaders(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableResponseHeaders")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ErrorException.class)
Mono>> listAvailableResponseHeaders(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableWafRuleSets")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listAvailableWafRuleSets(
@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listAvailableSslOptions(
@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listAvailableSslPredefinedPolicies(
@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.Network/applicationGatewayAvailableSslOptions/default/predefinedPolicies/{predefinedPolicyName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getSslPredefinedPolicy(
@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("predefinedPolicyName") String predefinedPolicyName, @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);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listAllNext(
@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> listAvailableSslPredefinedPoliciesNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
}
/**
* Deletes the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 applicationGatewayName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, applicationGatewayName,
apiVersion, this.client.getSubscriptionId(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deletes the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 applicationGatewayName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.delete(this.client.getEndpoint(), resourceGroupName, applicationGatewayName, apiVersion,
this.client.getSubscriptionId(), accept, context);
}
/**
* Deletes the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, Void> beginDeleteAsync(String resourceGroupName,
String applicationGatewayName) {
Mono>> mono = deleteWithResponseAsync(resourceGroupName, applicationGatewayName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Deletes the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String applicationGatewayName,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= deleteWithResponseAsync(resourceGroupName, applicationGatewayName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Deletes the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceGroupName, String applicationGatewayName) {
return this.beginDeleteAsync(resourceGroupName, applicationGatewayName).getSyncPoller();
}
/**
* Deletes the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginDelete(String resourceGroupName, String applicationGatewayName,
Context context) {
return this.beginDeleteAsync(resourceGroupName, applicationGatewayName, context).getSyncPoller();
}
/**
* Deletes the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 applicationGatewayName) {
return beginDeleteAsync(resourceGroupName, applicationGatewayName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String resourceGroupName, String applicationGatewayName, Context context) {
return beginDeleteAsync(resourceGroupName, applicationGatewayName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 applicationGatewayName) {
deleteAsync(resourceGroupName, applicationGatewayName).block();
}
/**
* Deletes the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void delete(String resourceGroupName, String applicationGatewayName, Context context) {
deleteAsync(resourceGroupName, applicationGatewayName, context).block();
}
/**
* Gets the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 specified application gateway along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
String applicationGatewayName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName,
applicationGatewayName, apiVersion, this.client.getSubscriptionId(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 specified application gateway along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
String applicationGatewayName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, applicationGatewayName,
apiVersion, this.client.getSubscriptionId(), accept, context);
}
/**
* Gets the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 specified application gateway on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getByResourceGroupAsync(String resourceGroupName,
String applicationGatewayName) {
return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGatewayName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 specified application gateway along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByResourceGroupWithResponse(String resourceGroupName,
String applicationGatewayName, Context context) {
return getByResourceGroupWithResponseAsync(resourceGroupName, applicationGatewayName, context).block();
}
/**
* Gets the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 specified application gateway.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationGatewayInner getByResourceGroup(String resourceGroupName, String applicationGatewayName) {
return getByResourceGroupWithResponse(resourceGroupName, applicationGatewayName, Context.NONE).getValue();
}
/**
* Creates or updates the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to the create or update application gateway 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 application gateway resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String applicationGatewayName, ApplicationGatewayInner parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName 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 (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), resourceGroupName,
applicationGatewayName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Creates or updates the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to the create or update application gateway operation.
* @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 application gateway resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String applicationGatewayName, ApplicationGatewayInner parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName 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 (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdate(this.client.getEndpoint(), resourceGroupName, applicationGatewayName, apiVersion,
this.client.getSubscriptionId(), parameters, accept, context);
}
/**
* Creates or updates the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to the create or update application gateway 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 PollerFlux} for polling of application gateway resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, ApplicationGatewayInner> beginCreateOrUpdateAsync(
String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) {
Mono>> mono
= createOrUpdateWithResponseAsync(resourceGroupName, applicationGatewayName, parameters);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ApplicationGatewayInner.class, ApplicationGatewayInner.class,
this.client.getContext());
}
/**
* Creates or updates the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to the create or update application gateway operation.
* @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 PollerFlux} for polling of application gateway resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ApplicationGatewayInner> beginCreateOrUpdateAsync(
String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createOrUpdateWithResponseAsync(resourceGroupName, applicationGatewayName, parameters, context);
return this.client.getLroResult(mono,
this.client.getHttpPipeline(), ApplicationGatewayInner.class, ApplicationGatewayInner.class, context);
}
/**
* Creates or updates the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to the create or update application gateway 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 SyncPoller} for polling of application gateway resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate(
String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters) {
return this.beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).getSyncPoller();
}
/**
* Creates or updates the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to the create or update application gateway operation.
* @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 SyncPoller} for polling of application gateway resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ApplicationGatewayInner> beginCreateOrUpdate(
String resourceGroupName, String applicationGatewayName, ApplicationGatewayInner parameters, Context context) {
return this.beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters, context)
.getSyncPoller();
}
/**
* Creates or updates the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to the create or update application gateway 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 application gateway resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono createOrUpdateAsync(String resourceGroupName, String applicationGatewayName,
ApplicationGatewayInner parameters) {
return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Creates or updates the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to the create or update application gateway operation.
* @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 application gateway resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String resourceGroupName, String applicationGatewayName,
ApplicationGatewayInner parameters, Context context) {
return beginCreateOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Creates or updates the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to the create or update application gateway 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 application gateway resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationGatewayInner createOrUpdate(String resourceGroupName, String applicationGatewayName,
ApplicationGatewayInner parameters) {
return createOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters).block();
}
/**
* Creates or updates the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to the create or update application gateway operation.
* @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 application gateway resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationGatewayInner createOrUpdate(String resourceGroupName, String applicationGatewayName,
ApplicationGatewayInner parameters, Context context) {
return createOrUpdateAsync(resourceGroupName, applicationGatewayName, parameters, context).block();
}
/**
* Updates the specified application gateway tags.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to update application gateway tags.
* @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 application gateway resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> updateTagsWithResponseAsync(String resourceGroupName,
String applicationGatewayName, TagsObject parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName 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 (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.updateTags(this.client.getEndpoint(), resourceGroupName,
applicationGatewayName, apiVersion, this.client.getSubscriptionId(), parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Updates the specified application gateway tags.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to update application gateway tags.
* @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 application gateway resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> updateTagsWithResponseAsync(String resourceGroupName,
String applicationGatewayName, TagsObject parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName 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 (parameters == null) {
return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
} else {
parameters.validate();
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.updateTags(this.client.getEndpoint(), resourceGroupName, applicationGatewayName, apiVersion,
this.client.getSubscriptionId(), parameters, accept, context);
}
/**
* Updates the specified application gateway tags.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to update application gateway tags.
* @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 application gateway resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono updateTagsAsync(String resourceGroupName, String applicationGatewayName,
TagsObject parameters) {
return updateTagsWithResponseAsync(resourceGroupName, applicationGatewayName, parameters)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Updates the specified application gateway tags.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to update application gateway tags.
* @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 application gateway resource along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response updateTagsWithResponse(String resourceGroupName,
String applicationGatewayName, TagsObject parameters, Context context) {
return updateTagsWithResponseAsync(resourceGroupName, applicationGatewayName, parameters, context).block();
}
/**
* Updates the specified application gateway tags.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param parameters Parameters supplied to update application gateway tags.
* @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 application gateway resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationGatewayInner updateTags(String resourceGroupName, String applicationGatewayName,
TagsObject parameters) {
return updateTagsWithResponse(resourceGroupName, applicationGatewayName, parameters, Context.NONE).getValue();
}
/**
* Lists all application gateways in a resource group.
*
* @param resourceGroupName The name of the 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 response for ListApplicationGateways API service call along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName,
apiVersion, this.client.getSubscriptionId(), 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()));
}
/**
* Lists all application gateways in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @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 response for ListApplicationGateways API service call along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, apiVersion,
this.client.getSubscriptionId(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Lists all application gateways in a resource group.
*
* @param resourceGroupName The name of the 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 response for ListApplicationGateways API service call as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listByResourceGroupAsync(String resourceGroupName) {
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName),
nextLink -> listNextSinglePageAsync(nextLink));
}
/**
* Lists all application gateways in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @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 response for ListApplicationGateways API service call as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
nextLink -> listNextSinglePageAsync(nextLink, context));
}
/**
* Lists all application gateways in a resource group.
*
* @param resourceGroupName The name of the 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 response for ListApplicationGateways API service call as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
}
/**
* Lists all application gateways in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @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 response for ListApplicationGateways API service call as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
}
/**
* Gets all the application gateways in a subscription.
*
* @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 all the application gateways in a subscription along with {@link PagedResponse} on successful completion
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync() {
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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(),
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()));
}
/**
* Gets all the application gateways in a subscription.
*
* @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 all the application gateways in a subscription along with {@link PagedResponse} on successful completion
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.list(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Gets all the application gateways in a subscription.
*
* @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 all the application gateways in a subscription as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listAsync() {
return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink));
}
/**
* Gets all the application gateways in a subscription.
*
* @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 all the application gateways in a subscription as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(Context context) {
return new PagedFlux<>(() -> listSinglePageAsync(context),
nextLink -> listAllNextSinglePageAsync(nextLink, context));
}
/**
* Gets all the application gateways in a subscription.
*
* @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 all the application gateways in a subscription as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list() {
return new PagedIterable<>(listAsync());
}
/**
* Gets all the application gateways in a subscription.
*
* @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 all the application gateways in a subscription as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(Context context) {
return new PagedIterable<>(listAsync(context));
}
/**
* Starts the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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>> startWithResponseAsync(String resourceGroupName,
String applicationGatewayName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.start(this.client.getEndpoint(), resourceGroupName, applicationGatewayName,
apiVersion, this.client.getSubscriptionId(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Starts the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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>> startWithResponseAsync(String resourceGroupName,
String applicationGatewayName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.start(this.client.getEndpoint(), resourceGroupName, applicationGatewayName, apiVersion,
this.client.getSubscriptionId(), accept, context);
}
/**
* Starts the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, Void> beginStartAsync(String resourceGroupName, String applicationGatewayName) {
Mono>> mono = startWithResponseAsync(resourceGroupName, applicationGatewayName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Starts the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginStartAsync(String resourceGroupName, String applicationGatewayName,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= startWithResponseAsync(resourceGroupName, applicationGatewayName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Starts the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginStart(String resourceGroupName, String applicationGatewayName) {
return this.beginStartAsync(resourceGroupName, applicationGatewayName).getSyncPoller();
}
/**
* Starts the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginStart(String resourceGroupName, String applicationGatewayName,
Context context) {
return this.beginStartAsync(resourceGroupName, applicationGatewayName, context).getSyncPoller();
}
/**
* Starts the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 startAsync(String resourceGroupName, String applicationGatewayName) {
return beginStartAsync(resourceGroupName, applicationGatewayName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Starts the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono startAsync(String resourceGroupName, String applicationGatewayName, Context context) {
return beginStartAsync(resourceGroupName, applicationGatewayName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Starts the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 start(String resourceGroupName, String applicationGatewayName) {
startAsync(resourceGroupName, applicationGatewayName).block();
}
/**
* Starts the specified application gateway.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void start(String resourceGroupName, String applicationGatewayName, Context context) {
startAsync(resourceGroupName, applicationGatewayName, context).block();
}
/**
* Stops the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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>> stopWithResponseAsync(String resourceGroupName,
String applicationGatewayName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.stop(this.client.getEndpoint(), resourceGroupName, applicationGatewayName,
apiVersion, this.client.getSubscriptionId(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Stops the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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>> stopWithResponseAsync(String resourceGroupName,
String applicationGatewayName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.stop(this.client.getEndpoint(), resourceGroupName, applicationGatewayName, apiVersion,
this.client.getSubscriptionId(), accept, context);
}
/**
* Stops the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, Void> beginStopAsync(String resourceGroupName, String applicationGatewayName) {
Mono>> mono = stopWithResponseAsync(resourceGroupName, applicationGatewayName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Stops the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 PollerFlux} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, Void> beginStopAsync(String resourceGroupName, String applicationGatewayName,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= stopWithResponseAsync(resourceGroupName, applicationGatewayName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Stops the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginStop(String resourceGroupName, String applicationGatewayName) {
return this.beginStopAsync(resourceGroupName, applicationGatewayName).getSyncPoller();
}
/**
* Stops the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, Void> beginStop(String resourceGroupName, String applicationGatewayName,
Context context) {
return this.beginStopAsync(resourceGroupName, applicationGatewayName, context).getSyncPoller();
}
/**
* Stops the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 stopAsync(String resourceGroupName, String applicationGatewayName) {
return beginStopAsync(resourceGroupName, applicationGatewayName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Stops the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 {@link Mono} that completes when a successful response is received.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono stopAsync(String resourceGroupName, String applicationGatewayName, Context context) {
return beginStopAsync(resourceGroupName, applicationGatewayName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Stops the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 stop(String resourceGroupName, String applicationGatewayName) {
stopAsync(resourceGroupName, applicationGatewayName).block();
}
/**
* Stops the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public void stop(String resourceGroupName, String applicationGatewayName, Context context) {
stopAsync(resourceGroupName, applicationGatewayName, context).block();
}
/**
* Gets the backend health of the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 backend health of the specified application gateway in a resource group along with {@link Response}
* on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> backendHealthWithResponseAsync(String resourceGroupName,
String applicationGatewayName, String expand) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.backendHealth(this.client.getEndpoint(), resourceGroupName,
applicationGatewayName, apiVersion, this.client.getSubscriptionId(), expand, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets the backend health of the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 backend health of the specified application gateway in a resource group along with {@link Response}
* on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> backendHealthWithResponseAsync(String resourceGroupName,
String applicationGatewayName, String expand, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.backendHealth(this.client.getEndpoint(), resourceGroupName, applicationGatewayName, apiVersion,
this.client.getSubscriptionId(), expand, accept, context);
}
/**
* Gets the backend health of the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 PollerFlux} for polling of the backend health of the specified application gateway in a
* resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, ApplicationGatewayBackendHealthInner>
beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) {
Mono>> mono
= backendHealthWithResponseAsync(resourceGroupName, applicationGatewayName, expand);
return this.client.getLroResult(
mono, this.client.getHttpPipeline(), ApplicationGatewayBackendHealthInner.class,
ApplicationGatewayBackendHealthInner.class, this.client.getContext());
}
/**
* Gets the backend health of the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 PollerFlux} for polling of the backend health of the specified application gateway in a
* resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public PollerFlux, ApplicationGatewayBackendHealthInner>
beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName) {
final String expand = null;
Mono>> mono
= backendHealthWithResponseAsync(resourceGroupName, applicationGatewayName, expand);
return this.client.getLroResult(
mono, this.client.getHttpPipeline(), ApplicationGatewayBackendHealthInner.class,
ApplicationGatewayBackendHealthInner.class, this.client.getContext());
}
/**
* Gets the backend health of the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 PollerFlux} for polling of the backend health of the specified application gateway in a
* resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ApplicationGatewayBackendHealthInner>
beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= backendHealthWithResponseAsync(resourceGroupName, applicationGatewayName, expand, context);
return this.client.getLroResult(
mono, this.client.getHttpPipeline(), ApplicationGatewayBackendHealthInner.class,
ApplicationGatewayBackendHealthInner.class, context);
}
/**
* Gets the backend health of the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 SyncPoller} for polling of the backend health of the specified application gateway in a
* resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ApplicationGatewayBackendHealthInner>
beginBackendHealth(String resourceGroupName, String applicationGatewayName) {
final String expand = null;
return this.beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand).getSyncPoller();
}
/**
* Gets the backend health of the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 SyncPoller} for polling of the backend health of the specified application gateway in a
* resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ApplicationGatewayBackendHealthInner>
beginBackendHealth(String resourceGroupName, String applicationGatewayName, String expand, Context context) {
return this.beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand, context).getSyncPoller();
}
/**
* Gets the backend health of the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 backend health of the specified application gateway in a resource group on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono backendHealthAsync(String resourceGroupName,
String applicationGatewayName, String expand) {
return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets the backend health of the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 backend health of the specified application gateway in a resource group on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono backendHealthAsync(String resourceGroupName,
String applicationGatewayName) {
final String expand = null;
return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets the backend health of the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 backend health of the specified application gateway in a resource group on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono backendHealthAsync(String resourceGroupName,
String applicationGatewayName, String expand, Context context) {
return beginBackendHealthAsync(resourceGroupName, applicationGatewayName, expand, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets the backend health of the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @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 backend health of the specified application gateway in a resource group.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName) {
final String expand = null;
return backendHealthAsync(resourceGroupName, applicationGatewayName, expand).block();
}
/**
* Gets the backend health of the specified application gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 backend health of the specified application gateway in a resource group.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationGatewayBackendHealthInner backendHealth(String resourceGroupName, String applicationGatewayName,
String expand, Context context) {
return backendHealthAsync(resourceGroupName, applicationGatewayName, expand, context).block();
}
/**
* Gets the backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param probeRequest Request body for on-demand test probe operation.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> backendHealthOnDemandWithResponseAsync(String resourceGroupName,
String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName 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 (probeRequest == null) {
return Mono.error(new IllegalArgumentException("Parameter probeRequest is required and cannot be null."));
} else {
probeRequest.validate();
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.backendHealthOnDemand(this.client.getEndpoint(), resourceGroupName,
applicationGatewayName, apiVersion, this.client.getSubscriptionId(), expand, probeRequest, accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets the backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param probeRequest Request body for on-demand test probe operation.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> backendHealthOnDemandWithResponseAsync(String resourceGroupName,
String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (applicationGatewayName == null) {
return Mono.error(
new IllegalArgumentException("Parameter applicationGatewayName 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 (probeRequest == null) {
return Mono.error(new IllegalArgumentException("Parameter probeRequest is required and cannot be null."));
} else {
probeRequest.validate();
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.backendHealthOnDemand(this.client.getEndpoint(), resourceGroupName, applicationGatewayName,
apiVersion, this.client.getSubscriptionId(), expand, probeRequest, accept, context);
}
/**
* Gets the backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param probeRequest Request body for on-demand test probe operation.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 PollerFlux} for polling of the backend health for given combination of backend pool and http
* setting of the specified application gateway in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
PollerFlux, ApplicationGatewayBackendHealthOnDemandInner>
beginBackendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName,
ApplicationGatewayOnDemandProbe probeRequest, String expand) {
Mono>> mono
= backendHealthOnDemandWithResponseAsync(resourceGroupName, applicationGatewayName, probeRequest, expand);
return this.client
.getLroResult(
mono, this.client.getHttpPipeline(), ApplicationGatewayBackendHealthOnDemandInner.class,
ApplicationGatewayBackendHealthOnDemandInner.class, this.client.getContext());
}
/**
* Gets the backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param probeRequest Request body for on-demand test probe 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 PollerFlux} for polling of the backend health for given combination of backend pool and http
* setting of the specified application gateway in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
PollerFlux, ApplicationGatewayBackendHealthOnDemandInner>
beginBackendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName,
ApplicationGatewayOnDemandProbe probeRequest) {
final String expand = null;
Mono>> mono
= backendHealthOnDemandWithResponseAsync(resourceGroupName, applicationGatewayName, probeRequest, expand);
return this.client
.getLroResult(
mono, this.client.getHttpPipeline(), ApplicationGatewayBackendHealthOnDemandInner.class,
ApplicationGatewayBackendHealthOnDemandInner.class, this.client.getContext());
}
/**
* Gets the backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param probeRequest Request body for on-demand test probe operation.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 PollerFlux} for polling of the backend health for given combination of backend pool and http
* setting of the specified application gateway in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private
PollerFlux, ApplicationGatewayBackendHealthOnDemandInner>
beginBackendHealthOnDemandAsync(String resourceGroupName, String applicationGatewayName,
ApplicationGatewayOnDemandProbe probeRequest, String expand, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = backendHealthOnDemandWithResponseAsync(resourceGroupName,
applicationGatewayName, probeRequest, expand, context);
return this.client
.getLroResult(
mono, this.client.getHttpPipeline(), ApplicationGatewayBackendHealthOnDemandInner.class,
ApplicationGatewayBackendHealthOnDemandInner.class, context);
}
/**
* Gets the backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param probeRequest Request body for on-demand test probe 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 SyncPoller} for polling of the backend health for given combination of backend pool and http
* setting of the specified application gateway in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
SyncPoller, ApplicationGatewayBackendHealthOnDemandInner>
beginBackendHealthOnDemand(String resourceGroupName, String applicationGatewayName,
ApplicationGatewayOnDemandProbe probeRequest) {
final String expand = null;
return this.beginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand)
.getSyncPoller();
}
/**
* Gets the backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param probeRequest Request body for on-demand test probe operation.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 SyncPoller} for polling of the backend health for given combination of backend pool and http
* setting of the specified application gateway in a resource group.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public
SyncPoller, ApplicationGatewayBackendHealthOnDemandInner>
beginBackendHealthOnDemand(String resourceGroupName, String applicationGatewayName,
ApplicationGatewayOnDemandProbe probeRequest, String expand, Context context) {
return this
.beginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, context)
.getSyncPoller();
}
/**
* Gets the backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param probeRequest Request body for on-demand test probe operation.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono backendHealthOnDemandAsync(String resourceGroupName,
String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand) {
return beginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets the backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param probeRequest Request body for on-demand test probe 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 backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono backendHealthOnDemandAsync(String resourceGroupName,
String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) {
final String expand = null;
return beginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets the backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param probeRequest Request body for on-demand test probe operation.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono backendHealthOnDemandAsync(String resourceGroupName,
String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand, Context context) {
return beginBackendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, context)
.last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Gets the backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param probeRequest Request body for on-demand test probe 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 backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand(String resourceGroupName,
String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest) {
final String expand = null;
return backendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand).block();
}
/**
* Gets the backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*
* @param resourceGroupName The name of the resource group.
* @param applicationGatewayName The name of the application gateway.
* @param probeRequest Request body for on-demand test probe operation.
* @param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
* @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 backend health for given combination of backend pool and http setting of the specified application
* gateway in a resource group.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationGatewayBackendHealthOnDemandInner backendHealthOnDemand(String resourceGroupName,
String applicationGatewayName, ApplicationGatewayOnDemandProbe probeRequest, String expand, Context context) {
return backendHealthOnDemandAsync(resourceGroupName, applicationGatewayName, probeRequest, expand, context)
.block();
}
/**
* Lists all available server variables.
*
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableServerVariables API service call along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> listAvailableServerVariablesWithResponseAsync() {
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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listAvailableServerVariables(this.client.getEndpoint(), apiVersion,
this.client.getSubscriptionId(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists all available server variables.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableServerVariables API service call along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> listAvailableServerVariablesWithResponseAsync(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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listAvailableServerVariables(this.client.getEndpoint(), apiVersion,
this.client.getSubscriptionId(), accept, context);
}
/**
* Lists all available server variables.
*
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableServerVariables API service call on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> listAvailableServerVariablesAsync() {
return listAvailableServerVariablesWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Lists all available server variables.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableServerVariables API service call along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response> listAvailableServerVariablesWithResponse(Context context) {
return listAvailableServerVariablesWithResponseAsync(context).block();
}
/**
* Lists all available server variables.
*
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableServerVariables API service call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public List listAvailableServerVariables() {
return listAvailableServerVariablesWithResponse(Context.NONE).getValue();
}
/**
* Lists all available request headers.
*
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableRequestHeaders API service call along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> listAvailableRequestHeadersWithResponseAsync() {
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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listAvailableRequestHeaders(this.client.getEndpoint(), apiVersion,
this.client.getSubscriptionId(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists all available request headers.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableRequestHeaders API service call along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> listAvailableRequestHeadersWithResponseAsync(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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listAvailableRequestHeaders(this.client.getEndpoint(), apiVersion,
this.client.getSubscriptionId(), accept, context);
}
/**
* Lists all available request headers.
*
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableRequestHeaders API service call on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> listAvailableRequestHeadersAsync() {
return listAvailableRequestHeadersWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Lists all available request headers.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableRequestHeaders API service call along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response> listAvailableRequestHeadersWithResponse(Context context) {
return listAvailableRequestHeadersWithResponseAsync(context).block();
}
/**
* Lists all available request headers.
*
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableRequestHeaders API service call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public List listAvailableRequestHeaders() {
return listAvailableRequestHeadersWithResponse(Context.NONE).getValue();
}
/**
* Lists all available response headers.
*
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableResponseHeaders API service call along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>> listAvailableResponseHeadersWithResponseAsync() {
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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listAvailableResponseHeaders(this.client.getEndpoint(), apiVersion,
this.client.getSubscriptionId(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists all available response headers.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableResponseHeaders API service call along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> listAvailableResponseHeadersWithResponseAsync(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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listAvailableResponseHeaders(this.client.getEndpoint(), apiVersion,
this.client.getSubscriptionId(), accept, context);
}
/**
* Lists all available response headers.
*
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableResponseHeaders API service call on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> listAvailableResponseHeadersAsync() {
return listAvailableResponseHeadersWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Lists all available response headers.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableResponseHeaders API service call along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response> listAvailableResponseHeadersWithResponse(Context context) {
return listAvailableResponseHeadersWithResponseAsync(context).block();
}
/**
* Lists all available response headers.
*
* @throws ErrorException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ApplicationGatewayAvailableResponseHeaders API service call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public List listAvailableResponseHeaders() {
return listAvailableResponseHeadersWithResponse(Context.NONE).getValue();
}
/**
* Lists all available web application firewall rule sets.
*
* @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 response for ApplicationGatewayAvailableWafRuleSets API service call along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>
listAvailableWafRuleSetsWithResponseAsync() {
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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listAvailableWafRuleSets(this.client.getEndpoint(), apiVersion,
this.client.getSubscriptionId(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists all available web application firewall rule sets.
*
* @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 response for ApplicationGatewayAvailableWafRuleSets API service call along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listAvailableWafRuleSetsWithResponseAsync(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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listAvailableWafRuleSets(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(),
accept, context);
}
/**
* Lists all available web application firewall rule sets.
*
* @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 response for ApplicationGatewayAvailableWafRuleSets API service call on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono listAvailableWafRuleSetsAsync() {
return listAvailableWafRuleSetsWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Lists all available web application firewall rule sets.
*
* @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 response for ApplicationGatewayAvailableWafRuleSets API service call along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response
listAvailableWafRuleSetsWithResponse(Context context) {
return listAvailableWafRuleSetsWithResponseAsync(context).block();
}
/**
* Lists all available web application firewall rule sets.
*
* @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 response for ApplicationGatewayAvailableWafRuleSets API service call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationGatewayAvailableWafRuleSetsResultInner listAvailableWafRuleSets() {
return listAvailableWafRuleSetsWithResponse(Context.NONE).getValue();
}
/**
* Lists available Ssl options for configuring Ssl policy.
*
* @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 response for ApplicationGatewayAvailableSslOptions API service call along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono> listAvailableSslOptionsWithResponseAsync() {
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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listAvailableSslOptions(this.client.getEndpoint(), apiVersion,
this.client.getSubscriptionId(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Lists available Ssl options for configuring Ssl policy.
*
* @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 response for ApplicationGatewayAvailableSslOptions API service call along with {@link Response} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listAvailableSslOptionsWithResponseAsync(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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listAvailableSslOptions(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(),
accept, context);
}
/**
* Lists available Ssl options for configuring Ssl policy.
*
* @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 response for ApplicationGatewayAvailableSslOptions API service call on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono listAvailableSslOptionsAsync() {
return listAvailableSslOptionsWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Lists available Ssl options for configuring Ssl policy.
*
* @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 response for ApplicationGatewayAvailableSslOptions API service call along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response listAvailableSslOptionsWithResponse(Context context) {
return listAvailableSslOptionsWithResponseAsync(context).block();
}
/**
* Lists available Ssl options for configuring Ssl policy.
*
* @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 response for ApplicationGatewayAvailableSslOptions API service call.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationGatewayAvailableSslOptionsInner listAvailableSslOptions() {
return listAvailableSslOptionsWithResponse(Context.NONE).getValue();
}
/**
* Lists all SSL predefined policies for configuring Ssl policy.
*
* @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 response for ApplicationGatewayAvailableSslOptions API service call along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listAvailableSslPredefinedPoliciesSinglePageAsync() {
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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listAvailableSslPredefinedPolicies(this.client.getEndpoint(), apiVersion,
this.client.getSubscriptionId(), 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()));
}
/**
* Lists all SSL predefined policies for configuring Ssl policy.
*
* @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 response for ApplicationGatewayAvailableSslOptions API service call along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listAvailableSslPredefinedPoliciesSinglePageAsync(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."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listAvailableSslPredefinedPolicies(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(),
accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Lists all SSL predefined policies for configuring Ssl policy.
*
* @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 response for ApplicationGatewayAvailableSslOptions API service call as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedFlux listAvailableSslPredefinedPoliciesAsync() {
return new PagedFlux<>(() -> listAvailableSslPredefinedPoliciesSinglePageAsync(),
nextLink -> listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextLink));
}
/**
* Lists all SSL predefined policies for configuring Ssl policy.
*
* @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 response for ApplicationGatewayAvailableSslOptions API service call as paginated response with
* {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux
listAvailableSslPredefinedPoliciesAsync(Context context) {
return new PagedFlux<>(() -> listAvailableSslPredefinedPoliciesSinglePageAsync(context),
nextLink -> listAvailableSslPredefinedPoliciesNextSinglePageAsync(nextLink, context));
}
/**
* Lists all SSL predefined policies for configuring Ssl policy.
*
* @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 response for ApplicationGatewayAvailableSslOptions API service call as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listAvailableSslPredefinedPolicies() {
return new PagedIterable<>(listAvailableSslPredefinedPoliciesAsync());
}
/**
* Lists all SSL predefined policies for configuring Ssl policy.
*
* @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 response for ApplicationGatewayAvailableSslOptions API service call as paginated response with
* {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable
listAvailableSslPredefinedPolicies(Context context) {
return new PagedIterable<>(listAvailableSslPredefinedPoliciesAsync(context));
}
/**
* Gets Ssl predefined policy with the specified policy name.
*
* @param predefinedPolicyName Name of Ssl predefined policy.
* @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 ssl predefined policy with the specified policy name along with {@link Response} on successful completion
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono>
getSslPredefinedPolicyWithResponseAsync(String predefinedPolicyName) {
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 (predefinedPolicyName == null) {
return Mono
.error(new IllegalArgumentException("Parameter predefinedPolicyName is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getSslPredefinedPolicy(this.client.getEndpoint(), apiVersion,
this.client.getSubscriptionId(), predefinedPolicyName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets Ssl predefined policy with the specified policy name.
*
* @param predefinedPolicyName Name of Ssl predefined policy.
* @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 ssl predefined policy with the specified policy name along with {@link Response} on successful completion
* of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
getSslPredefinedPolicyWithResponseAsync(String predefinedPolicyName, 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 (predefinedPolicyName == null) {
return Mono
.error(new IllegalArgumentException("Parameter predefinedPolicyName is required and cannot be null."));
}
final String apiVersion = "2024-03-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getSslPredefinedPolicy(this.client.getEndpoint(), apiVersion, this.client.getSubscriptionId(),
predefinedPolicyName, accept, context);
}
/**
* Gets Ssl predefined policy with the specified policy name.
*
* @param predefinedPolicyName Name of Ssl predefined policy.
* @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 ssl predefined policy with the specified policy name on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono getSslPredefinedPolicyAsync(String predefinedPolicyName) {
return getSslPredefinedPolicyWithResponseAsync(predefinedPolicyName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets Ssl predefined policy with the specified policy name.
*
* @param predefinedPolicyName Name of Ssl predefined policy.
* @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 ssl predefined policy with the specified policy name along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response
getSslPredefinedPolicyWithResponse(String predefinedPolicyName, Context context) {
return getSslPredefinedPolicyWithResponseAsync(predefinedPolicyName, context).block();
}
/**
* Gets Ssl predefined policy with the specified policy name.
*
* @param predefinedPolicyName Name of Ssl predefined policy.
* @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 ssl predefined policy with the specified policy name.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ApplicationGatewaySslPredefinedPolicyInner getSslPredefinedPolicy(String predefinedPolicyName) {
return getSslPredefinedPolicyWithResponse(predefinedPolicyName, Context.NONE).getValue();
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @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 response for ListApplicationGateways API service call 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.
* @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 response for ListApplicationGateways API service call along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listNextSinglePageAsync(String nextLink, Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items.
* @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 response for ListApplicationGateways API service call along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listAllNextSinglePageAsync(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.listAllNext(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.
* @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 response for ListApplicationGateways API service call along with {@link PagedResponse} on successful
* completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listAllNextSinglePageAsync(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.listAllNext(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.
* @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 response for ApplicationGatewayAvailableSslOptions API service call along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listAvailableSslPredefinedPoliciesNextSinglePageAsync(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.listAvailableSslPredefinedPoliciesNext(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.
* @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 response for ApplicationGatewayAvailableSslOptions API service call along with {@link PagedResponse} on
* successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>
listAvailableSslPredefinedPoliciesNextSinglePageAsync(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.listAvailableSslPredefinedPoliciesNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
}