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

package tsptest.enumservice;

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.serializer.CollectionFormat;
import com.azure.core.util.serializer.JacksonAdapter;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import tsptest.enumservice.implementation.EnumServiceClientImpl;
import tsptest.enumservice.models.Color;
import tsptest.enumservice.models.ColorModel;
import tsptest.enumservice.models.Operation;
import tsptest.enumservice.models.OperationStateValues;
import tsptest.enumservice.models.Priority;

/**
 * Initializes a new instance of the synchronous EnumServiceClient type.
 */
@ServiceClient(builder = EnumServiceClientBuilder.class)
public final class EnumServiceClient {
    @Generated
    private final EnumServiceClientImpl serviceClient;

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

    /**
     * The getColor operation.
     * <p><strong>Response Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * String(Red/Blue/Green)
     * }
     * </pre>
     * 
     * @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 response body along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> getColorWithResponse(RequestOptions requestOptions) {
        return this.serviceClient.getColorWithResponse(requestOptions);
    }

    /**
     * The getColorModel operation.
     * <p><strong>Response Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * String(Red/Blue/Green)
     * }
     * </pre>
     * 
     * @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 response body along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> getColorModelWithResponse(RequestOptions requestOptions) {
        return this.serviceClient.getColorModelWithResponse(requestOptions);
    }

    /**
     * The setColorModel operation.
     * <p><strong>Response Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * {
     *     name: String(Read/Write) (Required)
     *     best: boolean (Required)
     *     age: int (Required)
     *     priority: String(100/0) (Required)
     *     color: String(Red/Blue/Green) (Required)
     *     unit: String(1/0.001/1000) (Required)
     *     priorityValue: String(100/0) (Required)
     *     colorValue: String(Red/Blue/Green) (Required)
     *     colorModelValue: String(Red/Blue/Green) (Required)
     *     unitValue: String(1/0.001/1000) (Optional)
     *     olympicRecord: String(9.58/19.3) (Optional)
     *     olympicRecordValue: String(9.58/19.3) (Optional)
     * }
     * }
     * </pre>
     * 
     * @param color The color parameter. Allowed values: "Red", "Blue", "Green".
     * @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 response body along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> setColorModelWithResponse(String color, RequestOptions requestOptions) {
        return this.serviceClient.setColorModelWithResponse(color, requestOptions);
    }

    /**
     * The setPriority operation.
     * <p><strong>Response Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * {
     *     name: String(Read/Write) (Required)
     *     best: boolean (Required)
     *     age: int (Required)
     *     priority: String(100/0) (Required)
     *     color: String(Red/Blue/Green) (Required)
     *     unit: String(1/0.001/1000) (Required)
     *     priorityValue: String(100/0) (Required)
     *     colorValue: String(Red/Blue/Green) (Required)
     *     colorModelValue: String(Red/Blue/Green) (Required)
     *     unitValue: String(1/0.001/1000) (Optional)
     *     olympicRecord: String(9.58/19.3) (Optional)
     *     olympicRecordValue: String(9.58/19.3) (Optional)
     * }
     * }
     * </pre>
     * 
     * @param priority The priority parameter. Allowed values: 100, 0.
     * @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 response body along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> setPriorityWithResponse(String priority, RequestOptions requestOptions) {
        return this.serviceClient.setPriorityWithResponse(priority, requestOptions);
    }

    /**
     * The getRunningOperation operation.
     * <p><strong>Response Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * {
     *     name: String(Read/Write) (Required)
     *     best: boolean (Required)
     *     age: int (Required)
     *     priority: String(100/0) (Required)
     *     color: String(Red/Blue/Green) (Required)
     *     unit: String(1/0.001/1000) (Required)
     *     priorityValue: String(100/0) (Required)
     *     colorValue: String(Red/Blue/Green) (Required)
     *     colorModelValue: String(Red/Blue/Green) (Required)
     *     unitValue: String(1/0.001/1000) (Optional)
     *     olympicRecord: String(9.58/19.3) (Optional)
     *     olympicRecordValue: String(9.58/19.3) (Optional)
     * }
     * }
     * </pre>
     * 
     * @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 response body along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> getRunningOperationWithResponse(RequestOptions requestOptions) {
        return this.serviceClient.getRunningOperationWithResponse(requestOptions);
    }

    /**
     * The getOperation operation.
     * <p><strong>Response Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * {
     *     name: String(Read/Write) (Required)
     *     best: boolean (Required)
     *     age: int (Required)
     *     priority: String(100/0) (Required)
     *     color: String(Red/Blue/Green) (Required)
     *     unit: String(1/0.001/1000) (Required)
     *     priorityValue: String(100/0) (Required)
     *     colorValue: String(Red/Blue/Green) (Required)
     *     colorModelValue: String(Red/Blue/Green) (Required)
     *     unitValue: String(1/0.001/1000) (Optional)
     *     olympicRecord: String(9.58/19.3) (Optional)
     *     olympicRecordValue: String(9.58/19.3) (Optional)
     * }
     * }
     * </pre>
     * 
     * @param state The state parameter. Allowed values: "Running", "Completed", "Failed".
     * @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 response body along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> getOperationWithResponse(String state, RequestOptions requestOptions) {
        return this.serviceClient.getOperationWithResponse(state, requestOptions);
    }

    /**
     * The setStringEnumArray 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>colorArrayOpt</td><td>List&lt;String&gt;</td><td>No</td><td>The colorArrayOpt parameter. In the form of
     * "," separated string.</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * <p><strong>Response Body Schema</strong></p>
     * 
     * <pre>
     * {@code
     * String
     * }
     * </pre>
     * 
     * @param colorArray The colorArray 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 a sequence of textual characters along with {@link Response}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<BinaryData> setStringEnumArrayWithResponse(List<String> colorArray, RequestOptions requestOptions) {
        return this.serviceClient.setStringEnumArrayWithResponse(colorArray, requestOptions);
    }

    /**
     * The setIntEnumArray 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>priorityArrayOpt</td><td>List&lt;String&gt;</td><td>No</td><td>The priorityArrayOpt parameter. In the
     * form of "," separated string.</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * 
     * @param priorityArray The priorityArray 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}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> setIntEnumArrayWithResponse(List<String> priorityArray, RequestOptions requestOptions) {
        return this.serviceClient.setIntEnumArrayWithResponse(priorityArray, requestOptions);
    }

    /**
     * The setStringArray 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>stringArrayOpt</td><td>List&lt;String&gt;</td><td>No</td><td>The stringArrayOpt parameter. In the form of
     * "," separated string.</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * 
     * @param stringArray The stringArray 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}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> setStringArrayWithResponse(List<String> stringArray, RequestOptions requestOptions) {
        return this.serviceClient.setStringArrayWithResponse(stringArray, requestOptions);
    }

    /**
     * The setIntArray 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>intArrayOpt</td><td>List&lt;Integer&gt;</td><td>No</td><td>The intArrayOpt parameter. In the form of ","
     * separated string.</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * 
     * @param intArray The intArray 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}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> setIntArrayWithResponse(List<Integer> intArray, RequestOptions requestOptions) {
        return this.serviceClient.setIntArrayWithResponse(intArray, requestOptions);
    }

    /**
     * The setStringEnumMulti 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>colorArrayOpt</td><td>List&lt;String&gt;</td><td>No</td><td>The colorArrayOpt parameter. Call
     * {@link RequestOptions#addQueryParam} to add string to array.</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * 
     * @param colorArray The colorArray 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}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> setStringEnumMultiWithResponse(List<String> colorArray, RequestOptions requestOptions) {
        return this.serviceClient.setStringEnumMultiWithResponse(colorArray, requestOptions);
    }

    /**
     * The setIntEnumMulti 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>priorityArrayOpt</td><td>List&lt;String&gt;</td><td>No</td><td>The priorityArrayOpt parameter. Call
     * {@link RequestOptions#addQueryParam} to add string to array.</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * 
     * @param priorityArray The priorityArray 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}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> setIntEnumMultiWithResponse(List<String> priorityArray, RequestOptions requestOptions) {
        return this.serviceClient.setIntEnumMultiWithResponse(priorityArray, requestOptions);
    }

    /**
     * The setStringMulti 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>stringArrayOpt</td><td>List&lt;String&gt;</td><td>No</td><td>The stringArrayOpt parameter. Call
     * {@link RequestOptions#addQueryParam} to add string to array.</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * 
     * @param stringArray The stringArray 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}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> setStringMultiWithResponse(List<String> stringArray, RequestOptions requestOptions) {
        return this.serviceClient.setStringMultiWithResponse(stringArray, requestOptions);
    }

    /**
     * The setIntMulti 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>intArrayOpt</td><td>List&lt;Integer&gt;</td><td>No</td><td>The intArrayOpt parameter. Call
     * {@link RequestOptions#addQueryParam} to add string to array.</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addQueryParam}
     * 
     * @param intArray The intArray 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}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> setIntMultiWithResponse(List<Integer> intArray, RequestOptions requestOptions) {
        return this.serviceClient.setIntMultiWithResponse(intArray, requestOptions);
    }

    /**
     * The setStringEnumArrayHeader operation.
     * <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>color-array-opt</td><td>List&lt;String&gt;</td><td>No</td><td>The colorArrayOpt parameter</td></tr>
     * </table>
     * You can add these to a request with {@link RequestOptions#addHeader}
     * 
     * @param colorArray The colorArray 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}.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Response<Void> setStringEnumArrayHeaderWithResponse(List<String> colorArray, RequestOptions requestOptions) {
        return this.serviceClient.setStringEnumArrayHeaderWithResponse(colorArray, requestOptions);
    }

    /**
     * The getColor 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 the response.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Color getColor() {
        // Generated convenience method for getColorWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return Color.fromString(getColorWithResponse(requestOptions).getValue().toObject(String.class));
    }

    /**
     * The getColorModel 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 the response.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public ColorModel getColorModel() {
        // Generated convenience method for getColorModelWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return ColorModel.fromString(getColorModelWithResponse(requestOptions).getValue().toObject(String.class));
    }

    /**
     * The setColorModel operation.
     * 
     * @param color The color 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 the response.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Operation setColorModel(ColorModel color) {
        // Generated convenience method for setColorModelWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return setColorModelWithResponse(color.toString(), requestOptions).getValue().toObject(Operation.class);
    }

    /**
     * The setPriority operation.
     * 
     * @param priority The priority 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 the response.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Operation setPriority(Priority priority) {
        // Generated convenience method for setPriorityWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return setPriorityWithResponse(String.valueOf(priority.toInt()), requestOptions).getValue()
            .toObject(Operation.class);
    }

    /**
     * The getRunningOperation 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 the response.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Operation getRunningOperation() {
        // Generated convenience method for getRunningOperationWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return getRunningOperationWithResponse(requestOptions).getValue().toObject(Operation.class);
    }

    /**
     * The getOperation operation.
     * 
     * @param state The state 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 the response.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public Operation getOperation(OperationStateValues state) {
        // Generated convenience method for getOperationWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return getOperationWithResponse(state.toString(), requestOptions).getValue().toObject(Operation.class);
    }

    /**
     * The setStringEnumArray operation.
     * 
     * @param colorArray The colorArray parameter.
     * @param colorArrayOpt The colorArrayOpt 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 sequence of textual characters.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public String setStringEnumArray(List<ColorModel> colorArray, List<ColorModel> colorArrayOpt) {
        // Generated convenience method for setStringEnumArrayWithResponse
        RequestOptions requestOptions = new RequestOptions();
        if (colorArrayOpt != null) {
            requestOptions.addQueryParam("colorArrayOpt",
                colorArrayOpt.stream()
                    .map(paramItemValue -> Objects.toString(paramItemValue, ""))
                    .collect(Collectors.joining(",")),
                false);
        }
        return setStringEnumArrayWithResponse(colorArray.stream()
            .map(paramItemValue -> Objects.toString(paramItemValue, ""))
            .collect(Collectors.toList()), requestOptions).getValue().toString();
    }

    /**
     * The setStringEnumArray operation.
     * 
     * @param colorArray The colorArray 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 sequence of textual characters.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public String setStringEnumArray(List<ColorModel> colorArray) {
        // Generated convenience method for setStringEnumArrayWithResponse
        RequestOptions requestOptions = new RequestOptions();
        return setStringEnumArrayWithResponse(colorArray.stream()
            .map(paramItemValue -> Objects.toString(paramItemValue, ""))
            .collect(Collectors.toList()), requestOptions).getValue().toString();
    }

    /**
     * The setIntEnumArray operation.
     * 
     * @param priorityArray The priorityArray parameter.
     * @param priorityArrayOpt The priorityArrayOpt 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setIntEnumArray(List<Priority> priorityArray, List<Priority> priorityArrayOpt) {
        // Generated convenience method for setIntEnumArrayWithResponse
        RequestOptions requestOptions = new RequestOptions();
        if (priorityArrayOpt != null) {
            requestOptions.addQueryParam("priorityArrayOpt",
                priorityArrayOpt.stream()
                    .map(paramItemValue -> Objects.toString(paramItemValue == null ? null : paramItemValue.toInt(), ""))
                    .collect(Collectors.joining(",")),
                false);
        }
        setIntEnumArrayWithResponse(priorityArray.stream()
            .map(paramItemValue -> paramItemValue == null ? "" : String.valueOf(paramItemValue.toInt()))
            .collect(Collectors.toList()), requestOptions).getValue();
    }

    /**
     * The setIntEnumArray operation.
     * 
     * @param priorityArray The priorityArray 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setIntEnumArray(List<Priority> priorityArray) {
        // Generated convenience method for setIntEnumArrayWithResponse
        RequestOptions requestOptions = new RequestOptions();
        setIntEnumArrayWithResponse(priorityArray.stream()
            .map(paramItemValue -> paramItemValue == null ? "" : String.valueOf(paramItemValue.toInt()))
            .collect(Collectors.toList()), requestOptions).getValue();
    }

    /**
     * The setStringArray operation.
     * 
     * @param stringArray The stringArray parameter.
     * @param stringArrayOpt The stringArrayOpt 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setStringArray(List<String> stringArray, List<String> stringArrayOpt) {
        // Generated convenience method for setStringArrayWithResponse
        RequestOptions requestOptions = new RequestOptions();
        if (stringArrayOpt != null) {
            requestOptions.addQueryParam("stringArrayOpt",
                stringArrayOpt.stream()
                    .map(paramItemValue -> Objects.toString(paramItemValue, ""))
                    .collect(Collectors.joining(",")),
                false);
        }
        setStringArrayWithResponse(stringArray, requestOptions).getValue();
    }

    /**
     * The setStringArray operation.
     * 
     * @param stringArray The stringArray 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setStringArray(List<String> stringArray) {
        // Generated convenience method for setStringArrayWithResponse
        RequestOptions requestOptions = new RequestOptions();
        setStringArrayWithResponse(stringArray, requestOptions).getValue();
    }

    /**
     * The setIntArray operation.
     * 
     * @param intArray The intArray parameter.
     * @param intArrayOpt The intArrayOpt 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setIntArray(List<Integer> intArray, List<Integer> intArrayOpt) {
        // Generated convenience method for setIntArrayWithResponse
        RequestOptions requestOptions = new RequestOptions();
        if (intArrayOpt != null) {
            requestOptions.addQueryParam("intArrayOpt",
                JacksonAdapter.createDefaultSerializerAdapter().serializeIterable(intArrayOpt, CollectionFormat.CSV),
                false);
        }
        setIntArrayWithResponse(intArray, requestOptions).getValue();
    }

    /**
     * The setIntArray operation.
     * 
     * @param intArray The intArray 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setIntArray(List<Integer> intArray) {
        // Generated convenience method for setIntArrayWithResponse
        RequestOptions requestOptions = new RequestOptions();
        setIntArrayWithResponse(intArray, requestOptions).getValue();
    }

    /**
     * The setStringEnumMulti operation.
     * 
     * @param colorArray The colorArray parameter.
     * @param colorArrayOpt The colorArrayOpt 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setStringEnumMulti(List<ColorModel> colorArray, List<ColorModel> colorArrayOpt) {
        // Generated convenience method for setStringEnumMultiWithResponse
        RequestOptions requestOptions = new RequestOptions();
        if (colorArrayOpt != null) {
            for (ColorModel paramItemValue : colorArrayOpt) {
                if (paramItemValue != null) {
                    requestOptions.addQueryParam("colorArrayOpt", paramItemValue.toString(), false);
                }
            }
        }
        setStringEnumMultiWithResponse(colorArray.stream()
            .map(paramItemValue -> Objects.toString(paramItemValue, ""))
            .collect(Collectors.toList()), requestOptions).getValue();
    }

    /**
     * The setStringEnumMulti operation.
     * 
     * @param colorArray The colorArray 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setStringEnumMulti(List<ColorModel> colorArray) {
        // Generated convenience method for setStringEnumMultiWithResponse
        RequestOptions requestOptions = new RequestOptions();
        setStringEnumMultiWithResponse(colorArray.stream()
            .map(paramItemValue -> Objects.toString(paramItemValue, ""))
            .collect(Collectors.toList()), requestOptions).getValue();
    }

    /**
     * The setIntEnumMulti operation.
     * 
     * @param priorityArray The priorityArray parameter.
     * @param priorityArrayOpt The priorityArrayOpt 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setIntEnumMulti(List<Priority> priorityArray, List<Priority> priorityArrayOpt) {
        // Generated convenience method for setIntEnumMultiWithResponse
        RequestOptions requestOptions = new RequestOptions();
        if (priorityArrayOpt != null) {
            for (Priority paramItemValue : priorityArrayOpt) {
                if (paramItemValue != null) {
                    requestOptions.addQueryParam("priorityArrayOpt", String.valueOf(paramItemValue.toInt()), false);
                }
            }
        }
        setIntEnumMultiWithResponse(priorityArray.stream()
            .map(paramItemValue -> paramItemValue == null ? "" : String.valueOf(paramItemValue.toInt()))
            .collect(Collectors.toList()), requestOptions).getValue();
    }

    /**
     * The setIntEnumMulti operation.
     * 
     * @param priorityArray The priorityArray 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setIntEnumMulti(List<Priority> priorityArray) {
        // Generated convenience method for setIntEnumMultiWithResponse
        RequestOptions requestOptions = new RequestOptions();
        setIntEnumMultiWithResponse(priorityArray.stream()
            .map(paramItemValue -> paramItemValue == null ? "" : String.valueOf(paramItemValue.toInt()))
            .collect(Collectors.toList()), requestOptions).getValue();
    }

    /**
     * The setStringMulti operation.
     * 
     * @param stringArray The stringArray parameter.
     * @param stringArrayOpt The stringArrayOpt 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setStringMulti(List<String> stringArray, List<String> stringArrayOpt) {
        // Generated convenience method for setStringMultiWithResponse
        RequestOptions requestOptions = new RequestOptions();
        if (stringArrayOpt != null) {
            for (String paramItemValue : stringArrayOpt) {
                if (paramItemValue != null) {
                    requestOptions.addQueryParam("stringArrayOpt", paramItemValue, false);
                }
            }
        }
        setStringMultiWithResponse(stringArray, requestOptions).getValue();
    }

    /**
     * The setStringMulti operation.
     * 
     * @param stringArray The stringArray 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setStringMulti(List<String> stringArray) {
        // Generated convenience method for setStringMultiWithResponse
        RequestOptions requestOptions = new RequestOptions();
        setStringMultiWithResponse(stringArray, requestOptions).getValue();
    }

    /**
     * The setIntMulti operation.
     * 
     * @param intArray The intArray parameter.
     * @param intArrayOpt The intArrayOpt 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setIntMulti(List<Integer> intArray, List<Integer> intArrayOpt) {
        // Generated convenience method for setIntMultiWithResponse
        RequestOptions requestOptions = new RequestOptions();
        if (intArrayOpt != null) {
            for (int paramItemValue : intArrayOpt) {
                requestOptions.addQueryParam("intArrayOpt", String.valueOf(paramItemValue), false);
            }
        }
        setIntMultiWithResponse(intArray, requestOptions).getValue();
    }

    /**
     * The setIntMulti operation.
     * 
     * @param intArray The intArray 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setIntMulti(List<Integer> intArray) {
        // Generated convenience method for setIntMultiWithResponse
        RequestOptions requestOptions = new RequestOptions();
        setIntMultiWithResponse(intArray, requestOptions).getValue();
    }

    /**
     * The setStringEnumArrayHeader operation.
     * 
     * @param colorArray The colorArray parameter.
     * @param colorArrayOpt The colorArrayOpt 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setStringEnumArrayHeader(List<ColorModel> colorArray, List<ColorModel> colorArrayOpt) {
        // Generated convenience method for setStringEnumArrayHeaderWithResponse
        RequestOptions requestOptions = new RequestOptions();
        if (colorArrayOpt != null) {
            requestOptions.setHeader(HttpHeaderName.fromString("color-array-opt"),
                colorArrayOpt.stream()
                    .map(paramItemValue -> Objects.toString(paramItemValue, ""))
                    .collect(Collectors.joining(",")));
        }
        setStringEnumArrayHeaderWithResponse(colorArray.stream()
            .map(paramItemValue -> Objects.toString(paramItemValue, ""))
            .collect(Collectors.toList()), requestOptions).getValue();
    }

    /**
     * The setStringEnumArrayHeader operation.
     * 
     * @param colorArray The colorArray 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.
     */
    @Generated
    @ServiceMethod(returns = ReturnType.SINGLE)
    public void setStringEnumArrayHeader(List<ColorModel> colorArray) {
        // Generated convenience method for setStringEnumArrayHeaderWithResponse
        RequestOptions requestOptions = new RequestOptions();
        setStringEnumArrayHeaderWithResponse(colorArray.stream()
            .map(paramItemValue -> Objects.toString(paramItemValue, ""))
            .collect(Collectors.toList()), requestOptions).getValue();
    }
}
