// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.automanage.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.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.automanage.fluent.ConfigurationProfileHcrpAssignmentsClient;
import com.azure.resourcemanager.automanage.fluent.models.ConfigurationProfileAssignmentInner;
import reactor.core.publisher.Mono;

/**
 * An instance of this class provides access to all the operations defined in ConfigurationProfileHcrpAssignmentsClient.
 */
public final class ConfigurationProfileHcrpAssignmentsClientImpl implements ConfigurationProfileHcrpAssignmentsClient {
    /** The proxy service used to perform REST calls. */
    private final ConfigurationProfileHcrpAssignmentsService service;

    /** The service client containing this operation class. */
    private final AutomanageClientImpl client;

    /**
     * Initializes an instance of ConfigurationProfileHcrpAssignmentsClientImpl.
     *
     * @param client the instance of the service client containing this operation class.
     */
    ConfigurationProfileHcrpAssignmentsClientImpl(AutomanageClientImpl client) {
        this.service =
            RestProxy
                .create(
                    ConfigurationProfileHcrpAssignmentsService.class,
                    client.getHttpPipeline(),
                    client.getSerializerAdapter());
        this.client = client;
    }

    /**
     * The interface defining all the services for AutomanageClientConfigurationProfileHcrpAssignments to be used by the
     * proxy service to perform REST calls.
     */
    @Host("{$host}")
    @ServiceInterface(name = "AutomanageClientConf")
    private interface ConfigurationProfileHcrpAssignmentsService {
        @Headers({"Content-Type: application/json"})
        @Put(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute"
                + "/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments"
                + "/{configurationProfileAssignmentName}")
        @ExpectedResponses({200, 201})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<ConfigurationProfileAssignmentInner>> createOrUpdate(
            @HostParam("$host") String endpoint,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("machineName") String machineName,
            @PathParam("configurationProfileAssignmentName") String configurationProfileAssignmentName,
            @QueryParam("api-version") String apiVersion,
            @BodyParam("application/json") ConfigurationProfileAssignmentInner parameters,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Get(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute"
                + "/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments"
                + "/{configurationProfileAssignmentName}")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<ConfigurationProfileAssignmentInner>> get(
            @HostParam("$host") String endpoint,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("machineName") String machineName,
            @PathParam("configurationProfileAssignmentName") String configurationProfileAssignmentName,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);

        @Headers({"Content-Type: application/json"})
        @Delete(
            "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.HybridCompute"
                + "/machines/{machineName}/providers/Microsoft.Automanage/configurationProfileAssignments"
                + "/{configurationProfileAssignmentName}")
        @ExpectedResponses({200, 204})
        @UnexpectedResponseExceptionType(ManagementException.class)
        Mono<Response<Void>> delete(
            @HostParam("$host") String endpoint,
            @PathParam("resourceGroupName") String resourceGroupName,
            @PathParam("subscriptionId") String subscriptionId,
            @PathParam("machineName") String machineName,
            @PathParam("configurationProfileAssignmentName") String configurationProfileAssignmentName,
            @QueryParam("api-version") String apiVersion,
            @HeaderParam("Accept") String accept,
            Context context);
    }

    /**
     * Creates an association between a ARC machine and Automanage configuration profile.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName Name of the configuration profile assignment. Only default is
     *     supported.
     * @param parameters Parameters supplied to the create or update configuration profile assignment.
     * @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 profile assignment is an association between a VM and automanage profile configuration
     *     along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<ConfigurationProfileAssignmentInner>> createOrUpdateWithResponseAsync(
        String resourceGroupName,
        String machineName,
        String configurationProfileAssignmentName,
        ConfigurationProfileAssignmentInner parameters) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (machineName == null) {
            return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null."));
        }
        if (configurationProfileAssignmentName == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter configurationProfileAssignmentName is required and cannot be null."));
        }
        if (parameters == null) {
            return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
        } else {
            parameters.validate();
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .createOrUpdate(
                            this.client.getEndpoint(),
                            this.client.getSubscriptionId(),
                            resourceGroupName,
                            machineName,
                            configurationProfileAssignmentName,
                            this.client.getApiVersion(),
                            parameters,
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Creates an association between a ARC machine and Automanage configuration profile.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName Name of the configuration profile assignment. Only default is
     *     supported.
     * @param parameters Parameters supplied to the create or update configuration profile assignment.
     * @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 profile assignment is an association between a VM and automanage profile configuration
     *     along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<ConfigurationProfileAssignmentInner>> createOrUpdateWithResponseAsync(
        String resourceGroupName,
        String machineName,
        String configurationProfileAssignmentName,
        ConfigurationProfileAssignmentInner parameters,
        Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (this.client.getSubscriptionId() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getSubscriptionId() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
        }
        if (machineName == null) {
            return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null."));
        }
        if (configurationProfileAssignmentName == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter configurationProfileAssignmentName is required and cannot be null."));
        }
        if (parameters == null) {
            return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null."));
        } else {
            parameters.validate();
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .createOrUpdate(
                this.client.getEndpoint(),
                this.client.getSubscriptionId(),
                resourceGroupName,
                machineName,
                configurationProfileAssignmentName,
                this.client.getApiVersion(),
                parameters,
                accept,
                context);
    }

    /**
     * Creates an association between a ARC machine and Automanage configuration profile.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName Name of the configuration profile assignment. Only default is
     *     supported.
     * @param parameters Parameters supplied to the create or update configuration profile assignment.
     * @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 profile assignment is an association between a VM and automanage profile configuration on
     *     successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<ConfigurationProfileAssignmentInner> createOrUpdateAsync(
        String resourceGroupName,
        String machineName,
        String configurationProfileAssignmentName,
        ConfigurationProfileAssignmentInner parameters) {
        return createOrUpdateWithResponseAsync(
                resourceGroupName, machineName, configurationProfileAssignmentName, parameters)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Creates an association between a ARC machine and Automanage configuration profile.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName Name of the configuration profile assignment. Only default is
     *     supported.
     * @param parameters Parameters supplied to the create or update configuration profile assignment.
     * @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 profile assignment is an association between a VM and automanage profile configuration.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ConfigurationProfileAssignmentInner createOrUpdate(
        String resourceGroupName,
        String machineName,
        String configurationProfileAssignmentName,
        ConfigurationProfileAssignmentInner parameters) {
        return createOrUpdateAsync(resourceGroupName, machineName, configurationProfileAssignmentName, parameters)
            .block();
    }

    /**
     * Creates an association between a ARC machine and Automanage configuration profile.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName Name of the configuration profile assignment. Only default is
     *     supported.
     * @param parameters Parameters supplied to the create or update configuration profile assignment.
     * @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 profile assignment is an association between a VM and automanage profile configuration
     *     along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<ConfigurationProfileAssignmentInner> createOrUpdateWithResponse(
        String resourceGroupName,
        String machineName,
        String configurationProfileAssignmentName,
        ConfigurationProfileAssignmentInner parameters,
        Context context) {
        return createOrUpdateWithResponseAsync(
                resourceGroupName, machineName, configurationProfileAssignmentName, parameters, context)
            .block();
    }

    /**
     * Get information about a configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName The configuration profile 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 information about a configuration profile assignment along with {@link Response} on successful completion
     *     of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<ConfigurationProfileAssignmentInner>> getWithResponseAsync(
        String resourceGroupName, String machineName, String configurationProfileAssignmentName) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName 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 (machineName == null) {
            return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null."));
        }
        if (configurationProfileAssignmentName == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter configurationProfileAssignmentName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .get(
                            this.client.getEndpoint(),
                            resourceGroupName,
                            this.client.getSubscriptionId(),
                            machineName,
                            configurationProfileAssignmentName,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Get information about a configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName The configuration profile 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 information about a configuration profile assignment along with {@link Response} on successful completion
     *     of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<Response<ConfigurationProfileAssignmentInner>> getWithResponseAsync(
        String resourceGroupName, String machineName, String configurationProfileAssignmentName, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName 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 (machineName == null) {
            return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null."));
        }
        if (configurationProfileAssignmentName == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter configurationProfileAssignmentName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .get(
                this.client.getEndpoint(),
                resourceGroupName,
                this.client.getSubscriptionId(),
                machineName,
                configurationProfileAssignmentName,
                this.client.getApiVersion(),
                accept,
                context);
    }

    /**
     * Get information about a configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName The configuration profile 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 information about a configuration profile assignment on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    private Mono<ConfigurationProfileAssignmentInner> getAsync(
        String resourceGroupName, String machineName, String configurationProfileAssignmentName) {
        return getWithResponseAsync(resourceGroupName, machineName, configurationProfileAssignmentName)
            .flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get information about a configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName The configuration profile 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 information about a configuration profile assignment.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ConfigurationProfileAssignmentInner get(
        String resourceGroupName, String machineName, String configurationProfileAssignmentName) {
        return getAsync(resourceGroupName, machineName, configurationProfileAssignmentName).block();
    }

    /**
     * Get information about a configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName The configuration profile 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 information about a configuration profile assignment along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<ConfigurationProfileAssignmentInner> getWithResponse(
        String resourceGroupName, String machineName, String configurationProfileAssignmentName, Context context) {
        return getWithResponseAsync(resourceGroupName, machineName, configurationProfileAssignmentName, context)
            .block();
    }

    /**
     * Delete a configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName Name of the configuration profile assignment.
     * @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<Response<Void>> deleteWithResponseAsync(
        String resourceGroupName, String machineName, String configurationProfileAssignmentName) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName 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 (machineName == null) {
            return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null."));
        }
        if (configurationProfileAssignmentName == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter configurationProfileAssignmentName is required and cannot be null."));
        }
        final String accept = "application/json";
        return FluxUtil
            .withContext(
                context ->
                    service
                        .delete(
                            this.client.getEndpoint(),
                            resourceGroupName,
                            this.client.getSubscriptionId(),
                            machineName,
                            configurationProfileAssignmentName,
                            this.client.getApiVersion(),
                            accept,
                            context))
            .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly()));
    }

    /**
     * Delete a configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName Name of the configuration profile assignment.
     * @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<Response<Void>> deleteWithResponseAsync(
        String resourceGroupName, String machineName, String configurationProfileAssignmentName, Context context) {
        if (this.client.getEndpoint() == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter this.client.getEndpoint() is required and cannot be null."));
        }
        if (resourceGroupName == null) {
            return Mono
                .error(new IllegalArgumentException("Parameter resourceGroupName 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 (machineName == null) {
            return Mono.error(new IllegalArgumentException("Parameter machineName is required and cannot be null."));
        }
        if (configurationProfileAssignmentName == null) {
            return Mono
                .error(
                    new IllegalArgumentException(
                        "Parameter configurationProfileAssignmentName is required and cannot be null."));
        }
        final String accept = "application/json";
        context = this.client.mergeContext(context);
        return service
            .delete(
                this.client.getEndpoint(),
                resourceGroupName,
                this.client.getSubscriptionId(),
                machineName,
                configurationProfileAssignmentName,
                this.client.getApiVersion(),
                accept,
                context);
    }

    /**
     * Delete a configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName Name of the configuration profile assignment.
     * @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<Void> deleteAsync(
        String resourceGroupName, String machineName, String configurationProfileAssignmentName) {
        return deleteWithResponseAsync(resourceGroupName, machineName, configurationProfileAssignmentName)
            .flatMap(ignored -> Mono.empty());
    }

    /**
     * Delete a configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName Name of the configuration profile assignment.
     * @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 machineName, String configurationProfileAssignmentName) {
        deleteAsync(resourceGroupName, machineName, configurationProfileAssignmentName).block();
    }

    /**
     * Delete a configuration profile assignment.
     *
     * @param resourceGroupName The name of the resource group. The name is case insensitive.
     * @param machineName The name of the Arc machine.
     * @param configurationProfileAssignmentName Name of the configuration profile assignment.
     * @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<Void> deleteWithResponse(
        String resourceGroupName, String machineName, String configurationProfileAssignmentName, Context context) {
        return deleteWithResponseAsync(resourceGroupName, machineName, configurationProfileAssignmentName, context)
            .block();
    }
}
