
com.azure.resourcemanager.mixedreality.implementation.RemoteRenderingAccountsClientImpl Maven / Gradle / Ivy
Show all versions of azure-resourcemanager-mixedreality Show documentation
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.mixedreality.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.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.resourcemanager.mixedreality.fluent.RemoteRenderingAccountsClient;
import com.azure.resourcemanager.mixedreality.fluent.models.AccountKeysInner;
import com.azure.resourcemanager.mixedreality.fluent.models.RemoteRenderingAccountInner;
import com.azure.resourcemanager.mixedreality.models.AccountKeyRegenerateRequest;
import com.azure.resourcemanager.mixedreality.models.RemoteRenderingAccountPage;
import reactor.core.publisher.Mono;
/** An instance of this class provides access to all the operations defined in RemoteRenderingAccountsClient. */
public final class RemoteRenderingAccountsClientImpl implements RemoteRenderingAccountsClient {
/** The proxy service used to perform REST calls. */
private final RemoteRenderingAccountsService service;
/** The service client containing this operation class. */
private final MixedRealityClientImpl client;
/**
* Initializes an instance of RemoteRenderingAccountsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
RemoteRenderingAccountsClientImpl(MixedRealityClientImpl client) {
this.service =
RestProxy
.create(RemoteRenderingAccountsService.class, client.getHttpPipeline(), client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for MixedRealityClientRemoteRenderingAccounts to be used by the proxy
* service to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "MixedRealityClientRe")
public interface RemoteRenderingAccountsService {
@Headers({"Content-Type: application/json"})
@Get("/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/remoteRenderingAccounts")
@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.MixedReality"
+ "/remoteRenderingAccounts")
@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"})
@Delete(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality"
+ "/remoteRenderingAccounts/{accountName}")
@ExpectedResponses({200, 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,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Get(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality"
+ "/remoteRenderingAccounts/{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"})
@Patch(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality"
+ "/remoteRenderingAccounts/{accountName}")
@ExpectedResponses({200})
@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") RemoteRenderingAccountInner remoteRenderingAccount,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Put(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality"
+ "/remoteRenderingAccounts/{accountName}")
@ExpectedResponses({200, 201})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> create(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") RemoteRenderingAccountInner remoteRenderingAccount,
@HeaderParam("Accept") String accept,
Context context);
@Headers({"Content-Type: application/json"})
@Post(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality"
+ "/remoteRenderingAccounts/{accountName}/listKeys")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listKeys(
@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"})
@Post(
"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality"
+ "/remoteRenderingAccounts/{accountName}/regenerateKeys")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> regenerateKeys(
@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName,
@PathParam("accountName") String accountName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") AccountKeyRegenerateRequest regenerate,
@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);
}
/**
* List Remote Rendering Accounts by 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 request to get resource collection 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()));
}
/**
* List Remote Rendering Accounts by 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 result of the request to get resource collection 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));
}
/**
* List Remote Rendering Accounts by 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 request to get resource collection as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync() {
return new PagedFlux<>(
() -> listSinglePageAsync(), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink));
}
/**
* List Remote Rendering Accounts by 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 result of the request to get resource collection as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(Context context) {
return new PagedFlux<>(
() -> listSinglePageAsync(context), nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context));
}
/**
* List Remote Rendering Accounts by 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 request to get resource collection as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list() {
return new PagedIterable<>(listAsync());
}
/**
* List Remote Rendering Accounts by 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 result of the request to get resource collection as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(Context context) {
return new PagedIterable<>(listAsync(context));
}
/**
* List Resources by Resource Group.
*
* @param resourceGroupName Name of an Azure resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to get resource collection 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()));
}
/**
* List Resources by Resource Group.
*
* @param resourceGroupName Name of an Azure resource group.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to get resource collection 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));
}
/**
* List Resources by Resource Group.
*
* @param resourceGroupName Name of an Azure resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to get resource collection as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName) {
return new PagedFlux<>(
() -> listByResourceGroupSinglePageAsync(resourceGroupName),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink));
}
/**
* List Resources by Resource Group.
*
* @param resourceGroupName Name of an Azure resource group.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to get resource collection as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) {
return new PagedFlux<>(
() -> listByResourceGroupSinglePageAsync(resourceGroupName, context),
nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context));
}
/**
* List Resources by Resource Group.
*
* @param resourceGroupName Name of an Azure resource group.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to get resource collection as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName));
}
/**
* List Resources by Resource Group.
*
* @param resourceGroupName Name of an Azure resource group.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to get resource collection as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listByResourceGroup(String resourceGroupName, Context context) {
return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context));
}
/**
* Delete a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.delete(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
this.client.getApiVersion(),
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Delete a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.delete(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
this.client.getApiVersion(),
accept,
context);
}
/**
* Delete a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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 deleteWithResponseAsync(resourceGroupName, accountName).flatMap(ignored -> Mono.empty());
}
/**
* Delete a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteWithResponse(String resourceGroupName, String accountName, Context context) {
return deleteWithResponseAsync(resourceGroupName, accountName, context).block();
}
/**
* Delete a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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) {
deleteWithResponse(resourceGroupName, accountName, Context.NONE);
}
/**
* Retrieve a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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 remoteRenderingAccount Response 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()));
}
/**
* Retrieve a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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 remoteRenderingAccount Response 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);
}
/**
* Retrieve a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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 remoteRenderingAccount Response 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()));
}
/**
* Retrieve a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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 remoteRenderingAccount Response along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getByResourceGroupWithResponse(
String resourceGroupName, String accountName, Context context) {
return getByResourceGroupWithResponseAsync(resourceGroupName, accountName, context).block();
}
/**
* Retrieve a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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 remoteRenderingAccount Response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public RemoteRenderingAccountInner getByResourceGroup(String resourceGroupName, String accountName) {
return getByResourceGroupWithResponse(resourceGroupName, accountName, Context.NONE).getValue();
}
/**
* Updating a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param remoteRenderingAccount Remote Rendering Account 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 remoteRenderingAccount Response along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> updateWithResponseAsync(
String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount) {
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 (remoteRenderingAccount == null) {
return Mono
.error(
new IllegalArgumentException("Parameter remoteRenderingAccount is required and cannot be null."));
} else {
remoteRenderingAccount.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.update(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
this.client.getApiVersion(),
remoteRenderingAccount,
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Updating a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param remoteRenderingAccount Remote Rendering Account 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 remoteRenderingAccount Response along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> updateWithResponseAsync(
String resourceGroupName,
String accountName,
RemoteRenderingAccountInner remoteRenderingAccount,
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 (remoteRenderingAccount == null) {
return Mono
.error(
new IllegalArgumentException("Parameter remoteRenderingAccount is required and cannot be null."));
} else {
remoteRenderingAccount.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(),
remoteRenderingAccount,
accept,
context);
}
/**
* Updating a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param remoteRenderingAccount Remote Rendering Account 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 remoteRenderingAccount Response on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono updateAsync(
String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount) {
return updateWithResponseAsync(resourceGroupName, accountName, remoteRenderingAccount)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Updating a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param remoteRenderingAccount Remote Rendering Account 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 remoteRenderingAccount Response along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response updateWithResponse(
String resourceGroupName,
String accountName,
RemoteRenderingAccountInner remoteRenderingAccount,
Context context) {
return updateWithResponseAsync(resourceGroupName, accountName, remoteRenderingAccount, context).block();
}
/**
* Updating a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param remoteRenderingAccount Remote Rendering Account 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 remoteRenderingAccount Response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public RemoteRenderingAccountInner update(
String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount) {
return updateWithResponse(resourceGroupName, accountName, remoteRenderingAccount, Context.NONE).getValue();
}
/**
* Creating or Updating a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param remoteRenderingAccount Remote Rendering Account 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 remoteRenderingAccount Response along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> createWithResponseAsync(
String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount) {
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 (remoteRenderingAccount == null) {
return Mono
.error(
new IllegalArgumentException("Parameter remoteRenderingAccount is required and cannot be null."));
} else {
remoteRenderingAccount.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.create(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
this.client.getApiVersion(),
remoteRenderingAccount,
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Creating or Updating a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param remoteRenderingAccount Remote Rendering Account 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 remoteRenderingAccount Response along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> createWithResponseAsync(
String resourceGroupName,
String accountName,
RemoteRenderingAccountInner remoteRenderingAccount,
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 (remoteRenderingAccount == null) {
return Mono
.error(
new IllegalArgumentException("Parameter remoteRenderingAccount is required and cannot be null."));
} else {
remoteRenderingAccount.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.create(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
this.client.getApiVersion(),
remoteRenderingAccount,
accept,
context);
}
/**
* Creating or Updating a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param remoteRenderingAccount Remote Rendering Account 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 remoteRenderingAccount Response on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createAsync(
String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount) {
return createWithResponseAsync(resourceGroupName, accountName, remoteRenderingAccount)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Creating or Updating a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param remoteRenderingAccount Remote Rendering Account 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 remoteRenderingAccount Response along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response createWithResponse(
String resourceGroupName,
String accountName,
RemoteRenderingAccountInner remoteRenderingAccount,
Context context) {
return createWithResponseAsync(resourceGroupName, accountName, remoteRenderingAccount, context).block();
}
/**
* Creating or Updating a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param remoteRenderingAccount Remote Rendering Account 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 remoteRenderingAccount Response.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public RemoteRenderingAccountInner create(
String resourceGroupName, String accountName, RemoteRenderingAccountInner remoteRenderingAccount) {
return createWithResponse(resourceGroupName, accountName, remoteRenderingAccount, Context.NONE).getValue();
}
/**
* List Both of the 2 Keys of a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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 developer Keys of account along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listKeysWithResponseAsync(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
.listKeys(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
this.client.getApiVersion(),
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* List Both of the 2 Keys of a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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 developer Keys of account along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listKeysWithResponseAsync(
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
.listKeys(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
this.client.getApiVersion(),
accept,
context);
}
/**
* List Both of the 2 Keys of a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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 developer Keys of account on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono listKeysAsync(String resourceGroupName, String accountName) {
return listKeysWithResponseAsync(resourceGroupName, accountName)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* List Both of the 2 Keys of a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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 developer Keys of account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response listKeysWithResponse(
String resourceGroupName, String accountName, Context context) {
return listKeysWithResponseAsync(resourceGroupName, accountName, context).block();
}
/**
* List Both of the 2 Keys of a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality 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 developer Keys of account.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public AccountKeysInner listKeys(String resourceGroupName, String accountName) {
return listKeysWithResponse(resourceGroupName, accountName, Context.NONE).getValue();
}
/**
* Regenerate specified Key of a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param regenerate Required information for key regeneration.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return developer Keys of account along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> regenerateKeysWithResponseAsync(
String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate) {
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 (regenerate == null) {
return Mono.error(new IllegalArgumentException("Parameter regenerate is required and cannot be null."));
} else {
regenerate.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(
context ->
service
.regenerateKeys(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
this.client.getApiVersion(),
regenerate,
accept,
context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Regenerate specified Key of a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param regenerate Required information for key regeneration.
* @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 developer Keys of account along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> regenerateKeysWithResponseAsync(
String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate, 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 (regenerate == null) {
return Mono.error(new IllegalArgumentException("Parameter regenerate is required and cannot be null."));
} else {
regenerate.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.regenerateKeys(
this.client.getEndpoint(),
this.client.getSubscriptionId(),
resourceGroupName,
accountName,
this.client.getApiVersion(),
regenerate,
accept,
context);
}
/**
* Regenerate specified Key of a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param regenerate Required information for key regeneration.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return developer Keys of account on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono regenerateKeysAsync(
String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate) {
return regenerateKeysWithResponseAsync(resourceGroupName, accountName, regenerate)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Regenerate specified Key of a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param regenerate Required information for key regeneration.
* @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 developer Keys of account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response regenerateKeysWithResponse(
String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate, Context context) {
return regenerateKeysWithResponseAsync(resourceGroupName, accountName, regenerate, context).block();
}
/**
* Regenerate specified Key of a Remote Rendering Account.
*
* @param resourceGroupName Name of an Azure resource group.
* @param accountName Name of an Mixed Reality Account.
* @param regenerate Required information for key regeneration.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return developer Keys of account.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public AccountKeysInner regenerateKeys(
String resourceGroupName, String accountName, AccountKeyRegenerateRequest regenerate) {
return regenerateKeysWithResponse(resourceGroupName, accountName, regenerate, Context.NONE).getValue();
}
/**
* Get the next page of items.
*
* @param nextLink The URL to get the next list of items
* The nextLink parameter.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return result of the request to get resource collection 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 result of the request to get resource collection 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 result of the request to get resource collection 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
* 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 result of the request to get resource collection 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));
}
}