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

package com.azure.resourcemanager.batchai.models;

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

/**
 * At least one of manual or autoScale settings must be specified. Only one of manual or autoScale settings can be
 * specified. If autoScale settings are specified, the system automatically scales the cluster up and down (within the
 * supplied limits) based on the pending jobs on the cluster.
 */
@Fluent
public final class ScaleSettings {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(ScaleSettings.class);

    /*
     * Manual scale settings for the cluster.
     */
    @JsonProperty(value = "manual")
    private ManualScaleSettings manual;

    /*
     * Auto-scale settings for the cluster.
     */
    @JsonProperty(value = "autoScale")
    private AutoScaleSettings autoScale;

    /**
     * Get the manual property: Manual scale settings for the cluster.
     *
     * @return the manual value.
     */
    public ManualScaleSettings manual() {
        return this.manual;
    }

    /**
     * Set the manual property: Manual scale settings for the cluster.
     *
     * @param manual the manual value to set.
     * @return the ScaleSettings object itself.
     */
    public ScaleSettings withManual(ManualScaleSettings manual) {
        this.manual = manual;
        return this;
    }

    /**
     * Get the autoScale property: Auto-scale settings for the cluster.
     *
     * @return the autoScale value.
     */
    public AutoScaleSettings autoScale() {
        return this.autoScale;
    }

    /**
     * Set the autoScale property: Auto-scale settings for the cluster.
     *
     * @param autoScale the autoScale value to set.
     * @return the ScaleSettings object itself.
     */
    public ScaleSettings withAutoScale(AutoScaleSettings autoScale) {
        this.autoScale = autoScale;
        return this;
    }

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