// 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.AzureMachineLearningWebServiceFunctionBindingRetrievalProperties;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/**
 * The parameters needed to retrieve the default function definition for an Azure Machine Learning web service function.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "bindingType")
@JsonTypeName("Microsoft.MachineLearning/WebService")
@Fluent
public final class AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters
    extends FunctionRetrieveDefaultDefinitionParameters {
    @JsonIgnore
    private final ClientLogger logger =
        new ClientLogger(AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters.class);

    /*
     * The binding retrieval properties associated with an Azure Machine
     * learning web service.
     */
    @JsonProperty(value = "bindingRetrievalProperties")
    private AzureMachineLearningWebServiceFunctionBindingRetrievalProperties innerBindingRetrievalProperties;

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

    /**
     * Get the executeEndpoint 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 executeEndpoint value.
     */
    public String executeEndpoint() {
        return this.innerBindingRetrievalProperties() == null
            ? null
            : this.innerBindingRetrievalProperties().executeEndpoint();
    }

    /**
     * Set the executeEndpoint 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 executeEndpoint the executeEndpoint value to set.
     * @return the AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters object itself.
     */
    public AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters withExecuteEndpoint(
        String executeEndpoint) {
        if (this.innerBindingRetrievalProperties() == null) {
            this.innerBindingRetrievalProperties =
                new AzureMachineLearningWebServiceFunctionBindingRetrievalProperties();
        }
        this.innerBindingRetrievalProperties().withExecuteEndpoint(executeEndpoint);
        return this;
    }

    /**
     * Get the udfType property: The function type.
     *
     * @return the udfType value.
     */
    public UdfType udfType() {
        return this.innerBindingRetrievalProperties() == null ? null : this.innerBindingRetrievalProperties().udfType();
    }

    /**
     * Set the udfType property: The function type.
     *
     * @param udfType the udfType value to set.
     * @return the AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters object itself.
     */
    public AzureMachineLearningWebServiceFunctionRetrieveDefaultDefinitionParameters withUdfType(UdfType udfType) {
        if (this.innerBindingRetrievalProperties() == null) {
            this.innerBindingRetrievalProperties =
                new AzureMachineLearningWebServiceFunctionBindingRetrievalProperties();
        }
        this.innerBindingRetrievalProperties().withUdfType(udfType);
        return this;
    }

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