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

package com.azure.ai.personalizer.implementation;

import com.azure.ai.personalizer.administration.models.PersonalizerLogProperties;
import com.azure.ai.personalizer.models.ErrorResponseException;
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.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.HttpResponseException;
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 java.nio.ByteBuffer;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

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

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

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

    /**
     * The interface defining all the services for PersonalizerClientV1Preview3Logs to be used by the proxy service to
     * perform REST calls.
     */
    @Host("{Endpoint}/personalizer/{ApiVersion}")
    @ServiceInterface(name = "PersonalizerClientV1")
    public interface LogsService {
        @Post("/logs/interactions")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<Void>> interactions(
                @HostParam("Endpoint") String endpoint,
                @HostParam("ApiVersion") String apiVersion,
                @BodyParam("application/octet-stream") Flux<ByteBuffer> body,
                @HeaderParam("Content-Length") long contentLength,
                @HeaderParam("Accept") String accept,
                Context context);

        @Post("/logs/interactions")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<Void>> interactions(
                @HostParam("Endpoint") String endpoint,
                @HostParam("ApiVersion") String apiVersion,
                @BodyParam("application/octet-stream") BinaryData body,
                @HeaderParam("Content-Length") long contentLength,
                @HeaderParam("Accept") String accept,
                Context context);

        @Post("/logs/observations")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<Void>> observations(
                @HostParam("Endpoint") String endpoint,
                @HostParam("ApiVersion") String apiVersion,
                @BodyParam("application/octet-stream") Flux<ByteBuffer> body,
                @HeaderParam("Content-Length") long contentLength,
                @HeaderParam("Accept") String accept,
                Context context);

        @Post("/logs/observations")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<Void>> observations(
                @HostParam("Endpoint") String endpoint,
                @HostParam("ApiVersion") String apiVersion,
                @BodyParam("application/octet-stream") BinaryData body,
                @HeaderParam("Content-Length") long contentLength,
                @HeaderParam("Accept") String accept,
                Context context);

        @Delete("/logs")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(HttpResponseException.class)
        Mono<Response<Void>> delete(
                @HostParam("Endpoint") String endpoint, @HostParam("ApiVersion") String apiVersion, Context context);

        @Get("/logs/properties")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<PersonalizerLogProperties>> getProperties(
                @HostParam("Endpoint") String endpoint,
                @HostParam("ApiVersion") String apiVersion,
                @HeaderParam("Accept") String accept,
                Context context);
    }

    /**
     * Post interactions.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging interactions and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Interactions binary payload.
     * @param contentLength The Content-Length header for the request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Response<Void>> interactionsWithResponseAsync(Flux<ByteBuffer> body, long contentLength) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.interactions(
                                this.client.getEndpoint(),
                                this.client.getApiVersion(),
                                body,
                                contentLength,
                                accept,
                                context));
    }

    /**
     * Post interactions.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging interactions and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Interactions binary payload.
     * @param contentLength The Content-Length header for the request.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Response<Void>> interactionsWithResponseAsync(
            Flux<ByteBuffer> body, long contentLength, Context context) {
        final String accept = "application/json";
        return service.interactions(
                this.client.getEndpoint(), this.client.getApiVersion(), body, contentLength, accept, context);
    }

    /**
     * Post interactions.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging interactions and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Interactions binary payload.
     * @param contentLength The Content-Length header for the request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Void> interactionsAsync(Flux<ByteBuffer> body, long contentLength) {
        return interactionsWithResponseAsync(body, contentLength).flatMap(ignored -> Mono.empty());
    }

    /**
     * Post interactions.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging interactions and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Interactions binary payload.
     * @param contentLength The Content-Length header for the request.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Void> interactionsAsync(Flux<ByteBuffer> body, long contentLength, Context context) {
        return interactionsWithResponseAsync(body, contentLength, context).flatMap(ignored -> Mono.empty());
    }

    /**
     * Post interactions.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging interactions and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Interactions binary payload.
     * @param contentLength The Content-Length header for the request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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 interactions(Flux<ByteBuffer> body, long contentLength) {
        interactionsAsync(body, contentLength).block();
    }

    /**
     * Post interactions.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging interactions and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Interactions binary payload.
     * @param contentLength The Content-Length header for the request.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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> interactionsWithResponse(Flux<ByteBuffer> body, long contentLength, Context context) {
        return interactionsWithResponseAsync(body, contentLength, context).block();
    }

    /**
     * Post interactions.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging interactions and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Interactions binary payload.
     * @param contentLength The Content-Length header for the request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Response<Void>> interactionsWithResponseAsync(BinaryData body, long contentLength) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.interactions(
                                this.client.getEndpoint(),
                                this.client.getApiVersion(),
                                body,
                                contentLength,
                                accept,
                                context));
    }

    /**
     * Post interactions.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging interactions and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Interactions binary payload.
     * @param contentLength The Content-Length header for the request.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Response<Void>> interactionsWithResponseAsync(BinaryData body, long contentLength, Context context) {
        final String accept = "application/json";
        return service.interactions(
                this.client.getEndpoint(), this.client.getApiVersion(), body, contentLength, accept, context);
    }

    /**
     * Post interactions.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging interactions and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Interactions binary payload.
     * @param contentLength The Content-Length header for the request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Void> interactionsAsync(BinaryData body, long contentLength) {
        return interactionsWithResponseAsync(body, contentLength).flatMap(ignored -> Mono.empty());
    }

    /**
     * Post interactions.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging interactions and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Interactions binary payload.
     * @param contentLength The Content-Length header for the request.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Void> interactionsAsync(BinaryData body, long contentLength, Context context) {
        return interactionsWithResponseAsync(body, contentLength, context).flatMap(ignored -> Mono.empty());
    }

    /**
     * Post interactions.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging interactions and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Interactions binary payload.
     * @param contentLength The Content-Length header for the request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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 interactions(BinaryData body, long contentLength) {
        interactionsAsync(body, contentLength).block();
    }

    /**
     * Post interactions.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging interactions and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Interactions binary payload.
     * @param contentLength The Content-Length header for the request.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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> interactionsWithResponse(BinaryData body, long contentLength, Context context) {
        return interactionsWithResponseAsync(body, contentLength, context).block();
    }

    /**
     * Post observations.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging observations and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Observations binary payload.
     * @param contentLength The Content-Length header for the request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Response<Void>> observationsWithResponseAsync(Flux<ByteBuffer> body, long contentLength) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.observations(
                                this.client.getEndpoint(),
                                this.client.getApiVersion(),
                                body,
                                contentLength,
                                accept,
                                context));
    }

    /**
     * Post observations.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging observations and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Observations binary payload.
     * @param contentLength The Content-Length header for the request.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Response<Void>> observationsWithResponseAsync(
            Flux<ByteBuffer> body, long contentLength, Context context) {
        final String accept = "application/json";
        return service.observations(
                this.client.getEndpoint(), this.client.getApiVersion(), body, contentLength, accept, context);
    }

    /**
     * Post observations.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging observations and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Observations binary payload.
     * @param contentLength The Content-Length header for the request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Void> observationsAsync(Flux<ByteBuffer> body, long contentLength) {
        return observationsWithResponseAsync(body, contentLength).flatMap(ignored -> Mono.empty());
    }

    /**
     * Post observations.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging observations and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Observations binary payload.
     * @param contentLength The Content-Length header for the request.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Void> observationsAsync(Flux<ByteBuffer> body, long contentLength, Context context) {
        return observationsWithResponseAsync(body, contentLength, context).flatMap(ignored -> Mono.empty());
    }

    /**
     * Post observations.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging observations and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Observations binary payload.
     * @param contentLength The Content-Length header for the request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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 observations(Flux<ByteBuffer> body, long contentLength) {
        observationsAsync(body, contentLength).block();
    }

    /**
     * Post observations.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging observations and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Observations binary payload.
     * @param contentLength The Content-Length header for the request.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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> observationsWithResponse(Flux<ByteBuffer> body, long contentLength, Context context) {
        return observationsWithResponseAsync(body, contentLength, context).block();
    }

    /**
     * Post observations.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging observations and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Observations binary payload.
     * @param contentLength The Content-Length header for the request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Response<Void>> observationsWithResponseAsync(BinaryData body, long contentLength) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.observations(
                                this.client.getEndpoint(),
                                this.client.getApiVersion(),
                                body,
                                contentLength,
                                accept,
                                context));
    }

    /**
     * Post observations.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging observations and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Observations binary payload.
     * @param contentLength The Content-Length header for the request.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Response<Void>> observationsWithResponseAsync(BinaryData body, long contentLength, Context context) {
        final String accept = "application/json";
        return service.observations(
                this.client.getEndpoint(), this.client.getApiVersion(), body, contentLength, accept, context);
    }

    /**
     * Post observations.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging observations and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Observations binary payload.
     * @param contentLength The Content-Length header for the request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Void> observationsAsync(BinaryData body, long contentLength) {
        return observationsWithResponseAsync(body, contentLength).flatMap(ignored -> Mono.empty());
    }

    /**
     * Post observations.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging observations and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Observations binary payload.
     * @param contentLength The Content-Length header for the request.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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)
    public Mono<Void> observationsAsync(BinaryData body, long contentLength, Context context) {
        return observationsWithResponseAsync(body, contentLength, context).flatMap(ignored -> Mono.empty());
    }

    /**
     * Post observations.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging observations and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Observations binary payload.
     * @param contentLength The Content-Length header for the request.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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 observations(BinaryData body, long contentLength) {
        observationsAsync(body, contentLength).block();
    }

    /**
     * Post observations.
     *
     * <p>The endpoint is intended to be used from within a SDK for logging observations and accepts specific format
     * defined in https://github.com/VowpalWabbit/reinforcement_learning. This endpoint should not be used by the
     * customer.
     *
     * @param body Observations binary payload.
     * @param contentLength The Content-Length header for the request.
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException 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> observationsWithResponse(BinaryData body, long contentLength, Context context) {
        return observationsWithResponseAsync(body, contentLength, context).block();
    }

    /**
     * Deletes Logs.
     *
     * <p>Delete all logs of Rank and Reward calls stored by Personalizer.
     *
     * @throws HttpResponseException 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)
    public Mono<Response<Void>> deleteWithResponseAsync() {
        return FluxUtil.withContext(
                context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), context));
    }

    /**
     * Deletes Logs.
     *
     * <p>Delete all logs of Rank and Reward calls stored by Personalizer.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException 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)
    public Mono<Response<Void>> deleteWithResponseAsync(Context context) {
        return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), context);
    }

    /**
     * Deletes Logs.
     *
     * <p>Delete all logs of Rank and Reward calls stored by Personalizer.
     *
     * @throws HttpResponseException 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)
    public Mono<Void> deleteAsync() {
        return deleteWithResponseAsync().flatMap(ignored -> Mono.empty());
    }

    /**
     * Deletes Logs.
     *
     * <p>Delete all logs of Rank and Reward calls stored by Personalizer.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException 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)
    public Mono<Void> deleteAsync(Context context) {
        return deleteWithResponseAsync(context).flatMap(ignored -> Mono.empty());
    }

    /**
     * Deletes Logs.
     *
     * <p>Delete all logs of Rank and Reward calls stored by Personalizer.
     *
     * @throws HttpResponseException 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() {
        deleteAsync().block();
    }

    /**
     * Deletes Logs.
     *
     * <p>Delete all logs of Rank and Reward calls stored by Personalizer.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws HttpResponseException 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(Context context) {
        return deleteWithResponseAsync(context).block();
    }

    /**
     * Get Log Properties.
     *
     * <p>Get properties of the Personalizer logs.
     *
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return properties of the Personalizer logs along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<PersonalizerLogProperties>> getPropertiesWithResponseAsync() {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.getProperties(this.client.getEndpoint(), this.client.getApiVersion(), accept, context));
    }

    /**
     * Get Log Properties.
     *
     * <p>Get properties of the Personalizer logs.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return properties of the Personalizer logs along with {@link Response} on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<PersonalizerLogProperties>> getPropertiesWithResponseAsync(Context context) {
        final String accept = "application/json";
        return service.getProperties(this.client.getEndpoint(), this.client.getApiVersion(), accept, context);
    }

    /**
     * Get Log Properties.
     *
     * <p>Get properties of the Personalizer logs.
     *
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return properties of the Personalizer logs on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PersonalizerLogProperties> getPropertiesAsync() {
        return getPropertiesWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get Log Properties.
     *
     * <p>Get properties of the Personalizer logs.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return properties of the Personalizer logs on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PersonalizerLogProperties> getPropertiesAsync(Context context) {
        return getPropertiesWithResponseAsync(context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get Log Properties.
     *
     * <p>Get properties of the Personalizer logs.
     *
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return properties of the Personalizer logs.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PersonalizerLogProperties getProperties() {
        return getPropertiesAsync().block();
    }

    /**
     * Get Log Properties.
     *
     * <p>Get properties of the Personalizer logs.
     *
     * @param context The context to associate with this operation.
     * @throws IllegalArgumentException thrown if parameters fail the validation.
     * @throws ErrorResponseException thrown if the request is rejected by server.
     * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
     * @return properties of the Personalizer logs along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<PersonalizerLogProperties> getPropertiesWithResponse(Context context) {
        return getPropertiesWithResponseAsync(context).block();
    }
}
