// 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.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.streamanalytics.fluent.models.AzureMachineLearningWebServiceFunctionBindingProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;
import java.util.List;

/** The binding to an Azure Machine Learning web service. */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type")
@JsonTypeName("Microsoft.MachineLearning/WebService")
@Fluent
public final class AzureMachineLearningWebServiceFunctionBinding extends FunctionBinding {
    @JsonIgnore
    private final ClientLogger logger = new ClientLogger(AzureMachineLearningWebServiceFunctionBinding.class);

    /*
     * The binding properties associated with an Azure Machine learning web
     * service.
     */
    @JsonProperty(value = "properties")
    private AzureMachineLearningWebServiceFunctionBindingProperties innerProperties;

    /**
     * Get the innerProperties property: The binding properties associated with an Azure Machine learning web service.
     *
     * @return the innerProperties value.
     */
    private AzureMachineLearningWebServiceFunctionBindingProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * 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.innerProperties() == null ? null : this.innerProperties().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 AzureMachineLearningWebServiceFunctionBinding object itself.
     */
    public AzureMachineLearningWebServiceFunctionBinding withEndpoint(String endpoint) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureMachineLearningWebServiceFunctionBindingProperties();
        }
        this.innerProperties().withEndpoint(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.innerProperties() == null ? null : this.innerProperties().apiKey();
    }

    /**
     * Set the apiKey property: The API key used to authenticate with Request-Response endpoint.
     *
     * @param apiKey the apiKey value to set.
     * @return the AzureMachineLearningWebServiceFunctionBinding object itself.
     */
    public AzureMachineLearningWebServiceFunctionBinding withApiKey(String apiKey) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureMachineLearningWebServiceFunctionBindingProperties();
        }
        this.innerProperties().withApiKey(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.innerProperties() == null ? null : this.innerProperties().inputs();
    }

    /**
     * Set the inputs property: The inputs for the Azure Machine Learning web service endpoint.
     *
     * @param inputs the inputs value to set.
     * @return the AzureMachineLearningWebServiceFunctionBinding object itself.
     */
    public AzureMachineLearningWebServiceFunctionBinding withInputs(AzureMachineLearningWebServiceInputs inputs) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureMachineLearningWebServiceFunctionBindingProperties();
        }
        this.innerProperties().withInputs(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.innerProperties() == null ? null : this.innerProperties().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 AzureMachineLearningWebServiceFunctionBinding object itself.
     */
    public AzureMachineLearningWebServiceFunctionBinding withOutputs(
        List<AzureMachineLearningWebServiceOutputColumn> outputs) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureMachineLearningWebServiceFunctionBindingProperties();
        }
        this.innerProperties().withOutputs(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.innerProperties() == null ? null : this.innerProperties().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 AzureMachineLearningWebServiceFunctionBinding object itself.
     */
    public AzureMachineLearningWebServiceFunctionBinding withBatchSize(Integer batchSize) {
        if (this.innerProperties() == null) {
            this.innerProperties = new AzureMachineLearningWebServiceFunctionBindingProperties();
        }
        this.innerProperties().withBatchSize(batchSize);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
