
com.azure.resourcemanager.devcenter.implementation.DevCentersClientImpl 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.devcenter.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.devcenter.fluent.DevCentersClient;
import com.azure.resourcemanager.devcenter.fluent.models.DevCenterInner;
import com.azure.resourcemanager.devcenter.models.DevCenterListResult;
import com.azure.resourcemanager.devcenter.models.DevCenterUpdate;
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 DevCentersClient.
*/
public final class DevCentersClientImpl implements DevCentersClient {
/**
* The proxy service used to perform REST calls.
*/
private final DevCentersService service;
/**
* The service client containing this operation class.
*/
private final DevCenterManagementClientImpl client;
/**
* Initializes an instance of DevCentersClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
DevCentersClientImpl(DevCenterManagementClientImpl client) {
this.service
= RestProxy.create(DevCentersService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for DevCenterManagementClientDevCenters to be used by the proxy service
* to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "DevCenterManagementC")
public interface DevCentersService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.DevCenter/devcenters")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> list(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@QueryParam("$top") Integer top, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByResourceGroup(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @QueryParam("$top") Integer top,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getByResourceGroup(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdate(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName,
@BodyParam("application/json") DevCenterInner body, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> update(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName,
@BodyParam("application/json") DevCenterUpdate body, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DevCenter/devcenters/{devCenterName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> delete(@HostParam("$host") String endpoint,
@QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("devCenterName") String devCenterName,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("{nextLink}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listBySubscriptionNext(
@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> listByResourceGroupNext(
@PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint,
@HeaderParam("Accept") String accept, Context context);
}
/**
* Lists all devcenters in a subscription.
*
* @param top The maximum number of resources to return from the operation. Example: '$top=10'.
* @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 result of the list devcenters operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(Integer top) {
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 accept = "application/json";
return FluxUtil
.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), top, 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 devcenters in a subscription.
*
* @param top The maximum number of resources to return from the operation. Example: '$top=10'.
* @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 result of the list devcenters operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(Integer top, 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 accept = "application/json";
context = this.client.mergeContext(context);
return service
.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), top, accept,
context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Lists all devcenters in a subscription.
*
* @param top The maximum number of resources to return from the operation. Example: '$top=10'.
* @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 result of the list devcenters operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(Integer top) {
return new PagedFlux<>(() -> listSinglePageAsync(top),
nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
}
/**
* Lists all devcenters 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 result of the list devcenters operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync() {
final Integer top = null;
return new PagedFlux<>(() -> listSinglePageAsync(top),
nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
}
/**
* Lists all devcenters in a subscription.
*
* @param top The maximum number of resources to return from the operation. Example: '$top=10'.
* @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 result of the list devcenters operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(Integer top, Context context) {
return new PagedFlux<>(() -> listSinglePageAsync(top, context),
nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
}
/**
* Lists all devcenters 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 result of the list devcenters operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list() {
final Integer top = null;
return new PagedIterable<>(listAsync(top));
}
/**
* Lists all devcenters in a subscription.
*
* @param top The maximum number of resources to return from the operation. Example: '$top=10'.
* @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 result of the list devcenters operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(Integer top, Context context) {
return new PagedIterable<>(listAsync(top, context));
}
/**
* Lists all devcenters in a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param top The maximum number of resources to return from the operation. Example: '$top=10'.
* @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 result of the list devcenters operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
Integer top) {
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."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, top, 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 devcenters in a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param top The maximum number of resources to return from the operation. Example: '$top=10'.
* @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 result of the list devcenters operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
Integer top, 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."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, top, accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Lists all devcenters in a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param top The maximum number of resources to return from the operation. Example: '$top=10'.
* @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 result of the list devcenters operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top) {
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, top),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
}
/**
* Lists all devcenters in a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @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 result of the list devcenters operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
final Integer top = null;
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, top),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
}
/**
* Lists all devcenters in a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param top The maximum number of resources to return from the operation. Example: '$top=10'.
* @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 result of the list devcenters operation as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName, Integer top, Context context) {
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, top, context),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
}
/**
* Lists all devcenters in a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @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 result of the list devcenters operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName) {
final Integer top = null;
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top));
}
/**
* Lists all devcenters in a resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param top The maximum number of resources to return from the operation. Example: '$top=10'.
* @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 result of the list devcenters operation as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName, Integer top, Context context) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, top, context));
}
/**
* Gets a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devcenter along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
String devCenterName) {
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 (devCenterName == null) {
return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, devCenterName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Gets a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devcenter along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
String devCenterName, 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 (devCenterName == null) {
return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, devCenterName, accept, context);
}
/**
* Gets a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devcenter on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getByResourceGroupAsync(String resourceGroupName, String devCenterName) {
return getByResourceGroupWithResponseAsync(resourceGroupName, devCenterName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Gets a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devcenter along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByResourceGroupWithResponse(String resourceGroupName, String devCenterName,
Context context) {
return getByResourceGroupWithResponseAsync(resourceGroupName, devCenterName, context).block();
}
/**
* Gets a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devcenter.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DevCenterInner getByResourceGroup(String resourceGroupName, String devCenterName) {
return getByResourceGroupWithResponse(resourceGroupName, devCenterName, Context.NONE).getValue();
}
/**
* Creates or updates a devcenter resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Represents a devcenter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return represents a devcenter resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String devCenterName, DevCenterInner body) {
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 (devCenterName == null) {
return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null."));
}
if (body == null) {
return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
} else {
body.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, devCenterName, body, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Creates or updates a devcenter resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Represents a devcenter.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return represents a devcenter resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String devCenterName, DevCenterInner body, 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 (devCenterName == null) {
return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null."));
}
if (body == null) {
return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
} else {
body.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, devCenterName, body, accept, context);
}
/**
* Creates or updates a devcenter resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Represents a devcenter.
* @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 represents a devcenter resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DevCenterInner> beginCreateOrUpdateAsync(String resourceGroupName,
String devCenterName, DevCenterInner body) {
Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, devCenterName, body);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
DevCenterInner.class, DevCenterInner.class, this.client.getContext());
}
/**
* Creates or updates a devcenter resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Represents a devcenter.
* @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 represents a devcenter resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DevCenterInner> beginCreateOrUpdateAsync(String resourceGroupName,
String devCenterName, DevCenterInner body, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createOrUpdateWithResponseAsync(resourceGroupName, devCenterName, body, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
DevCenterInner.class, DevCenterInner.class, context);
}
/**
* Creates or updates a devcenter resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Represents a devcenter.
* @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 represents a devcenter resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DevCenterInner> beginCreateOrUpdate(String resourceGroupName,
String devCenterName, DevCenterInner body) {
return this.beginCreateOrUpdateAsync(resourceGroupName, devCenterName, body).getSyncPoller();
}
/**
* Creates or updates a devcenter resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Represents a devcenter.
* @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 represents a devcenter resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DevCenterInner> beginCreateOrUpdate(String resourceGroupName,
String devCenterName, DevCenterInner body, Context context) {
return this.beginCreateOrUpdateAsync(resourceGroupName, devCenterName, body, context).getSyncPoller();
}
/**
* Creates or updates a devcenter resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Represents a devcenter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return represents a devcenter resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String resourceGroupName, String devCenterName,
DevCenterInner body) {
return beginCreateOrUpdateAsync(resourceGroupName, devCenterName, body).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Creates or updates a devcenter resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Represents a devcenter.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return represents a devcenter resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String resourceGroupName, String devCenterName,
DevCenterInner body, Context context) {
return beginCreateOrUpdateAsync(resourceGroupName, devCenterName, body, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Creates or updates a devcenter resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Represents a devcenter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return represents a devcenter resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DevCenterInner createOrUpdate(String resourceGroupName, String devCenterName, DevCenterInner body) {
return createOrUpdateAsync(resourceGroupName, devCenterName, body).block();
}
/**
* Creates or updates a devcenter resource.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Represents a devcenter.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return represents a devcenter resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DevCenterInner createOrUpdate(String resourceGroupName, String devCenterName, DevCenterInner body,
Context context) {
return createOrUpdateAsync(resourceGroupName, devCenterName, body, context).block();
}
/**
* Partially updates a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Updatable devcenter properties.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return represents a devcenter resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateWithResponseAsync(String resourceGroupName, String devCenterName,
DevCenterUpdate body) {
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 (devCenterName == null) {
return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null."));
}
if (body == null) {
return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
} else {
body.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, devCenterName, body, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Partially updates a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Updatable devcenter properties.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return represents a devcenter resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateWithResponseAsync(String resourceGroupName, String devCenterName,
DevCenterUpdate body, 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 (devCenterName == null) {
return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null."));
}
if (body == null) {
return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null."));
} else {
body.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, devCenterName, body, accept, context);
}
/**
* Partially updates a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Updatable devcenter properties.
* @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 represents a devcenter resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DevCenterInner> beginUpdateAsync(String resourceGroupName,
String devCenterName, DevCenterUpdate body) {
Mono>> mono = updateWithResponseAsync(resourceGroupName, devCenterName, body);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
DevCenterInner.class, DevCenterInner.class, this.client.getContext());
}
/**
* Partially updates a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Updatable devcenter properties.
* @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 represents a devcenter resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, DevCenterInner> beginUpdateAsync(String resourceGroupName,
String devCenterName, DevCenterUpdate body, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= updateWithResponseAsync(resourceGroupName, devCenterName, body, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
DevCenterInner.class, DevCenterInner.class, context);
}
/**
* Partially updates a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Updatable devcenter properties.
* @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 represents a devcenter resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DevCenterInner> beginUpdate(String resourceGroupName,
String devCenterName, DevCenterUpdate body) {
return this.beginUpdateAsync(resourceGroupName, devCenterName, body).getSyncPoller();
}
/**
* Partially updates a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Updatable devcenter properties.
* @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 represents a devcenter resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, DevCenterInner> beginUpdate(String resourceGroupName,
String devCenterName, DevCenterUpdate body, Context context) {
return this.beginUpdateAsync(resourceGroupName, devCenterName, body, context).getSyncPoller();
}
/**
* Partially updates a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Updatable devcenter properties.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return represents a devcenter resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String resourceGroupName, String devCenterName, DevCenterUpdate body) {
return beginUpdateAsync(resourceGroupName, devCenterName, body).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Partially updates a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Updatable devcenter properties.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return represents a devcenter resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String resourceGroupName, String devCenterName, DevCenterUpdate body,
Context context) {
return beginUpdateAsync(resourceGroupName, devCenterName, body, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Partially updates a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Updatable devcenter properties.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return represents a devcenter resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DevCenterInner update(String resourceGroupName, String devCenterName, DevCenterUpdate body) {
return updateAsync(resourceGroupName, devCenterName, body).block();
}
/**
* Partially updates a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @param body Updatable devcenter properties.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return represents a devcenter resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public DevCenterInner update(String resourceGroupName, String devCenterName, DevCenterUpdate body,
Context context) {
return updateAsync(resourceGroupName, devCenterName, body, context).block();
}
/**
* Deletes a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devCenterName) {
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 (devCenterName == null) {
return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(),
this.client.getSubscriptionId(), resourceGroupName, devCenterName, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Deletes a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devCenterName,
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 (devCenterName == null) {
return Mono.error(new IllegalArgumentException("Parameter devCenterName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(),
resourceGroupName, devCenterName, accept, context);
}
/**
* Deletes a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devCenterName) {
Mono>> mono = deleteWithResponseAsync(resourceGroupName, devCenterName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Deletes a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devCenterName,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono = deleteWithResponseAsync(resourceGroupName, devCenterName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Deletes a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devCenterName) {
return this.beginDeleteAsync(resourceGroupName, devCenterName).getSyncPoller();
}
/**
* Deletes a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devCenterName,
Context context) {
return this.beginDeleteAsync(resourceGroupName, devCenterName, context).getSyncPoller();
}
/**
* Deletes a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devCenterName) {
return beginDeleteAsync(resourceGroupName, devCenterName).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devCenterName, Context context) {
return beginDeleteAsync(resourceGroupName, devCenterName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Deletes a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devCenterName) {
deleteAsync(resourceGroupName, devCenterName).block();
}
/**
* Deletes a devcenter.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param devCenterName The name of the devcenter.
* @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 devCenterName, Context context) {
deleteAsync(resourceGroupName, devCenterName, 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 result of the list devcenters operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(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 result of the list devcenters operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listBySubscriptionNextSinglePageAsync(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.listBySubscriptionNext(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 result of the list devcenters operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(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 result of the list devcenters operation along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupNextSinglePageAsync(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.listByResourceGroupNext(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