
com.azure.resourcemanager.frontdoor.implementation.ExperimentsClientImpl Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.frontdoor.implementation;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.Patch;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.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.frontdoor.fluent.ExperimentsClient;
import com.azure.resourcemanager.frontdoor.fluent.models.ExperimentInner;
import com.azure.resourcemanager.frontdoor.models.ExperimentList;
import com.azure.resourcemanager.frontdoor.models.ExperimentUpdateModel;
import java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
/**
* An instance of this class provides access to all the operations defined in ExperimentsClient.
*/
public final class ExperimentsClientImpl implements ExperimentsClient {
/**
* The proxy service used to perform REST calls.
*/
private final ExperimentsService service;
/**
* The service client containing this operation class.
*/
private final FrontDoorManagementClientImpl client;
/**
* Initializes an instance of ExperimentsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
ExperimentsClientImpl(FrontDoorManagementClientImpl client) {
this.service
= RestProxy.create(ExperimentsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for FrontDoorManagementClientExperiments to be used by the proxy service
* to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "FrontDoorManagementC")
public interface ExperimentsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByProfile(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> get(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName,
@PathParam("experimentName") String experimentName, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}")
@ExpectedResponses({ 200, 201, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdate(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName,
@PathParam("experimentName") String experimentName,
@BodyParam("application/json") ExperimentInner parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> update(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName,
@PathParam("experimentName") String experimentName,
@BodyParam("application/json") ExperimentUpdateModel parameters, @HeaderParam("Accept") String accept,
Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}")
@ExpectedResponses({ 200, 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> delete(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("profileName") String profileName,
@PathParam("experimentName") String experimentName, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByProfileNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
}
/**
* Gets a list of Experiments.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByProfileSinglePageAsync(String resourceGroupName,
String profileName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (profileName == null) {
return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
}
final String apiVersion = "2019-11-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByProfile(this.client.getEndpoint(), this.client.getSubscriptionId(),
apiVersion, resourceGroupName, profileName, 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 a list of Experiments.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByProfileSinglePageAsync(String resourceGroupName,
String profileName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (profileName == null) {
return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
}
final String apiVersion = "2019-11-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByProfile(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, resourceGroupName,
profileName, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Gets a list of Experiments.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByProfileAsync(String resourceGroupName, String profileName) {
return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName),
nextLink -> listByProfileNextSinglePageAsync(nextLink));
}
/**
* Gets a list of Experiments.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByProfileAsync(String resourceGroupName, String profileName,
Context context) {
return new PagedFlux<>(() -> listByProfileSinglePageAsync(resourceGroupName, profileName, context),
nextLink -> listByProfileNextSinglePageAsync(nextLink, context));
}
/**
* Gets a list of Experiments.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByProfile(String resourceGroupName, String profileName) {
return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName));
}
/**
* Gets a list of Experiments.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return a list of Experiments as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByProfile(String resourceGroupName, String profileName, Context context) {
return new PagedIterable<>(listByProfileAsync(resourceGroupName, profileName, context));
}
/**
* Gets an Experiment by ExperimentName.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 an Experiment by ExperimentName along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName, String profileName,
String experimentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (profileName == null) {
return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
}
final String apiVersion = "2019-11-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion,
resourceGroupName, profileName, experimentName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets an Experiment by ExperimentName.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 an Experiment by ExperimentName along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName, String profileName,
String experimentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (profileName == null) {
return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
}
final String apiVersion = "2019-11-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, resourceGroupName,
profileName, experimentName, accept, context);
}
/**
* Gets an Experiment by ExperimentName.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 an Experiment by ExperimentName on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getAsync(String resourceGroupName, String profileName, String experimentName) {
return getWithResponseAsync(resourceGroupName, profileName, experimentName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets an Experiment by ExperimentName.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 an Experiment by ExperimentName along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getWithResponse(String resourceGroupName, String profileName,
String experimentName, Context context) {
return getWithResponseAsync(resourceGroupName, profileName, experimentName, context).block();
}
/**
* Gets an Experiment by ExperimentName.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 an Experiment by ExperimentName.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExperimentInner get(String resourceGroupName, String profileName, String experimentName) {
return getWithResponse(resourceGroupName, profileName, experimentName, Context.NONE).getValue();
}
/**
* Creates or updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment resource.
* @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 defines the properties of an Experiment along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String profileName, String experimentName, ExperimentInner parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (profileName == null) {
return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName 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 = "2019-11-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(),
apiVersion, resourceGroupName, profileName, experimentName, parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Creates or updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment resource.
* @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 defines the properties of an Experiment along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String profileName, String experimentName, ExperimentInner parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (profileName == null) {
return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName 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 = "2019-11-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion,
resourceGroupName, profileName, experimentName, parameters, accept, context);
}
/**
* Creates or updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment resource.
* @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 defines the properties of an Experiment.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ExperimentInner> beginCreateOrUpdateAsync(String resourceGroupName,
String profileName, String experimentName, ExperimentInner parameters) {
Mono>> mono
= createOrUpdateWithResponseAsync(resourceGroupName, profileName, experimentName, parameters);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
ExperimentInner.class, ExperimentInner.class, this.client.getContext());
}
/**
* Creates or updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment resource.
* @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 defines the properties of an Experiment.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ExperimentInner> beginCreateOrUpdateAsync(String resourceGroupName,
String profileName, String experimentName, ExperimentInner parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createOrUpdateWithResponseAsync(resourceGroupName, profileName, experimentName, parameters, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
ExperimentInner.class, ExperimentInner.class, context);
}
/**
* Creates or updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment resource.
* @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 defines the properties of an Experiment.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ExperimentInner> beginCreateOrUpdate(String resourceGroupName,
String profileName, String experimentName, ExperimentInner parameters) {
return this.beginCreateOrUpdateAsync(resourceGroupName, profileName, experimentName, parameters)
.getSyncPoller();
}
/**
* Creates or updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment resource.
* @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 defines the properties of an Experiment.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ExperimentInner> beginCreateOrUpdate(String resourceGroupName,
String profileName, String experimentName, ExperimentInner parameters, Context context) {
return this.beginCreateOrUpdateAsync(resourceGroupName, profileName, experimentName, parameters, context)
.getSyncPoller();
}
/**
* Creates or updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment resource.
* @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 defines the properties of an Experiment on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String resourceGroupName, String profileName,
String experimentName, ExperimentInner parameters) {
return beginCreateOrUpdateAsync(resourceGroupName, profileName, experimentName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Creates or updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment resource.
* @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 defines the properties of an Experiment on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String resourceGroupName, String profileName,
String experimentName, ExperimentInner parameters, Context context) {
return beginCreateOrUpdateAsync(resourceGroupName, profileName, experimentName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Creates or updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment resource.
* @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 defines the properties of an Experiment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExperimentInner createOrUpdate(String resourceGroupName, String profileName, String experimentName,
ExperimentInner parameters) {
return createOrUpdateAsync(resourceGroupName, profileName, experimentName, parameters).block();
}
/**
* Creates or updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment resource.
* @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 defines the properties of an Experiment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExperimentInner createOrUpdate(String resourceGroupName, String profileName, String experimentName,
ExperimentInner parameters, Context context) {
return createOrUpdateAsync(resourceGroupName, profileName, experimentName, parameters, context).block();
}
/**
* Updates an Experiment by Experiment id
*
* Updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment Update Model.
* @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 defines the properties of an Experiment along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName,
String experimentName, ExperimentUpdateModel parameters) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (profileName == null) {
return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName 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 = "2019-11-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(),
apiVersion, resourceGroupName, profileName, experimentName, parameters, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Updates an Experiment by Experiment id
*
* Updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment Update Model.
* @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 defines the properties of an Experiment along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateWithResponseAsync(String resourceGroupName, String profileName,
String experimentName, ExperimentUpdateModel parameters, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (profileName == null) {
return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName 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 = "2019-11-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, resourceGroupName,
profileName, experimentName, parameters, accept, context);
}
/**
* Updates an Experiment by Experiment id
*
* Updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment Update Model.
* @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 defines the properties of an Experiment.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ExperimentInner> beginUpdateAsync(String resourceGroupName,
String profileName, String experimentName, ExperimentUpdateModel parameters) {
Mono>> mono
= updateWithResponseAsync(resourceGroupName, profileName, experimentName, parameters);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
ExperimentInner.class, ExperimentInner.class, this.client.getContext());
}
/**
* Updates an Experiment by Experiment id
*
* Updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment Update Model.
* @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 defines the properties of an Experiment.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, ExperimentInner> beginUpdateAsync(String resourceGroupName,
String profileName, String experimentName, ExperimentUpdateModel parameters, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= updateWithResponseAsync(resourceGroupName, profileName, experimentName, parameters, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
ExperimentInner.class, ExperimentInner.class, context);
}
/**
* Updates an Experiment by Experiment id
*
* Updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment Update Model.
* @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 defines the properties of an Experiment.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ExperimentInner> beginUpdate(String resourceGroupName,
String profileName, String experimentName, ExperimentUpdateModel parameters) {
return this.beginUpdateAsync(resourceGroupName, profileName, experimentName, parameters).getSyncPoller();
}
/**
* Updates an Experiment by Experiment id
*
* Updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment Update Model.
* @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 defines the properties of an Experiment.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, ExperimentInner> beginUpdate(String resourceGroupName,
String profileName, String experimentName, ExperimentUpdateModel parameters, Context context) {
return this.beginUpdateAsync(resourceGroupName, profileName, experimentName, parameters, context)
.getSyncPoller();
}
/**
* Updates an Experiment by Experiment id
*
* Updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment Update Model.
* @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 defines the properties of an Experiment on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String resourceGroupName, String profileName, String experimentName,
ExperimentUpdateModel parameters) {
return beginUpdateAsync(resourceGroupName, profileName, experimentName, parameters).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Updates an Experiment by Experiment id
*
* Updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment Update Model.
* @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 defines the properties of an Experiment on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String resourceGroupName, String profileName, String experimentName,
ExperimentUpdateModel parameters, Context context) {
return beginUpdateAsync(resourceGroupName, profileName, experimentName, parameters, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Updates an Experiment by Experiment id
*
* Updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment Update Model.
* @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 defines the properties of an Experiment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExperimentInner update(String resourceGroupName, String profileName, String experimentName,
ExperimentUpdateModel parameters) {
return updateAsync(resourceGroupName, profileName, experimentName, parameters).block();
}
/**
* Updates an Experiment by Experiment id
*
* Updates an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @param parameters The Experiment Update Model.
* @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 defines the properties of an Experiment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ExperimentInner update(String resourceGroupName, String profileName, String experimentName,
ExperimentUpdateModel parameters, Context context) {
return updateAsync(resourceGroupName, profileName, experimentName, parameters, context).block();
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 profileName,
String experimentName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (profileName == null) {
return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
}
final String apiVersion = "2019-11-01";
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(),
apiVersion, resourceGroupName, profileName, experimentName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 profileName,
String experimentName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (profileName == null) {
return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
}
if (experimentName == null) {
return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null."));
}
final String apiVersion = "2019-11-01";
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), apiVersion, resourceGroupName,
profileName, experimentName, accept, context);
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 profileName,
String experimentName) {
Mono>> mono = deleteWithResponseAsync(resourceGroupName, profileName, experimentName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 profileName,
String experimentName, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= deleteWithResponseAsync(resourceGroupName, profileName, experimentName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 profileName,
String experimentName) {
return this.beginDeleteAsync(resourceGroupName, profileName, experimentName).getSyncPoller();
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 profileName,
String experimentName, Context context) {
return this.beginDeleteAsync(resourceGroupName, profileName, experimentName, context).getSyncPoller();
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 profileName, String experimentName) {
return beginDeleteAsync(resourceGroupName, profileName, experimentName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 profileName, String experimentName,
Context context) {
return beginDeleteAsync(resourceGroupName, profileName, experimentName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 profileName, String experimentName) {
deleteAsync(resourceGroupName, profileName, experimentName).block();
}
/**
* Deletes an Experiment.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName The Profile identifier associated with the Tenant and Partner.
* @param experimentName The Experiment identifier associated with the Experiment.
* @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 profileName, String experimentName, Context context) {
deleteAsync(resourceGroupName, profileName, experimentName, context).block();
}
/**
* 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 defines a list of Experiments along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByProfileNextSinglePageAsync(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.listByProfileNext(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 defines a list of Experiments along with {@link PagedResponse} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByProfileNextSinglePageAsync(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.listByProfileNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy