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

package documentation.implementation;

import com.azure.core.annotation.BodyParam;
import com.azure.core.annotation.ExpectedResponses;
import com.azure.core.annotation.Get;
import com.azure.core.annotation.HeaderParam;
import com.azure.core.annotation.Host;
import com.azure.core.annotation.HostParam;
import com.azure.core.annotation.Post;
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.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.rest.RequestOptions;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.util.BinaryData;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import reactor.core.publisher.Mono;

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

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

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

    /**
     * The interface defining all the services for DocumentationClientLists to be used by the proxy service to perform
     * REST calls.
     */
    @Host("{endpoint}")
    @ServiceInterface(name = "DocumentationClientLists")
    public interface ListsService {
        @Get("/documentation/lists/bullet-points/op")
        @ExpectedResponses({ 204 })
        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<Void>> bulletPointsOp(@HostParam("endpoint") String endpoint, RequestOptions requestOptions,
            Context context);

        @Get("/documentation/lists/bullet-points/op")
        @ExpectedResponses({ 204 })
        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<Void> bulletPointsOpSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions,
            Context context);

        @Post("/documentation/lists/bullet-points/model")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<Void>> bulletPointsModel(@HostParam("endpoint") String endpoint,
            @HeaderParam("Content-Type") String contentType,
            @BodyParam("application/json") BinaryData bulletPointsModelRequest, RequestOptions requestOptions,
            Context context);

        @Post("/documentation/lists/bullet-points/model")
        @ExpectedResponses({ 200 })
        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<Void> bulletPointsModelSync(@HostParam("endpoint") String endpoint,
            @HeaderParam("Content-Type") String contentType,
            @BodyParam("application/json") BinaryData bulletPointsModelRequest, RequestOptions requestOptions,
            Context context);

        @Get("/documentation/lists/numbered")
        @ExpectedResponses({ 204 })
        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<Void>> numbered(@HostParam("endpoint") String endpoint, RequestOptions requestOptions,
            Context context);

        @Get("/documentation/lists/numbered")
        @ExpectedResponses({ 204 })
        @UnexpectedResponseExceptionType(value = ClientAuthenticationException.class, code = { 401 })
        @UnexpectedResponseExceptionType(value = ResourceNotFoundException.class, code = { 404 })
        @UnexpectedResponseExceptionType(value = ResourceModifiedException.class, code = { 409 })
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Response<Void> numberedSync(@HostParam("endpoint") String endpoint, RequestOptions requestOptions,
            Context context);
    }

    /**
     * This tests:
     * - Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet
     * points within documentation comments. It should properly indent the wrapped lines.
     * - Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting
     * is preserved when the text wraps onto multiple lines in the generated documentation.
     * - Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the
     * wrapping and formatting are correctly applied in the output.
     * - Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic
     * formatting and is long enough to test the wrapping behavior in such cases.
     * - **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how
     * the bold formatting is maintained across wrapped lines.
     * - *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that
     * italic formatting is correctly applied even when the text spans multiple lines.
     * 
     * @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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> bulletPointsOpWithResponseAsync(RequestOptions requestOptions) {
        return FluxUtil
            .withContext(context -> service.bulletPointsOp(this.client.getEndpoint(), requestOptions, context));
    }

    /**
     * This tests:
     * - Simple bullet point. This bullet point is going to be very long to test how text wrapping is handled in bullet
     * points within documentation comments. It should properly indent the wrapped lines.
     * - Another bullet point with **bold text**. This bullet point is also intentionally long to see how the formatting
     * is preserved when the text wraps onto multiple lines in the generated documentation.
     * - Third bullet point with *italic text*. Similar to the previous points, this one is extended to ensure that the
     * wrapping and formatting are correctly applied in the output.
     * - Complex bullet point with **bold** and *italic* combined. This bullet point combines both bold and italic
     * formatting and is long enough to test the wrapping behavior in such cases.
     * - **Bold bullet point**: A bullet point that is entirely bolded. This point is also made lengthy to observe how
     * the bold formatting is maintained across wrapped lines.
     * - *Italic bullet point*: A bullet point that is entirely italicized. This final point is extended to verify that
     * italic formatting is correctly applied even when the text spans multiple lines.
     * 
     * @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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> bulletPointsOpWithResponse(RequestOptions requestOptions) {
        return service.bulletPointsOpSync(this.client.getEndpoint(), requestOptions, Context.NONE);
    }

    /**
     * The bulletPointsModel operation.
     * <p><strong>Request Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * {
     *     input (Required): {
     *         prop: String(Simple/Bold/Italic) (Required)
     *     }
     * }
     * }
     * </pre>
     * 
     * @param bulletPointsModelRequest The bulletPointsModelRequest 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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> bulletPointsModelWithResponseAsync(BinaryData bulletPointsModelRequest,
        RequestOptions requestOptions) {
        final String contentType = "application/json";
        return FluxUtil.withContext(context -> service.bulletPointsModel(this.client.getEndpoint(), contentType,
            bulletPointsModelRequest, requestOptions, context));
    }

    /**
     * The bulletPointsModel operation.
     * <p><strong>Request Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * {
     *     input (Required): {
     *         prop: String(Simple/Bold/Italic) (Required)
     *     }
     * }
     * }
     * </pre>
     * 
     * @param bulletPointsModelRequest The bulletPointsModelRequest 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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> bulletPointsModelWithResponse(BinaryData bulletPointsModelRequest,
        RequestOptions requestOptions) {
        final String contentType = "application/json";
        return service.bulletPointsModelSync(this.client.getEndpoint(), contentType, bulletPointsModelRequest,
            requestOptions, Context.NONE);
    }

    /**
     * Steps to follow:
     * 1. First step with **important** note
     * 2. Second step with *emphasis*
     * 3. Third step combining **bold** and *italic*
     * 4. **Final step**: Review all steps for *accuracy*.
     * 
     * @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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<Void>> numberedWithResponseAsync(RequestOptions requestOptions) {
        return FluxUtil.withContext(context -> service.numbered(this.client.getEndpoint(), requestOptions, context));
    }

    /**
     * Steps to follow:
     * 1. First step with **important** note
     * 2. Second step with *emphasis*
     * 3. Third step combining **bold** and *italic*
     * 4. **Final step**: Review all steps for *accuracy*.
     * 
     * @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}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> numberedWithResponse(RequestOptions requestOptions) {
        return service.numberedSync(this.client.getEndpoint(), requestOptions, Context.NONE);
    }
}
