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

package com.azure.resourcemanager.streamanalytics.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.streamanalytics.models.AzureMachineLearningWebServiceInputs;
import com.azure.resourcemanager.streamanalytics.models.AzureMachineLearningWebServiceOutputColumn;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The binding properties associated with an Azure Machine learning web service. */
@Fluent
public final class AzureMachineLearningWebServiceFunctionBindingProperties {
    @JsonIgnore
    private final ClientLogger logger = new ClientLogger(AzureMachineLearningWebServiceFunctionBindingProperties.class);

    /*
     * The Request-Response execute endpoint of the Azure Machine Learning web
     * service. Find out more here:
     * https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs
     */
    @JsonProperty(value = "endpoint")
    private String endpoint;

    /*
     * The API key used to authenticate with Request-Response endpoint.
     */
    @JsonProperty(value = "apiKey")
    private String apiKey;

    /*
     * The inputs for the Azure Machine Learning web service endpoint.
     */
    @JsonProperty(value = "inputs")
    private AzureMachineLearningWebServiceInputs inputs;

    /*
     * A list of outputs from the Azure Machine Learning web service endpoint
     * execution.
     */
    @JsonProperty(value = "outputs")
    private List<AzureMachineLearningWebServiceOutputColumn> outputs;

    /*
     * Number between 1 and 10000 describing maximum number of rows for every
     * Azure ML RRS execute request. Default is 1000.
     */
    @JsonProperty(value = "batchSize")
    private Integer batchSize;

    /**
     * Get the endpoint property: The Request-Response execute endpoint of the Azure Machine Learning web service. Find
     * out more here:
     * https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs.
     *
     * @return the endpoint value.
     */
    public String endpoint() {
        return this.endpoint;
    }

    /**
     * Set the endpoint property: The Request-Response execute endpoint of the Azure Machine Learning web service. Find
     * out more here:
     * https://docs.microsoft.com/en-us/azure/machine-learning/machine-learning-consume-web-services#request-response-service-rrs.
     *
     * @param endpoint the endpoint value to set.
     * @return the AzureMachineLearningWebServiceFunctionBindingProperties object itself.
     */
    public AzureMachineLearningWebServiceFunctionBindingProperties withEndpoint(String endpoint) {
        this.endpoint = endpoint;
        return this;
    }

    /**
     * Get the apiKey property: The API key used to authenticate with Request-Response endpoint.
     *
     * @return the apiKey value.
     */
    public String apiKey() {
        return this.apiKey;
    }

    /**
     * Set the apiKey property: The API key used to authenticate with Request-Response endpoint.
     *
     * @param apiKey the apiKey value to set.
     * @return the AzureMachineLearningWebServiceFunctionBindingProperties object itself.
     */
    public AzureMachineLearningWebServiceFunctionBindingProperties withApiKey(String apiKey) {
        this.apiKey = apiKey;
        return this;
    }

    /**
     * Get the inputs property: The inputs for the Azure Machine Learning web service endpoint.
     *
     * @return the inputs value.
     */
    public AzureMachineLearningWebServiceInputs inputs() {
        return this.inputs;
    }

    /**
     * Set the inputs property: The inputs for the Azure Machine Learning web service endpoint.
     *
     * @param inputs the inputs value to set.
     * @return the AzureMachineLearningWebServiceFunctionBindingProperties object itself.
     */
    public AzureMachineLearningWebServiceFunctionBindingProperties withInputs(
        AzureMachineLearningWebServiceInputs inputs) {
        this.inputs = inputs;
        return this;
    }

    /**
     * Get the outputs property: A list of outputs from the Azure Machine Learning web service endpoint execution.
     *
     * @return the outputs value.
     */
    public List<AzureMachineLearningWebServiceOutputColumn> outputs() {
        return this.outputs;
    }

    /**
     * Set the outputs property: A list of outputs from the Azure Machine Learning web service endpoint execution.
     *
     * @param outputs the outputs value to set.
     * @return the AzureMachineLearningWebServiceFunctionBindingProperties object itself.
     */
    public AzureMachineLearningWebServiceFunctionBindingProperties withOutputs(
        List<AzureMachineLearningWebServiceOutputColumn> outputs) {
        this.outputs = outputs;
        return this;
    }

    /**
     * Get the batchSize property: Number between 1 and 10000 describing maximum number of rows for every Azure ML RRS
     * execute request. Default is 1000.
     *
     * @return the batchSize value.
     */
    public Integer batchSize() {
        return this.batchSize;
    }

    /**
     * Set the batchSize property: Number between 1 and 10000 describing maximum number of rows for every Azure ML RRS
     * execute request. Default is 1000.
     *
     * @param batchSize the batchSize value to set.
     * @return the AzureMachineLearningWebServiceFunctionBindingProperties object itself.
     */
    public AzureMachineLearningWebServiceFunctionBindingProperties withBatchSize(Integer batchSize) {
        this.batchSize = batchSize;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (inputs() != null) {
            inputs().validate();
        }
        if (outputs() != null) {
            outputs().forEach(e -> e.validate());
        }
    }
}
