
com.azure.resourcemanager.netapp.implementation.AccountsClientImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-netapp Show documentation
Show all versions of azure-resourcemanager-netapp Show documentation
This package contains Microsoft Azure SDK for NetAppFiles Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-preview-2024-07-01-preview.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.netapp.implementation;
import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.Delete;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Headers;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.Patch;
import com.azure.core.annotation.PathParam;
import com.azure.core.annotation.Post;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.management.polling.PollResult;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.polling.PollerFlux;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.netapp.fluent.AccountsClient;
import com.azure.resourcemanager.netapp.fluent.models.NetAppAccountInner;
import com.azure.resourcemanager.netapp.models.EncryptionMigrationRequest;
import com.azure.resourcemanager.netapp.models.NetAppAccountList;
import com.azure.resourcemanager.netapp.models.NetAppAccountPatch;
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 AccountsClient.
*/
public final class AccountsClientImpl implements AccountsClient {
/**
* The proxy service used to perform REST calls.
*/
private final AccountsService service;
/**
* The service client containing this operation class.
*/
private final NetAppManagementClientImpl client;
/**
* Initializes an instance of AccountsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
AccountsClientImpl(NetAppManagementClientImpl client) {
this.service = RestProxy.create(AccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for NetAppManagementClientAccounts to be used by the proxy service to
* perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "NetAppManagementClie")
public interface AccountsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.NetApp/netAppAccounts")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> list(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listByResourceGroup(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getByResourceGroup(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> createOrUpdate(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion, @BodyParam("application/json") NetAppAccountInner body,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}")
@ExpectedResponses({ 202, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> delete(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion, Context context);
@Headers({ "Content-Type: application/json" })
@Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> update(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion, @BodyParam("application/json") NetAppAccountPatch body,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/renewCredentials")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> renewCredentials(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion, Context context);
@Headers({ "Content-Type: application/json" })
@Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.NetApp/netAppAccounts/{accountName}/migrateEncryption")
@ExpectedResponses({ 202 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono>> migrateEncryptionKey(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") EncryptionMigrationRequest body, @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> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink,
@HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context);
}
/**
* Describe all NetApp Accounts in a subscription
*
* List and describe all NetApp accounts in the 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 list of NetApp account resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync() {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(),
this.client.getApiVersion(), 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()));
}
/**
* Describe all NetApp Accounts in a subscription
*
* List and describe all NetApp accounts in the subscription.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of NetApp account resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono.error(new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept,
context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Describe all NetApp Accounts in a subscription
*
* List and describe all NetApp accounts in the 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 list of NetApp account resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync() {
return new PagedFlux<>(() -> listSinglePageAsync(),
nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
}
/**
* Describe all NetApp Accounts in a subscription
*
* List and describe all NetApp accounts in the subscription.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of NetApp account resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(Context context) {
return new PagedFlux<>(() -> listSinglePageAsync(context),
nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
}
/**
* Describe all NetApp Accounts in a subscription
*
* List and describe all NetApp accounts in the 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 list of NetApp account resources as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list() {
return new PagedIterable<>(listAsync());
}
/**
* Describe all NetApp Accounts in a subscription
*
* List and describe all NetApp accounts in the subscription.
*
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of NetApp account resources as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(Context context) {
return new PagedIterable<>(listAsync(context));
}
/**
* Describe all NetApp Accounts in a resource group
*
* List and describe all NetApp accounts in the 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 list of NetApp account resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (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.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), 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()));
}
/**
* Describe all NetApp Accounts in a resource group
*
* List and describe all NetApp accounts in the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of NetApp account resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName,
Context context) {
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (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.getSubscriptionId(), resourceGroupName,
this.client.getApiVersion(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
/**
* Describe all NetApp Accounts in a resource group
*
* List and describe all NetApp accounts in the 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 list of NetApp account resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName),
nextLink -> listNextSinglePageAsync(nextLink));
}
/**
* Describe all NetApp Accounts in a resource group
*
* List and describe all NetApp accounts in the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of NetApp account resources as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
nextLink -> listNextSinglePageAsync(nextLink, context));
}
/**
* Describe all NetApp Accounts in a resource group
*
* List and describe all NetApp accounts in the 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 list of NetApp account resources as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
}
/**
* Describe all NetApp Accounts in a resource group
*
* List and describe all NetApp accounts in the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of NetApp account resources as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
}
/**
* Describe a NetApp Account
*
* Get the NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 NetApp account along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
String accountName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Describe a NetApp Account
*
* Get the NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 NetApp account along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName,
String accountName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
accountName, this.client.getApiVersion(), accept, context);
}
/**
* Describe a NetApp Account
*
* Get the NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 NetApp account on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getByResourceGroupAsync(String resourceGroupName, String accountName) {
return getByResourceGroupWithResponseAsync(resourceGroupName, accountName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Describe a NetApp Account
*
* Get the NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 NetApp account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByResourceGroupWithResponse(String resourceGroupName, String accountName,
Context context) {
return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block();
}
/**
* Describe a NetApp Account
*
* Get the NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 NetApp account.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public NetAppAccountInner getByResourceGroup(String resourceGroupName, String accountName) {
return getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue();
}
/**
* Create or update a NetApp account
*
* Create or update the specified NetApp account within the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the 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 netApp account resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String accountName, NetAppAccountInner 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName 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.getSubscriptionId(),
resourceGroupName, accountName, this.client.getApiVersion(), body, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create or update a NetApp account
*
* Create or update the specified NetApp account within the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return netApp account resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName,
String accountName, NetAppAccountInner 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName 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.getSubscriptionId(), resourceGroupName,
accountName, this.client.getApiVersion(), body, accept, context);
}
/**
* Create or update a NetApp account
*
* Create or update the specified NetApp account within the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the 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 netApp account resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, NetAppAccountInner>
beginCreateOrUpdateAsync(String resourceGroupName, String accountName, NetAppAccountInner body) {
Mono>> mono = createOrUpdateWithResponseAsync(resourceGroupName, accountName, body);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
NetAppAccountInner.class, NetAppAccountInner.class, this.client.getContext());
}
/**
* Create or update a NetApp account
*
* Create or update the specified NetApp account within the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of netApp account resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, NetAppAccountInner> beginCreateOrUpdateAsync(
String resourceGroupName, String accountName, NetAppAccountInner body, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= createOrUpdateWithResponseAsync(resourceGroupName, accountName, body, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
NetAppAccountInner.class, NetAppAccountInner.class, context);
}
/**
* Create or update a NetApp account
*
* Create or update the specified NetApp account within the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the 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 netApp account resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, NetAppAccountInner> beginCreateOrUpdate(String resourceGroupName,
String accountName, NetAppAccountInner body) {
return this.beginCreateOrUpdateAsync(resourceGroupName, accountName, body).getSyncPoller();
}
/**
* Create or update a NetApp account
*
* Create or update the specified NetApp account within the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of netApp account resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, NetAppAccountInner> beginCreateOrUpdate(String resourceGroupName,
String accountName, NetAppAccountInner body, Context context) {
return this.beginCreateOrUpdateAsync(resourceGroupName, accountName, body, context).getSyncPoller();
}
/**
* Create or update a NetApp account
*
* Create or update the specified NetApp account within the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the 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 netApp account resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String resourceGroupName, String accountName,
NetAppAccountInner body) {
return beginCreateOrUpdateAsync(resourceGroupName, accountName, body).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update a NetApp account
*
* Create or update the specified NetApp account within the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return netApp account resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String resourceGroupName, String accountName,
NetAppAccountInner body, Context context) {
return beginCreateOrUpdateAsync(resourceGroupName, accountName, body, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Create or update a NetApp account
*
* Create or update the specified NetApp account within the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the 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 netApp account resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public NetAppAccountInner createOrUpdate(String resourceGroupName, String accountName, NetAppAccountInner body) {
return createOrUpdateAsync(resourceGroupName, accountName, body).block();
}
/**
* Create or update a NetApp account
*
* Create or update the specified NetApp account within the resource group.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return netApp account resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public NetAppAccountInner createOrUpdate(String resourceGroupName, String accountName, NetAppAccountInner body,
Context context) {
return createOrUpdateAsync(resourceGroupName, accountName, body, context).block();
}
/**
* Delete a NetApp account
*
* Delete the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 accountName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
return FluxUtil
.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, this.client.getApiVersion(), context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete a NetApp account
*
* Delete the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 accountName,
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
accountName, this.client.getApiVersion(), context);
}
/**
* Delete a NetApp account
*
* Delete the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 accountName) {
Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Delete a NetApp account
*
* Delete the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 accountName,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Delete a NetApp account
*
* Delete the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 accountName) {
return this.beginDeleteAsync(resourceGroupName, accountName).getSyncPoller();
}
/**
* Delete a NetApp account
*
* Delete the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 accountName,
Context context) {
return this.beginDeleteAsync(resourceGroupName, accountName, context).getSyncPoller();
}
/**
* Delete a NetApp account
*
* Delete the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 accountName) {
return beginDeleteAsync(resourceGroupName, accountName).last().flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a NetApp account
*
* Delete the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 accountName, Context context) {
return beginDeleteAsync(resourceGroupName, accountName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Delete a NetApp account
*
* Delete the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 accountName) {
deleteAsync(resourceGroupName, accountName).block();
}
/**
* Delete a NetApp account
*
* Delete the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 accountName, Context context) {
deleteAsync(resourceGroupName, accountName, context).block();
}
/**
* Update a NetApp account
*
* Patch the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the 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 netApp account resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName,
NetAppAccountPatch 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName 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.getSubscriptionId(),
resourceGroupName, accountName, this.client.getApiVersion(), body, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Update a NetApp account
*
* Patch the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return netApp account resource along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName,
NetAppAccountPatch 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName 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.getSubscriptionId(), resourceGroupName,
accountName, this.client.getApiVersion(), body, accept, context);
}
/**
* Update a NetApp account
*
* Patch the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the 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 netApp account resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, NetAppAccountInner> beginUpdateAsync(String resourceGroupName,
String accountName, NetAppAccountPatch body) {
Mono>> mono = updateWithResponseAsync(resourceGroupName, accountName, body);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
NetAppAccountInner.class, NetAppAccountInner.class, this.client.getContext());
}
/**
* Update a NetApp account
*
* Patch the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link PollerFlux} for polling of netApp account resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
private PollerFlux, NetAppAccountInner> beginUpdateAsync(String resourceGroupName,
String accountName, NetAppAccountPatch body, Context context) {
context = this.client.mergeContext(context);
Mono>> mono = updateWithResponseAsync(resourceGroupName, accountName, body, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(),
NetAppAccountInner.class, NetAppAccountInner.class, context);
}
/**
* Update a NetApp account
*
* Patch the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the 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 netApp account resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, NetAppAccountInner> beginUpdate(String resourceGroupName,
String accountName, NetAppAccountPatch body) {
return this.beginUpdateAsync(resourceGroupName, accountName, body).getSyncPoller();
}
/**
* Update a NetApp account
*
* Patch the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the {@link SyncPoller} for polling of netApp account resource.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
public SyncPoller, NetAppAccountInner> beginUpdate(String resourceGroupName,
String accountName, NetAppAccountPatch body, Context context) {
return this.beginUpdateAsync(resourceGroupName, accountName, body, context).getSyncPoller();
}
/**
* Update a NetApp account
*
* Patch the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the 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 netApp account resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String resourceGroupName, String accountName,
NetAppAccountPatch body) {
return beginUpdateAsync(resourceGroupName, accountName, body).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update a NetApp account
*
* Patch the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return netApp account resource on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(String resourceGroupName, String accountName, NetAppAccountPatch body,
Context context) {
return beginUpdateAsync(resourceGroupName, accountName, body, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Update a NetApp account
*
* Patch the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the 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 netApp account resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public NetAppAccountInner update(String resourceGroupName, String accountName, NetAppAccountPatch body) {
return updateAsync(resourceGroupName, accountName, body).block();
}
/**
* Update a NetApp account
*
* Patch the specified NetApp account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body NetApp Account object supplied in the body of the operation.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return netApp account resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public NetAppAccountInner update(String resourceGroupName, String accountName, NetAppAccountPatch body,
Context context) {
return updateAsync(resourceGroupName, accountName, body, context).block();
}
/**
* Renew identity credentials
*
* Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If
* encryption.identity.principalId does not match identity.principalId, running this operation will fix it.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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>> renewCredentialsWithResponseAsync(String resourceGroupName,
String accountName) {
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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
return FluxUtil
.withContext(context -> service.renewCredentials(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, this.client.getApiVersion(), context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Renew identity credentials
*
* Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If
* encryption.identity.principalId does not match identity.principalId, running this operation will fix it.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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>> renewCredentialsWithResponseAsync(String resourceGroupName,
String accountName, 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
context = this.client.mergeContext(context);
return service.renewCredentials(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
accountName, this.client.getApiVersion(), context);
}
/**
* Renew identity credentials
*
* Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If
* encryption.identity.principalId does not match identity.principalId, running this operation will fix it.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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> beginRenewCredentialsAsync(String resourceGroupName,
String accountName) {
Mono>> mono = renewCredentialsWithResponseAsync(resourceGroupName, accountName);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Renew identity credentials
*
* Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If
* encryption.identity.principalId does not match identity.principalId, running this operation will fix it.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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> beginRenewCredentialsAsync(String resourceGroupName, String accountName,
Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= renewCredentialsWithResponseAsync(resourceGroupName, accountName, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Renew identity credentials
*
* Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If
* encryption.identity.principalId does not match identity.principalId, running this operation will fix it.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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> beginRenewCredentials(String resourceGroupName, String accountName) {
return this.beginRenewCredentialsAsync(resourceGroupName, accountName).getSyncPoller();
}
/**
* Renew identity credentials
*
* Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If
* encryption.identity.principalId does not match identity.principalId, running this operation will fix it.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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> beginRenewCredentials(String resourceGroupName, String accountName,
Context context) {
return this.beginRenewCredentialsAsync(resourceGroupName, accountName, context).getSyncPoller();
}
/**
* Renew identity credentials
*
* Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If
* encryption.identity.principalId does not match identity.principalId, running this operation will fix it.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 renewCredentialsAsync(String resourceGroupName, String accountName) {
return beginRenewCredentialsAsync(resourceGroupName, accountName).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Renew identity credentials
*
* Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If
* encryption.identity.principalId does not match identity.principalId, running this operation will fix it.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 renewCredentialsAsync(String resourceGroupName, String accountName, Context context) {
return beginRenewCredentialsAsync(resourceGroupName, accountName, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Renew identity credentials
*
* Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If
* encryption.identity.principalId does not match identity.principalId, running this operation will fix it.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 renewCredentials(String resourceGroupName, String accountName) {
renewCredentialsAsync(resourceGroupName, accountName).block();
}
/**
* Renew identity credentials
*
* Renew identity credentials that are used to authenticate to key vault, for customer-managed key encryption. If
* encryption.identity.principalId does not match identity.principalId, running this operation will fix it.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 renewCredentials(String resourceGroupName, String accountName, Context context) {
renewCredentialsAsync(resourceGroupName, accountName, context).block();
}
/**
* Migrate volumes encryption key source.
*
* Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault).
* Operation fails if targeted volumes share encryption sibling set with volumes from another account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body The required parameters to perform encryption migration.
* @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>> migrateEncryptionKeyWithResponseAsync(String resourceGroupName,
String accountName, EncryptionMigrationRequest 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (body != null) {
body.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.migrateEncryptionKey(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, this.client.getApiVersion(), body, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Migrate volumes encryption key source.
*
* Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault).
* Operation fails if targeted volumes share encryption sibling set with volumes from another account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body The required parameters to perform encryption migration.
* @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>> migrateEncryptionKeyWithResponseAsync(String resourceGroupName,
String accountName, EncryptionMigrationRequest 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 (accountName == null) {
return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null."));
}
if (body != null) {
body.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.migrateEncryptionKey(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, accountName, this.client.getApiVersion(), body, accept, context);
}
/**
* Migrate volumes encryption key source.
*
* Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault).
* Operation fails if targeted volumes share encryption sibling set with volumes from another account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body The required parameters to perform encryption migration.
* @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> beginMigrateEncryptionKeyAsync(String resourceGroupName,
String accountName, EncryptionMigrationRequest body) {
Mono>> mono
= migrateEncryptionKeyWithResponseAsync(resourceGroupName, accountName, body);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Migrate volumes encryption key source.
*
* Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault).
* Operation fails if targeted volumes share encryption sibling set with volumes from another account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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> beginMigrateEncryptionKeyAsync(String resourceGroupName,
String accountName) {
final EncryptionMigrationRequest body = null;
Mono>> mono
= migrateEncryptionKeyWithResponseAsync(resourceGroupName, accountName, body);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
this.client.getContext());
}
/**
* Migrate volumes encryption key source.
*
* Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault).
* Operation fails if targeted volumes share encryption sibling set with volumes from another account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body The required parameters to perform encryption migration.
* @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> beginMigrateEncryptionKeyAsync(String resourceGroupName,
String accountName, EncryptionMigrationRequest body, Context context) {
context = this.client.mergeContext(context);
Mono>> mono
= migrateEncryptionKeyWithResponseAsync(resourceGroupName, accountName, body, context);
return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class,
context);
}
/**
* Migrate volumes encryption key source.
*
* Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault).
* Operation fails if targeted volumes share encryption sibling set with volumes from another account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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> beginMigrateEncryptionKey(String resourceGroupName, String accountName) {
final EncryptionMigrationRequest body = null;
return this.beginMigrateEncryptionKeyAsync(resourceGroupName, accountName, body).getSyncPoller();
}
/**
* Migrate volumes encryption key source.
*
* Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault).
* Operation fails if targeted volumes share encryption sibling set with volumes from another account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body The required parameters to perform encryption migration.
* @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> beginMigrateEncryptionKey(String resourceGroupName, String accountName,
EncryptionMigrationRequest body, Context context) {
return this.beginMigrateEncryptionKeyAsync(resourceGroupName, accountName, body, context).getSyncPoller();
}
/**
* Migrate volumes encryption key source.
*
* Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault).
* Operation fails if targeted volumes share encryption sibling set with volumes from another account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body The required parameters to perform encryption migration.
* @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 migrateEncryptionKeyAsync(String resourceGroupName, String accountName,
EncryptionMigrationRequest body) {
return beginMigrateEncryptionKeyAsync(resourceGroupName, accountName, body).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate volumes encryption key source.
*
* Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault).
* Operation fails if targeted volumes share encryption sibling set with volumes from another account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 migrateEncryptionKeyAsync(String resourceGroupName, String accountName) {
final EncryptionMigrationRequest body = null;
return beginMigrateEncryptionKeyAsync(resourceGroupName, accountName, body).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate volumes encryption key source.
*
* Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault).
* Operation fails if targeted volumes share encryption sibling set with volumes from another account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body The required parameters to perform encryption migration.
* @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 migrateEncryptionKeyAsync(String resourceGroupName, String accountName,
EncryptionMigrationRequest body, Context context) {
return beginMigrateEncryptionKeyAsync(resourceGroupName, accountName, body, context).last()
.flatMap(this.client::getLroFinalResultOrError);
}
/**
* Migrate volumes encryption key source.
*
* Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault).
* Operation fails if targeted volumes share encryption sibling set with volumes from another account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @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 migrateEncryptionKey(String resourceGroupName, String accountName) {
final EncryptionMigrationRequest body = null;
migrateEncryptionKeyAsync(resourceGroupName, accountName, body).block();
}
/**
* Migrate volumes encryption key source.
*
* Migrates all volumes in a VNet to a different encryption key source (Microsoft-managed key or Azure Key Vault).
* Operation fails if targeted volumes share encryption sibling set with volumes from another account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of the NetApp account.
* @param body The required parameters to perform encryption migration.
* @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 migrateEncryptionKey(String resourceGroupName, String accountName, EncryptionMigrationRequest body,
Context context) {
migrateEncryptionKeyAsync(resourceGroupName, accountName, body, context).block();
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of NetApp account resources 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
*
* The nextLink parameter.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of NetApp account resources 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
*
* The nextLink parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of NetApp account resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listNextSinglePageAsync(String nextLink) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items
*
* The nextLink parameter.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return list of NetApp account resources along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listNextSinglePageAsync(String nextLink, Context context) {
if (nextLink == null) {
return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null."));
}
if (this.client.getEndpoint() == null) {
return Mono.error(
new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.listNext(nextLink, this.client.getEndpoint(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), res.getValue().nextLink(), null));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy