
com.azure.resourcemanager.maintenance.implementation.ConfigurationAssignmentsClientImpl Maven / Gradle / Ivy
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.maintenance.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.PathParam;
import com.azure.core.annotation.Put;
import com.azure.core.annotation.QueryParam;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceInterface;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.annotation.UnexpectedResponseExceptionType;
import com.azure.core.http.rest.PagedFlux;
import com.azure.core.http.rest.PagedIterable;
import com.azure.core.http.rest.PagedResponse;
import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.management.exception.ManagementException;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.resourcemanager.maintenance.fluent.ConfigurationAssignmentsClient;
import com.azure.resourcemanager.maintenance.fluent.models.ConfigurationAssignmentInner;
import com.azure.resourcemanager.maintenance.models.ListConfigurationAssignmentsResult;
import reactor.core.publisher.Mono;
/**
* An instance of this class provides access to all the operations defined in ConfigurationAssignmentsClient.
*/
public final class ConfigurationAssignmentsClientImpl implements ConfigurationAssignmentsClient {
/**
* The proxy service used to perform REST calls.
*/
private final ConfigurationAssignmentsService service;
/**
* The service client containing this operation class.
*/
private final MaintenanceManagementClientImpl client;
/**
* Initializes an instance of ConfigurationAssignmentsClientImpl.
*
* @param client the instance of the service client containing this operation class.
*/
ConfigurationAssignmentsClientImpl(MaintenanceManagementClientImpl client) {
this.service = RestProxy.create(ConfigurationAssignmentsService.class, client.getHttpPipeline(),
client.getSerializerAdapter());
this.client = client;
}
/**
* The interface defining all the services for MaintenanceManagementClientConfigurationAssignments to be used by the
* proxy service to perform REST calls.
*/
@Host("{$host}")
@ServiceInterface(name = "MaintenanceManagemen")
public interface ConfigurationAssignmentsService {
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> getParent(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName,
@PathParam("resourceParentType") String resourceParentType,
@PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType,
@PathParam("resourceName") String resourceName,
@PathParam("configurationAssignmentName") String configurationAssignmentName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> createOrUpdateParent(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName,
@PathParam("resourceParentType") String resourceParentType,
@PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType,
@PathParam("resourceName") String resourceName,
@PathParam("configurationAssignmentName") String configurationAssignmentName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}")
@ExpectedResponses({ 200, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> deleteParent(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName,
@PathParam("resourceParentType") String resourceParentType,
@PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType,
@PathParam("resourceName") String resourceName,
@PathParam("configurationAssignmentName") String configurationAssignmentName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> get(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName,
@PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName,
@PathParam("configurationAssignmentName") String configurationAssignmentName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Put("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}")
@ExpectedResponses({ 200, 201 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> createOrUpdate(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName,
@PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName,
@PathParam("configurationAssignmentName") String configurationAssignmentName,
@QueryParam("api-version") String apiVersion,
@BodyParam("application/json") ConfigurationAssignmentInner configurationAssignment,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Delete("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments/{configurationAssignmentName}")
@ExpectedResponses({ 200, 204 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> delete(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName,
@PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName,
@PathParam("configurationAssignmentName") String configurationAssignmentName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceParentType}/{resourceParentName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> listParent(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName,
@PathParam("resourceParentType") String resourceParentType,
@PathParam("resourceParentName") String resourceParentName, @PathParam("resourceType") String resourceType,
@PathParam("resourceName") String resourceName, @QueryParam("api-version") String apiVersion,
@HeaderParam("Accept") String accept, Context context);
@Headers({ "Content-Type: application/json" })
@Get("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{providerName}/{resourceType}/{resourceName}/providers/Microsoft.Maintenance/configurationAssignments")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(ManagementException.class)
Mono> list(@HostParam("$host") String endpoint,
@PathParam("subscriptionId") String subscriptionId,
@PathParam("resourceGroupName") String resourceGroupName, @PathParam("providerName") String providerName,
@PathParam("resourceType") String resourceType, @PathParam("resourceName") String resourceName,
@QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context);
}
/**
* Get configuration assignment
*
* Get configuration assignment for resource..
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration assignment for resource. along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getParentWithResponseAsync(String resourceGroupName,
String providerName, String resourceParentType, String resourceParentName, String resourceType,
String resourceName, String configurationAssignmentName) {
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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceParentType == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null."));
}
if (resourceParentName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (configurationAssignmentName == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.getParent(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName,
configurationAssignmentName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get configuration assignment
*
* Get configuration assignment for resource..
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @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 configuration assignment for resource. along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getParentWithResponseAsync(String resourceGroupName,
String providerName, String resourceParentType, String resourceParentName, String resourceType,
String resourceName, String configurationAssignmentName, 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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceParentType == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null."));
}
if (resourceParentName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (configurationAssignmentName == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.getParent(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
providerName, resourceParentType, resourceParentName, resourceType, resourceName,
configurationAssignmentName, this.client.getApiVersion(), accept, context);
}
/**
* Get configuration assignment
*
* Get configuration assignment for resource..
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration assignment for resource. on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getParentAsync(String resourceGroupName, String providerName,
String resourceParentType, String resourceParentName, String resourceType, String resourceName,
String configurationAssignmentName) {
return getParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName,
resourceType, resourceName, configurationAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get configuration assignment
*
* Get configuration assignment for resource..
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @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 configuration assignment for resource. along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getParentWithResponse(String resourceGroupName, String providerName,
String resourceParentType, String resourceParentName, String resourceType, String resourceName,
String configurationAssignmentName, Context context) {
return getParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName,
resourceType, resourceName, configurationAssignmentName, context).block();
}
/**
* Get configuration assignment
*
* Get configuration assignment for resource..
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration assignment for resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ConfigurationAssignmentInner getParent(String resourceGroupName, String providerName,
String resourceParentType, String resourceParentName, String resourceType, String resourceName,
String configurationAssignmentName) {
return getParentWithResponse(resourceGroupName, providerName, resourceParentType, resourceParentName,
resourceType, resourceName, configurationAssignmentName, Context.NONE).getValue();
}
/**
* Create configuration assignment
*
* Register configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @param configurationAssignment The configurationAssignment.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> createOrUpdateParentWithResponseAsync(String resourceGroupName,
String providerName, String resourceParentType, String resourceParentName, String resourceType,
String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) {
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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceParentType == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null."));
}
if (resourceParentName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (configurationAssignmentName == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null."));
}
if (configurationAssignment == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null."));
} else {
configurationAssignment.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.createOrUpdateParent(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName,
configurationAssignmentName, this.client.getApiVersion(), configurationAssignment, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create configuration assignment
*
* Register configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @param configurationAssignment The configurationAssignment.
* @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 configuration Assignment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> createOrUpdateParentWithResponseAsync(String resourceGroupName,
String providerName, String resourceParentType, String resourceParentName, String resourceType,
String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment,
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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceParentType == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null."));
}
if (resourceParentName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (configurationAssignmentName == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null."));
}
if (configurationAssignment == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null."));
} else {
configurationAssignment.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdateParent(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName,
configurationAssignmentName, this.client.getApiVersion(), configurationAssignment, accept, context);
}
/**
* Create configuration assignment
*
* Register configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @param configurationAssignment The configurationAssignment.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration Assignment on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateParentAsync(String resourceGroupName, String providerName,
String resourceParentType, String resourceParentName, String resourceType, String resourceName,
String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) {
return createOrUpdateParentWithResponseAsync(resourceGroupName, providerName, resourceParentType,
resourceParentName, resourceType, resourceName, configurationAssignmentName, configurationAssignment)
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Create configuration assignment
*
* Register configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @param configurationAssignment The configurationAssignment.
* @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 configuration Assignment along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response createOrUpdateParentWithResponse(String resourceGroupName,
String providerName, String resourceParentType, String resourceParentName, String resourceType,
String resourceName, String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment,
Context context) {
return createOrUpdateParentWithResponseAsync(resourceGroupName, providerName, resourceParentType,
resourceParentName, resourceType, resourceName, configurationAssignmentName, configurationAssignment,
context).block();
}
/**
* Create configuration assignment
*
* Register configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @param configurationAssignment The configurationAssignment.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration Assignment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ConfigurationAssignmentInner createOrUpdateParent(String resourceGroupName, String providerName,
String resourceParentType, String resourceParentName, String resourceType, String resourceName,
String configurationAssignmentName, ConfigurationAssignmentInner configurationAssignment) {
return createOrUpdateParentWithResponse(resourceGroupName, providerName, resourceParentType, resourceParentName,
resourceType, resourceName, configurationAssignmentName, configurationAssignment, Context.NONE).getValue();
}
/**
* Unregister configuration for resource
*
* Unregister configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Unique configuration assignment name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> deleteParentWithResponseAsync(String resourceGroupName,
String providerName, String resourceParentType, String resourceParentName, String resourceType,
String resourceName, String configurationAssignmentName) {
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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceParentType == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null."));
}
if (resourceParentName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (configurationAssignmentName == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.deleteParent(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName,
configurationAssignmentName, this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Unregister configuration for resource
*
* Unregister configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Unique configuration assignment name.
* @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 configuration Assignment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> deleteParentWithResponseAsync(String resourceGroupName,
String providerName, String resourceParentType, String resourceParentName, String resourceType,
String resourceName, String configurationAssignmentName, 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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceParentType == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null."));
}
if (resourceParentName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (configurationAssignmentName == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.deleteParent(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
providerName, resourceParentType, resourceParentName, resourceType, resourceName,
configurationAssignmentName, this.client.getApiVersion(), accept, context);
}
/**
* Unregister configuration for resource
*
* Unregister configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Unique configuration assignment name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration Assignment on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteParentAsync(String resourceGroupName, String providerName,
String resourceParentType, String resourceParentName, String resourceType, String resourceName,
String configurationAssignmentName) {
return deleteParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName,
resourceType, resourceName, configurationAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Unregister configuration for resource
*
* Unregister configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Unique configuration assignment name.
* @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 configuration Assignment along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteParentWithResponse(String resourceGroupName,
String providerName, String resourceParentType, String resourceParentName, String resourceType,
String resourceName, String configurationAssignmentName, Context context) {
return deleteParentWithResponseAsync(resourceGroupName, providerName, resourceParentType, resourceParentName,
resourceType, resourceName, configurationAssignmentName, context).block();
}
/**
* Unregister configuration for resource
*
* Unregister configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Unique configuration assignment name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration Assignment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ConfigurationAssignmentInner deleteParent(String resourceGroupName, String providerName,
String resourceParentType, String resourceParentName, String resourceType, String resourceName,
String configurationAssignmentName) {
return deleteParentWithResponse(resourceGroupName, providerName, resourceParentType, resourceParentName,
resourceType, resourceName, configurationAssignmentName, Context.NONE).getValue();
}
/**
* Get configuration assignment
*
* Get configuration assignment for resource..
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration assignment for resource. along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName,
String providerName, String resourceType, String resourceName, String configurationAssignmentName) {
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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (configurationAssignmentName == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Get configuration assignment
*
* Get configuration assignment for resource..
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @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 configuration assignment for resource. along with {@link Response} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> getWithResponseAsync(String resourceGroupName,
String providerName, String resourceType, String resourceName, String configurationAssignmentName,
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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (configurationAssignmentName == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, providerName,
resourceType, resourceName, configurationAssignmentName, this.client.getApiVersion(), accept, context);
}
/**
* Get configuration assignment
*
* Get configuration assignment for resource..
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration assignment for resource. on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono getAsync(String resourceGroupName, String providerName,
String resourceType, String resourceName, String configurationAssignmentName) {
return getWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName,
configurationAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Get configuration assignment
*
* Get configuration assignment for resource..
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @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 configuration assignment for resource. along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getWithResponse(String resourceGroupName, String providerName,
String resourceType, String resourceName, String configurationAssignmentName, Context context) {
return getWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName,
configurationAssignmentName, context).block();
}
/**
* Get configuration assignment
*
* Get configuration assignment for resource..
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration assignment for resource.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ConfigurationAssignmentInner get(String resourceGroupName, String providerName, String resourceType,
String resourceName, String configurationAssignmentName) {
return getWithResponse(resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName,
Context.NONE).getValue();
}
/**
* Create configuration assignment
*
* Register configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @param configurationAssignment The configurationAssignment.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> createOrUpdateWithResponseAsync(String resourceGroupName,
String providerName, String resourceType, String resourceName, String configurationAssignmentName,
ConfigurationAssignmentInner configurationAssignment) {
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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (configurationAssignmentName == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null."));
}
if (configurationAssignment == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null."));
} else {
configurationAssignment.validate();
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName,
this.client.getApiVersion(), configurationAssignment, accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Create configuration assignment
*
* Register configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @param configurationAssignment The configurationAssignment.
* @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 configuration Assignment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> createOrUpdateWithResponseAsync(String resourceGroupName,
String providerName, String resourceType, String resourceName, String configurationAssignmentName,
ConfigurationAssignmentInner configurationAssignment, 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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (configurationAssignmentName == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null."));
}
if (configurationAssignment == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignment is required and cannot be null."));
} else {
configurationAssignment.validate();
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
providerName, resourceType, resourceName, configurationAssignmentName, this.client.getApiVersion(),
configurationAssignment, accept, context);
}
/**
* Create configuration assignment
*
* Register configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @param configurationAssignment The configurationAssignment.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration Assignment on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono createOrUpdateAsync(String resourceGroupName, String providerName,
String resourceType, String resourceName, String configurationAssignmentName,
ConfigurationAssignmentInner configurationAssignment) {
return createOrUpdateWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName,
configurationAssignmentName, configurationAssignment).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Create configuration assignment
*
* Register configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @param configurationAssignment The configurationAssignment.
* @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 configuration Assignment along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response createOrUpdateWithResponse(String resourceGroupName,
String providerName, String resourceType, String resourceName, String configurationAssignmentName,
ConfigurationAssignmentInner configurationAssignment, Context context) {
return createOrUpdateWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName,
configurationAssignmentName, configurationAssignment, context).block();
}
/**
* Create configuration assignment
*
* Register configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Configuration assignment name.
* @param configurationAssignment The configurationAssignment.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration Assignment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ConfigurationAssignmentInner createOrUpdate(String resourceGroupName, String providerName,
String resourceType, String resourceName, String configurationAssignmentName,
ConfigurationAssignmentInner configurationAssignment) {
return createOrUpdateWithResponse(resourceGroupName, providerName, resourceType, resourceName,
configurationAssignmentName, configurationAssignment, Context.NONE).getValue();
}
/**
* Unregister configuration for resource
*
* Unregister configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Unique configuration assignment name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration Assignment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> deleteWithResponseAsync(String resourceGroupName,
String providerName, String resourceType, String resourceName, String configurationAssignmentName) {
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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (configurationAssignmentName == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignmentName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, providerName, resourceType, resourceName, configurationAssignmentName,
this.client.getApiVersion(), accept, context))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* Unregister configuration for resource
*
* Unregister configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Unique configuration assignment name.
* @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 configuration Assignment along with {@link Response} on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> deleteWithResponseAsync(String resourceGroupName,
String providerName, String resourceType, String resourceName, String configurationAssignmentName,
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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
if (configurationAssignmentName == null) {
return Mono.error(
new IllegalArgumentException("Parameter configurationAssignmentName 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,
providerName, resourceType, resourceName, configurationAssignmentName, this.client.getApiVersion(), accept,
context);
}
/**
* Unregister configuration for resource
*
* Unregister configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Unique configuration assignment name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration Assignment on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono deleteAsync(String resourceGroupName, String providerName,
String resourceType, String resourceName, String configurationAssignmentName) {
return deleteWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName,
configurationAssignmentName).flatMap(res -> Mono.justOrEmpty(res.getValue()));
}
/**
* Unregister configuration for resource
*
* Unregister configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Unique configuration assignment name.
* @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 configuration Assignment along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteWithResponse(String resourceGroupName, String providerName,
String resourceType, String resourceName, String configurationAssignmentName, Context context) {
return deleteWithResponseAsync(resourceGroupName, providerName, resourceType, resourceName,
configurationAssignmentName, context).block();
}
/**
* Unregister configuration for resource
*
* Unregister configuration for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param configurationAssignmentName Unique configuration assignment name.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return configuration Assignment.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public ConfigurationAssignmentInner delete(String resourceGroupName, String providerName, String resourceType,
String resourceName, String configurationAssignmentName) {
return deleteWithResponse(resourceGroupName, providerName, resourceType, resourceName,
configurationAssignmentName, Context.NONE).getValue();
}
/**
* List configurationAssignments for resource
*
* List configurationAssignments for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ConfigurationAssignments list along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listParentSinglePageAsync(String resourceGroupName,
String providerName, String resourceParentType, String resourceParentName, String resourceType,
String resourceName) {
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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceParentType == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null."));
}
if (resourceParentName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(context -> service.listParent(this.client.getEndpoint(), this.client.getSubscriptionId(),
resourceGroupName, providerName, resourceParentType, resourceParentName, resourceType, resourceName,
this.client.getApiVersion(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* List configurationAssignments for resource
*
* List configurationAssignments for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ConfigurationAssignments list along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listParentSinglePageAsync(String resourceGroupName,
String providerName, String resourceParentType, String resourceParentName, String resourceType,
String resourceName, 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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceParentType == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentType is required and cannot be null."));
}
if (resourceParentName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceParentName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listParent(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, providerName,
resourceParentType, resourceParentName, resourceType, resourceName, this.client.getApiVersion(), accept,
context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), null, null));
}
/**
* List configurationAssignments for resource
*
* List configurationAssignments for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ConfigurationAssignments list as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listParentAsync(String resourceGroupName, String providerName,
String resourceParentType, String resourceParentName, String resourceType, String resourceName) {
return new PagedFlux<>(() -> listParentSinglePageAsync(resourceGroupName, providerName, resourceParentType,
resourceParentName, resourceType, resourceName));
}
/**
* List configurationAssignments for resource
*
* List configurationAssignments for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ConfigurationAssignments list as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listParentAsync(String resourceGroupName, String providerName,
String resourceParentType, String resourceParentName, String resourceType, String resourceName,
Context context) {
return new PagedFlux<>(() -> listParentSinglePageAsync(resourceGroupName, providerName, resourceParentType,
resourceParentName, resourceType, resourceName, context));
}
/**
* List configurationAssignments for resource
*
* List configurationAssignments for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listParent(String resourceGroupName, String providerName,
String resourceParentType, String resourceParentName, String resourceType, String resourceName) {
return new PagedIterable<>(listParentAsync(resourceGroupName, providerName, resourceParentType,
resourceParentName, resourceType, resourceName));
}
/**
* List configurationAssignments for resource
*
* List configurationAssignments for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceParentType Resource parent type.
* @param resourceParentName Resource parent identifier.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listParent(String resourceGroupName, String providerName,
String resourceParentType, String resourceParentName, String resourceType, String resourceName,
Context context) {
return new PagedIterable<>(listParentAsync(resourceGroupName, providerName, resourceParentType,
resourceParentName, resourceType, resourceName, context));
}
/**
* List configurationAssignments for resource
*
* List configurationAssignments for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ConfigurationAssignments list along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(String resourceGroupName,
String providerName, String resourceType, String resourceName) {
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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName is required and cannot be null."));
}
final String accept = "application/json";
return FluxUtil
.withContext(
context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName,
providerName, resourceType, resourceName, this.client.getApiVersion(), accept, context))
.>map(res -> new PagedResponseBase<>(res.getRequest(),
res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null))
.contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
}
/**
* List configurationAssignments for resource
*
* List configurationAssignments for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ConfigurationAssignments list along with {@link PagedResponse} on successful completion of
* {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono> listSinglePageAsync(String resourceGroupName,
String providerName, String resourceType, String resourceName, 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 (providerName == null) {
return Mono.error(new IllegalArgumentException("Parameter providerName is required and cannot be null."));
}
if (resourceType == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceType is required and cannot be null."));
}
if (resourceName == null) {
return Mono.error(new IllegalArgumentException("Parameter resourceName 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(), resourceGroupName, providerName,
resourceType, resourceName, this.client.getApiVersion(), accept, context)
.map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(),
res.getValue().value(), null, null));
}
/**
* List configurationAssignments for resource
*
* List configurationAssignments for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ConfigurationAssignments list as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(String resourceGroupName, String providerName,
String resourceType, String resourceName) {
return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, providerName, resourceType, resourceName));
}
/**
* List configurationAssignments for resource
*
* List configurationAssignments for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ConfigurationAssignments list as paginated response with {@link PagedFlux}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux listAsync(String resourceGroupName, String providerName,
String resourceType, String resourceName, Context context) {
return new PagedFlux<>(
() -> listSinglePageAsync(resourceGroupName, providerName, resourceType, resourceName, context));
}
/**
* List configurationAssignments for resource
*
* List configurationAssignments for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String resourceGroupName, String providerName,
String resourceType, String resourceName) {
return new PagedIterable<>(listAsync(resourceGroupName, providerName, resourceType, resourceName));
}
/**
* List configurationAssignments for resource
*
* List configurationAssignments for resource.
*
* @param resourceGroupName Resource group name.
* @param providerName Resource provider name.
* @param resourceType Resource type.
* @param resourceName Resource identifier.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response for ConfigurationAssignments list as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable list(String resourceGroupName, String providerName,
String resourceType, String resourceName, Context context) {
return new PagedIterable<>(listAsync(resourceGroupName, providerName, resourceType, resourceName, context));
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy