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

package methodoverride;

import com.azure.core.annotation.Generated;
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
import com.azure.core.exception.ClientAuthenticationException;
import com.azure.core.exception.HttpResponseException;
import com.azure.core.exception.ResourceModifiedException;
import com.azure.core.exception.ResourceNotFoundException;
import com.azure.core.http.HttpHeaderName;
import com.azure.core.http.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.util.BinaryData;
import com.azure.core.util.FluxUtil;
import methodoverride.implementation.MethodOverrideClientImpl;
import methodoverride.implementation.models.GroupAllRequest;
import methodoverride.implementation.models.GroupNoneRequest;
import methodoverride.implementation.models.GroupPartRequest;
import methodoverride.models.GroupAllOptions;
import methodoverride.models.GroupExcludeBodyModel;
import methodoverride.models.GroupPartOptions;
import methodoverride.models.GroupQueryOptions;
import reactor.core.publisher.Mono;

/**
 * Initializes a new instance of the asynchronous MethodOverrideClient type.
 */
@ServiceClient(builder = MethodOverrideClientBuilder.class, isAsync = true)
public final class MethodOverrideAsyncClient {
    @Generated
    private final MethodOverrideClientImpl serviceClient;

    /**
     * Initializes an instance of MethodOverrideAsyncClient class.
     * 
     * @param serviceClient the service client implementation.
     */
    @Generated
    MethodOverrideAsyncClient(MethodOverrideClientImpl serviceClient) {
        this.serviceClient = serviceClient;
    }

    /**
     * A remote procedure call (RPC) operation.
     * <p><strong>Query Parameters</strong></p>
     * <table border="1">
     * <caption>Query Parameters</caption>
     * <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     * <tr><td>foo</td><td>String</td><td>No</td><td>The foo parameter</td></tr>
     * <tr><td>bar</td><td>String</td><td>No</td><td>The bar parameter</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * 
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> groupQueryWithResponse(RequestOptions requestOptions) {
        return this.serviceClient.groupQueryWithResponseAsync(requestOptions);
    }

    /**
     * A remote procedure call (RPC) operation.
     * <p><strong>Query Parameters</strong></p>
     * <table border="1">
     * <caption>Query Parameters</caption>
     * <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     * <tr><td>foo</td><td>String</td><td>No</td><td>The foo parameter</td></tr>
     * <tr><td>bar</td><td>String</td><td>No</td><td>The bar parameter</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * <p><strong>Request Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * {
     *     prop1: String (Required)
     *     prop2: String (Optional)
     * }
     * }
     * </pre>
     * 
     * @param groupAllRequest The groupAllRequest parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> groupAllWithResponse(BinaryData groupAllRequest, RequestOptions requestOptions) {
        return this.serviceClient.groupAllWithResponseAsync(groupAllRequest, requestOptions);
    }

    /**
     * A remote procedure call (RPC) operation.
     * <p><strong>Query Parameters</strong></p>
     * <table border="1">
     * <caption>Query Parameters</caption>
     * <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     * <tr><td>foo</td><td>String</td><td>No</td><td>The foo parameter</td></tr>
     * <tr><td>bar</td><td>String</td><td>No</td><td>The bar parameter</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * <p><strong>Request Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * {
     *     prop1: String (Required)
     *     prop2: String (Optional)
     * }
     * }
     * </pre>
     * 
     * @param groupPartRequest The groupPartRequest parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> groupPartWithResponse(BinaryData groupPartRequest, RequestOptions requestOptions) {
        return this.serviceClient.groupPartWithResponseAsync(groupPartRequest, requestOptions);
    }

    /**
     * A remote procedure call (RPC) operation.
     * <p><strong>Query Parameters</strong></p>
     * <table border="1">
     * <caption>Query Parameters</caption>
     * <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     * <tr><td>foo</td><td>String</td><td>No</td><td>The foo parameter</td></tr>
     * <tr><td>bar</td><td>String</td><td>No</td><td>The bar parameter</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * <p><strong>Request Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * {
     *     prop1: String (Required)
     *     prop2: String (Optional)
     * }
     * }
     * </pre>
     * 
     * @param body The body parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> groupExcludeBodyWithResponse(BinaryData body, RequestOptions requestOptions) {
        return this.serviceClient.groupExcludeBodyWithResponseAsync(body, requestOptions);
    }

    /**
     * A remote procedure call (RPC) operation.
     * <p><strong>Query Parameters</strong></p>
     * <table border="1">
     * <caption>Query Parameters</caption>
     * <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     * <tr><td>foo</td><td>String</td><td>No</td><td>The foo parameter</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * <p><strong>Header Parameters</strong></p>
     * <table border="1">
     * <caption>Header Parameters</caption>
     * <tr><th>Name</th><th>Type</th><th>Required</th><th>Description</th></tr>
     * <tr><td>bar</td><td>String</td><td>No</td><td>The bar parameter</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addHeader}
     * <p><strong>Request Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * {
     *     prop1: String (Required)
     *     prop2: String (Optional)
     *     prop3: String (Optional)
     *     prop4: String (Optional)
     *     prop5: String (Optional)
     *     prop6: String (Optional)
     * }
     * }
     * </pre>
     * 
     * @param groupNoneRequest The groupNoneRequest parameter.
     * @param requestOptions The options to configure the HTTP request before HTTP client sends it.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @return the {@link Response} on successful completion of {@link Mono}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> groupNoneWithResponse(BinaryData groupNoneRequest, RequestOptions requestOptions) {
        return this.serviceClient.groupNoneWithResponseAsync(groupNoneRequest, requestOptions);
    }

    /**
     * A remote procedure call (RPC) operation.
     * 
     * @param options The options parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> groupQuery(GroupQueryOptions options) {
        // Generated convenience method for groupQueryWithResponse
        RequestOptions requestOptions = new RequestOptions();
        String foo = options == null ? null : options.getFoo();
        String bar = options == null ? null : options.getBar();
        if (foo != null) {
            requestOptions.addQueryParam("foo", foo, false);
        }
        if (bar != null) {
            requestOptions.addQueryParam("bar", bar, false);
        }
        return groupQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono);
    }

    /**
     * A remote procedure call (RPC) operation.
     * 
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> groupQuery() {
        // Generated convenience method for groupQueryWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return groupQueryWithResponse(requestOptions).flatMap(FluxUtil::toMono);
    }

    /**
     * A remote procedure call (RPC) operation.
     * 
     * @param options The options parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> groupAll(GroupAllOptions options) {
        // Generated convenience method for groupAllWithResponse
        RequestOptions requestOptions = new RequestOptions();
        String foo = options.getFoo();
        String bar = options.getBar();
        GroupAllRequest groupAllRequestObj = new GroupAllRequest(options.getProp1()).setProp2(options.getProp2());
        BinaryData groupAllRequest = BinaryData.fromObject(groupAllRequestObj);
        if (foo != null) {
            requestOptions.addQueryParam("foo", foo, false);
        }
        if (bar != null) {
            requestOptions.addQueryParam("bar", bar, false);
        }
        return groupAllWithResponse(groupAllRequest, requestOptions).flatMap(FluxUtil::toMono);
    }

    /**
     * A remote procedure call (RPC) operation.
     * 
     * @param prop1 The prop1 parameter.
     * @param foo The foo parameter.
     * @param options The options parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> groupPart(String prop1, String foo, GroupPartOptions options) {
        // Generated convenience method for groupPartWithResponse
        RequestOptions requestOptions = new RequestOptions();
        GroupPartRequest groupPartRequestObj = new GroupPartRequest(prop1).setProp2(options.getProp2());
        BinaryData groupPartRequest = BinaryData.fromObject(groupPartRequestObj);
        String bar = options == null ? null : options.getBar();
        if (foo != null) {
            requestOptions.addQueryParam("foo", foo, false);
        }
        if (bar != null) {
            requestOptions.addQueryParam("bar", bar, false);
        }
        return groupPartWithResponse(groupPartRequest, requestOptions).flatMap(FluxUtil::toMono);
    }

    /**
     * A remote procedure call (RPC) operation.
     * 
     * @param prop1 The prop1 parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> groupPart(String prop1) {
        // Generated convenience method for groupPartWithResponse
        RequestOptions requestOptions = new RequestOptions();
        GroupPartRequest groupPartRequestObj = new GroupPartRequest(prop1);
        BinaryData groupPartRequest = BinaryData.fromObject(groupPartRequestObj);
        return groupPartWithResponse(groupPartRequest, requestOptions).flatMap(FluxUtil::toMono);
    }

    /**
     * A remote procedure call (RPC) operation.
     * 
     * @param body The body parameter.
     * @param options The options parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> groupExcludeBody(GroupExcludeBodyModel body, GroupQueryOptions options) {
        // Generated convenience method for groupExcludeBodyWithResponse
        RequestOptions requestOptions = new RequestOptions();
        String foo = options == null ? null : options.getFoo();
        String bar = options == null ? null : options.getBar();
        if (foo != null) {
            requestOptions.addQueryParam("foo", foo, false);
        }
        if (bar != null) {
            requestOptions.addQueryParam("bar", bar, false);
        }
        return groupExcludeBodyWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono);
    }

    /**
     * A remote procedure call (RPC) operation.
     * 
     * @param body The body parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> groupExcludeBody(GroupExcludeBodyModel body) {
        // Generated convenience method for groupExcludeBodyWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return groupExcludeBodyWithResponse(BinaryData.fromObject(body), requestOptions).flatMap(FluxUtil::toMono);
    }

    /**
     * A remote procedure call (RPC) operation.
     * 
     * @param prop1 The prop1 parameter.
     * @param foo The foo parameter.
     * @param bar The bar parameter.
     * @param prop2 The prop2 parameter.
     * @param prop3 The prop3 parameter.
     * @param prop4 The prop4 parameter.
     * @param prop5 The prop5 parameter.
     * @param prop6 The prop6 parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> groupNone(String prop1, String foo, String bar, String prop2, String prop3, String prop4,
        String prop5, String prop6) {
        // Generated convenience method for groupNoneWithResponse
        RequestOptions requestOptions = new RequestOptions();
        GroupNoneRequest groupNoneRequestObj = new GroupNoneRequest(prop1).setProp2(prop2)
            .setProp3(prop3)
            .setProp4(prop4)
            .setProp5(prop5)
            .setProp6(prop6);
        BinaryData groupNoneRequest = BinaryData.fromObject(groupNoneRequestObj);
        if (foo != null) {
            requestOptions.addQueryParam("foo", foo, false);
        }
        if (bar != null) {
            requestOptions.setHeader(HttpHeaderName.fromString("bar"), bar);
        }
        return groupNoneWithResponse(groupNoneRequest, requestOptions).flatMap(FluxUtil::toMono);
    }

    /**
     * A remote procedure call (RPC) operation.
     * 
     * @param prop1 The prop1 parameter.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException thrown if the request is rejected by server.
     * @throws ClientAuthenticationException thrown if the request is rejected by server on status code 401.
     * @throws ResourceNotFoundException thrown if the request is rejected by server on status code 404.
     * @throws ResourceModifiedException thrown if the request is rejected by server on status code 409.
     * @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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Void> groupNone(String prop1) {
        // Generated convenience method for groupNoneWithResponse
        RequestOptions requestOptions = new RequestOptions();
        GroupNoneRequest groupNoneRequestObj = new GroupNoneRequest(prop1);
        BinaryData groupNoneRequest = BinaryData.fromObject(groupNoneRequestObj);
        return groupNoneWithResponse(groupNoneRequest, requestOptions).flatMap(FluxUtil::toMono);
    }
}
