// 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.PersonalizerModelProperties;
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.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.exception.HttpResponseException;
import com.azure.core.http.rest.Response;
import com.azure.core.http.rest.RestProxy;
import com.azure.core.http.rest.StreamResponse;
import com.azure.core.util.BinaryData;
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.fasterxml.jackson.databind.util.ByteBufferBackedInputStream;
import java.io.InputStream;
import java.io.SequenceInputStream;
import java.nio.ByteBuffer;
import java.util.Enumeration;
import java.util.Iterator;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

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

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

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

    /**
     * The interface defining all the services for PersonalizerClientV1Preview3Models to be used by the proxy service to
     * perform REST calls.
     */
    @Host("{Endpoint}/personalizer/{ApiVersion}")
    @ServiceInterface(name = "PersonalizerClientV1")
    public interface ModelsService {
        @Get("/model")
        @ExpectedResponses({200})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<StreamResponse> get(
                @HostParam("Endpoint") String endpoint,
                @HostParam("ApiVersion") String apiVersion,
                @QueryParam("signed") Boolean signed,
                @HeaderParam("Accept") String accept,
                Context context);

        @Put("/model")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<Void>> importMethod(
                @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);

        @Put("/model")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<Void>> importMethod(
                @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("/model")
        @ExpectedResponses({204})
        @UnexpectedResponseExceptionType(ErrorResponseException.class)
        Mono<Response<Void>> reset(
                @HostParam("Endpoint") String endpoint,
                @HostParam("ApiVersion") String apiVersion,
                @HeaderParam("Accept") String accept,
                Context context);

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

    /**
     * Get Model.
     *
     * <p>Get the model file generated by Personalizer service.
     *
     * @param signed True if requesting signed model zip archive, false otherwise.
     * @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 model file generated by Personalizer service on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<StreamResponse> getWithResponseAsync(Boolean signed) {
        final String accept = "application/octet-stream, application/json";
        return FluxUtil.withContext(
                context ->
                        service.get(this.client.getEndpoint(), this.client.getApiVersion(), signed, accept, context));
    }

    /**
     * Get Model.
     *
     * <p>Get the model file generated by Personalizer service.
     *
     * @param signed True if requesting signed model zip archive, false otherwise.
     * @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 model file generated by Personalizer service on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<StreamResponse> getWithResponseAsync(Boolean signed, Context context) {
        final String accept = "application/octet-stream, application/json";
        return service.get(this.client.getEndpoint(), this.client.getApiVersion(), signed, accept, context);
    }

    /**
     * Get Model.
     *
     * <p>Get the model file generated by Personalizer service.
     *
     * @param signed True if requesting signed model zip archive, false otherwise.
     * @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 model file generated by Personalizer service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Flux<ByteBuffer> getAsync(Boolean signed) {
        return getWithResponseAsync(signed).flatMapMany(StreamResponse::getValue);
    }

    /**
     * Get Model.
     *
     * <p>Get the model file generated by Personalizer service.
     *
     * @param signed True if requesting signed model zip archive, false otherwise.
     * @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 model file generated by Personalizer service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Flux<ByteBuffer> getAsync(Boolean signed, Context context) {
        return getWithResponseAsync(signed, context).flatMapMany(StreamResponse::getValue);
    }

    /**
     * Get Model.
     *
     * <p>Get the model file generated by Personalizer service.
     *
     * @param signed True if requesting signed model zip archive, false otherwise.
     * @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 model file generated by Personalizer service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public InputStream get(Boolean signed) {
        Iterator<ByteBufferBackedInputStream> iterator =
                getAsync(signed).map(ByteBufferBackedInputStream::new).toStream().iterator();
        Enumeration<InputStream> enumeration =
                new Enumeration<InputStream>() {
                    @Override
                    public boolean hasMoreElements() {
                        return iterator.hasNext();
                    }

                    @Override
                    public InputStream nextElement() {
                        return iterator.next();
                    }
                };
        return new SequenceInputStream(enumeration);
    }

    /**
     * Get Model.
     *
     * <p>Get the model file generated by Personalizer service.
     *
     * @param signed True if requesting signed model zip archive, false otherwise.
     * @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 model file generated by Personalizer service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public StreamResponse getWithResponse(Boolean signed, Context context) {
        return getWithResponseAsync(signed, context).block();
    }

    /**
     * Put the digitally signed model file.
     *
     * <p>Replace the existing model file for the Personalizer service.
     *
     * @param body The digitally signed model file obtained from getting the model.
     * @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>> importMethodWithResponseAsync(Flux<ByteBuffer> body, long contentLength) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.importMethod(
                                this.client.getEndpoint(),
                                this.client.getApiVersion(),
                                body,
                                contentLength,
                                accept,
                                context));
    }

    /**
     * Put the digitally signed model file.
     *
     * <p>Replace the existing model file for the Personalizer service.
     *
     * @param body The digitally signed model file obtained from getting the model.
     * @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>> importMethodWithResponseAsync(
            Flux<ByteBuffer> body, long contentLength, Context context) {
        final String accept = "application/json";
        return service.importMethod(
                this.client.getEndpoint(), this.client.getApiVersion(), body, contentLength, accept, context);
    }

    /**
     * Put the digitally signed model file.
     *
     * <p>Replace the existing model file for the Personalizer service.
     *
     * @param body The digitally signed model file obtained from getting the model.
     * @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> importMethodAsync(Flux<ByteBuffer> body, long contentLength) {
        return importMethodWithResponseAsync(body, contentLength).flatMap(ignored -> Mono.empty());
    }

    /**
     * Put the digitally signed model file.
     *
     * <p>Replace the existing model file for the Personalizer service.
     *
     * @param body The digitally signed model file obtained from getting the model.
     * @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> importMethodAsync(Flux<ByteBuffer> body, long contentLength, Context context) {
        return importMethodWithResponseAsync(body, contentLength, context).flatMap(ignored -> Mono.empty());
    }

    /**
     * Put the digitally signed model file.
     *
     * <p>Replace the existing model file for the Personalizer service.
     *
     * @param body The digitally signed model file obtained from getting the model.
     * @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 importMethod(Flux<ByteBuffer> body, long contentLength) {
        importMethodAsync(body, contentLength).block();
    }

    /**
     * Put the digitally signed model file.
     *
     * <p>Replace the existing model file for the Personalizer service.
     *
     * @param body The digitally signed model file obtained from getting the model.
     * @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> importMethodWithResponse(Flux<ByteBuffer> body, long contentLength, Context context) {
        return importMethodWithResponseAsync(body, contentLength, context).block();
    }

    /**
     * Put the digitally signed model file.
     *
     * <p>Replace the existing model file for the Personalizer service.
     *
     * @param body The digitally signed model file obtained from getting the model.
     * @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>> importMethodWithResponseAsync(BinaryData body, long contentLength) {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.importMethod(
                                this.client.getEndpoint(),
                                this.client.getApiVersion(),
                                body,
                                contentLength,
                                accept,
                                context));
    }

    /**
     * Put the digitally signed model file.
     *
     * <p>Replace the existing model file for the Personalizer service.
     *
     * @param body The digitally signed model file obtained from getting the model.
     * @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>> importMethodWithResponseAsync(BinaryData body, long contentLength, Context context) {
        final String accept = "application/json";
        return service.importMethod(
                this.client.getEndpoint(), this.client.getApiVersion(), body, contentLength, accept, context);
    }

    /**
     * Put the digitally signed model file.
     *
     * <p>Replace the existing model file for the Personalizer service.
     *
     * @param body The digitally signed model file obtained from getting the model.
     * @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> importMethodAsync(BinaryData body, long contentLength) {
        return importMethodWithResponseAsync(body, contentLength).flatMap(ignored -> Mono.empty());
    }

    /**
     * Put the digitally signed model file.
     *
     * <p>Replace the existing model file for the Personalizer service.
     *
     * @param body The digitally signed model file obtained from getting the model.
     * @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> importMethodAsync(BinaryData body, long contentLength, Context context) {
        return importMethodWithResponseAsync(body, contentLength, context).flatMap(ignored -> Mono.empty());
    }

    /**
     * Put the digitally signed model file.
     *
     * <p>Replace the existing model file for the Personalizer service.
     *
     * @param body The digitally signed model file obtained from getting the model.
     * @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 importMethod(BinaryData body, long contentLength) {
        importMethodAsync(body, contentLength).block();
    }

    /**
     * Put the digitally signed model file.
     *
     * <p>Replace the existing model file for the Personalizer service.
     *
     * @param body The digitally signed model file obtained from getting the model.
     * @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> importMethodWithResponse(BinaryData body, long contentLength, Context context) {
        return importMethodWithResponseAsync(body, contentLength, context).block();
    }

    /**
     * Reset Model.
     *
     * <p>Resets the model file generated by Personalizer service.
     *
     * @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>> resetWithResponseAsync() {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context -> service.reset(this.client.getEndpoint(), this.client.getApiVersion(), accept, context));
    }

    /**
     * Reset Model.
     *
     * <p>Resets the model file generated by Personalizer service.
     *
     * @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>> resetWithResponseAsync(Context context) {
        final String accept = "application/json";
        return service.reset(this.client.getEndpoint(), this.client.getApiVersion(), accept, context);
    }

    /**
     * Reset Model.
     *
     * <p>Resets the model file generated by Personalizer service.
     *
     * @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> resetAsync() {
        return resetWithResponseAsync().flatMap(ignored -> Mono.empty());
    }

    /**
     * Reset Model.
     *
     * <p>Resets the model file generated by Personalizer service.
     *
     * @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> resetAsync(Context context) {
        return resetWithResponseAsync(context).flatMap(ignored -> Mono.empty());
    }

    /**
     * Reset Model.
     *
     * <p>Resets the model file generated by Personalizer service.
     *
     * @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 reset() {
        resetAsync().block();
    }

    /**
     * Reset Model.
     *
     * <p>Resets the model file generated by Personalizer service.
     *
     * @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> resetWithResponse(Context context) {
        return resetWithResponseAsync(context).block();
    }

    /**
     * Get Model Properties.
     *
     * <p>Get properties of the model file generated by Personalizer service.
     *
     * @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 properties of the model file generated by Personalizer service along with {@link Response} on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<PersonalizerModelProperties>> getPropertiesWithResponseAsync() {
        final String accept = "application/json";
        return FluxUtil.withContext(
                context ->
                        service.getProperties(this.client.getEndpoint(), this.client.getApiVersion(), accept, context));
    }

    /**
     * Get Model Properties.
     *
     * <p>Get properties of the model file generated by Personalizer service.
     *
     * @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 properties of the model file generated by Personalizer service along with {@link Response} on successful
     *     completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<Response<PersonalizerModelProperties>> getPropertiesWithResponseAsync(Context context) {
        final String accept = "application/json";
        return service.getProperties(this.client.getEndpoint(), this.client.getApiVersion(), accept, context);
    }

    /**
     * Get Model Properties.
     *
     * <p>Get properties of the model file generated by Personalizer service.
     *
     * @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 properties of the model file generated by Personalizer service on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PersonalizerModelProperties> getPropertiesAsync() {
        return getPropertiesWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get Model Properties.
     *
     * <p>Get properties of the model file generated by Personalizer service.
     *
     * @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 properties of the model file generated by Personalizer service on successful completion of {@link Mono}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Mono<PersonalizerModelProperties> getPropertiesAsync(Context context) {
        return getPropertiesWithResponseAsync(context).flatMap(res -> Mono.justOrEmpty(res.getValue()));
    }

    /**
     * Get Model Properties.
     *
     * <p>Get properties of the model file generated by Personalizer service.
     *
     * @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 properties of the model file generated by Personalizer service.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public PersonalizerModelProperties getProperties() {
        return getPropertiesAsync().block();
    }

    /**
     * Get Model Properties.
     *
     * <p>Get properties of the model file generated by Personalizer service.
     *
     * @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 properties of the model file generated by Personalizer service along with {@link Response}.
     */
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<PersonalizerModelProperties> getPropertiesWithResponse(Context context) {
        return getPropertiesWithResponseAsync(context).block();
    }
}
