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

package com.azure.resourcemanager.hdinsight.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;

/** Parameters for a schedule-based autoscale rule, consisting of an array of days + a time and capacity. */
@Fluent
public final class AutoscaleSchedule {
    /*
     * Days of the week for a schedule-based autoscale rule
     */
    @JsonProperty(value = "days")
    private List<DaysOfWeek> days;

    /*
     * Time and capacity for a schedule-based autoscale rule
     */
    @JsonProperty(value = "timeAndCapacity")
    private AutoscaleTimeAndCapacity timeAndCapacity;

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

    /**
     * Get the days property: Days of the week for a schedule-based autoscale rule.
     *
     * @return the days value.
     */
    public List<DaysOfWeek> days() {
        return this.days;
    }

    /**
     * Set the days property: Days of the week for a schedule-based autoscale rule.
     *
     * @param days the days value to set.
     * @return the AutoscaleSchedule object itself.
     */
    public AutoscaleSchedule withDays(List<DaysOfWeek> days) {
        this.days = days;
        return this;
    }

    /**
     * Get the timeAndCapacity property: Time and capacity for a schedule-based autoscale rule.
     *
     * @return the timeAndCapacity value.
     */
    public AutoscaleTimeAndCapacity timeAndCapacity() {
        return this.timeAndCapacity;
    }

    /**
     * Set the timeAndCapacity property: Time and capacity for a schedule-based autoscale rule.
     *
     * @param timeAndCapacity the timeAndCapacity value to set.
     * @return the AutoscaleSchedule object itself.
     */
    public AutoscaleSchedule withTimeAndCapacity(AutoscaleTimeAndCapacity timeAndCapacity) {
        this.timeAndCapacity = timeAndCapacity;
        return this;
    }

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