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

package com.azure.resourcemanager.machinelearning.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Abstract class for AutoML tasks that train image (computer vision) models - such as Image Classification / Image
 * Classification Multilabel / Image Object Detection / Image Instance Segmentation.
 */
@Fluent
public class ImageVertical {
    /*
     * [Required] Limit settings for the AutoML job.
     */
    @JsonProperty(value = "limitSettings", required = true)
    private ImageLimitSettings limitSettings;

    /*
     * Model sweeping and hyperparameter sweeping related settings.
     */
    @JsonProperty(value = "sweepSettings")
    private ImageSweepSettings sweepSettings;

    /*
     * Validation data inputs.
     */
    @JsonProperty(value = "validationData")
    private MLTableJobInput validationData;

    /*
     * The fraction of training dataset that needs to be set aside for validation purpose.
     * Values between (0.0 , 1.0)
     * Applied when validation dataset is not provided.
     */
    @JsonProperty(value = "validationDataSize")
    private Double validationDataSize;

    /** Creates an instance of ImageVertical class. */
    public ImageVertical() {
    }

    /**
     * Get the limitSettings property: [Required] Limit settings for the AutoML job.
     *
     * @return the limitSettings value.
     */
    public ImageLimitSettings limitSettings() {
        return this.limitSettings;
    }

    /**
     * Set the limitSettings property: [Required] Limit settings for the AutoML job.
     *
     * @param limitSettings the limitSettings value to set.
     * @return the ImageVertical object itself.
     */
    public ImageVertical withLimitSettings(ImageLimitSettings limitSettings) {
        this.limitSettings = limitSettings;
        return this;
    }

    /**
     * Get the sweepSettings property: Model sweeping and hyperparameter sweeping related settings.
     *
     * @return the sweepSettings value.
     */
    public ImageSweepSettings sweepSettings() {
        return this.sweepSettings;
    }

    /**
     * Set the sweepSettings property: Model sweeping and hyperparameter sweeping related settings.
     *
     * @param sweepSettings the sweepSettings value to set.
     * @return the ImageVertical object itself.
     */
    public ImageVertical withSweepSettings(ImageSweepSettings sweepSettings) {
        this.sweepSettings = sweepSettings;
        return this;
    }

    /**
     * Get the validationData property: Validation data inputs.
     *
     * @return the validationData value.
     */
    public MLTableJobInput validationData() {
        return this.validationData;
    }

    /**
     * Set the validationData property: Validation data inputs.
     *
     * @param validationData the validationData value to set.
     * @return the ImageVertical object itself.
     */
    public ImageVertical withValidationData(MLTableJobInput validationData) {
        this.validationData = validationData;
        return this;
    }

    /**
     * Get the validationDataSize property: The fraction of training dataset that needs to be set aside for validation
     * purpose. Values between (0.0 , 1.0) Applied when validation dataset is not provided.
     *
     * @return the validationDataSize value.
     */
    public Double validationDataSize() {
        return this.validationDataSize;
    }

    /**
     * Set the validationDataSize property: The fraction of training dataset that needs to be set aside for validation
     * purpose. Values between (0.0 , 1.0) Applied when validation dataset is not provided.
     *
     * @param validationDataSize the validationDataSize value to set.
     * @return the ImageVertical object itself.
     */
    public ImageVertical withValidationDataSize(Double validationDataSize) {
        this.validationDataSize = validationDataSize;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (limitSettings() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property limitSettings in model ImageVertical"));
        } else {
            limitSettings().validate();
        }
        if (sweepSettings() != null) {
            sweepSettings().validate();
        }
        if (validationData() != null) {
            validationData().validate();
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(ImageVertical.class);
}
