// 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.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** The ImageObjectDetectionBase model. */
@Fluent
public class ImageObjectDetectionBase extends ImageVertical {
    /*
     * Settings used for training the model.
     */
    @JsonProperty(value = "modelSettings")
    private ImageModelSettingsObjectDetection modelSettings;

    /*
     * Search space for sampling different combinations of models and their hyperparameters.
     */
    @JsonProperty(value = "searchSpace")
    private List<ImageModelDistributionSettingsObjectDetection> searchSpace;

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

    /**
     * Get the modelSettings property: Settings used for training the model.
     *
     * @return the modelSettings value.
     */
    public ImageModelSettingsObjectDetection modelSettings() {
        return this.modelSettings;
    }

    /**
     * Set the modelSettings property: Settings used for training the model.
     *
     * @param modelSettings the modelSettings value to set.
     * @return the ImageObjectDetectionBase object itself.
     */
    public ImageObjectDetectionBase withModelSettings(ImageModelSettingsObjectDetection modelSettings) {
        this.modelSettings = modelSettings;
        return this;
    }

    /**
     * Get the searchSpace property: Search space for sampling different combinations of models and their
     * hyperparameters.
     *
     * @return the searchSpace value.
     */
    public List<ImageModelDistributionSettingsObjectDetection> searchSpace() {
        return this.searchSpace;
    }

    /**
     * Set the searchSpace property: Search space for sampling different combinations of models and their
     * hyperparameters.
     *
     * @param searchSpace the searchSpace value to set.
     * @return the ImageObjectDetectionBase object itself.
     */
    public ImageObjectDetectionBase withSearchSpace(List<ImageModelDistributionSettingsObjectDetection> searchSpace) {
        this.searchSpace = searchSpace;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ImageObjectDetectionBase withLimitSettings(ImageLimitSettings limitSettings) {
        super.withLimitSettings(limitSettings);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ImageObjectDetectionBase withSweepSettings(ImageSweepSettings sweepSettings) {
        super.withSweepSettings(sweepSettings);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ImageObjectDetectionBase withValidationData(MLTableJobInput validationData) {
        super.withValidationData(validationData);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public ImageObjectDetectionBase withValidationDataSize(Double validationDataSize) {
        super.withValidationDataSize(validationDataSize);
        return this;
    }

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