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

package com.azure.resourcemanager.desktopvirtualization.models;

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

/** A ScalingPlanPooledSchedule. */
@Fluent
public final class ScalingSchedule {
    /*
     * Name of the ScalingPlanPooledSchedule.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * Set of days of the week on which this schedule is active.
     */
    @JsonProperty(value = "daysOfWeek")
    private List<ScalingScheduleDaysOfWeekItem> daysOfWeek;

    /*
     * Starting time for ramp up period.
     */
    @JsonProperty(value = "rampUpStartTime")
    private Time rampUpStartTime;

    /*
     * Load balancing algorithm for ramp up period.
     */
    @JsonProperty(value = "rampUpLoadBalancingAlgorithm")
    private SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm;

    /*
     * Minimum host percentage for ramp up period.
     */
    @JsonProperty(value = "rampUpMinimumHostsPct")
    private Integer rampUpMinimumHostsPct;

    /*
     * Capacity threshold for ramp up period.
     */
    @JsonProperty(value = "rampUpCapacityThresholdPct")
    private Integer rampUpCapacityThresholdPct;

    /*
     * Starting time for peak period.
     */
    @JsonProperty(value = "peakStartTime")
    private Time peakStartTime;

    /*
     * Load balancing algorithm for peak period.
     */
    @JsonProperty(value = "peakLoadBalancingAlgorithm")
    private SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm;

    /*
     * Starting time for ramp down period.
     */
    @JsonProperty(value = "rampDownStartTime")
    private Time rampDownStartTime;

    /*
     * Load balancing algorithm for ramp down period.
     */
    @JsonProperty(value = "rampDownLoadBalancingAlgorithm")
    private SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm;

    /*
     * Minimum host percentage for ramp down period.
     */
    @JsonProperty(value = "rampDownMinimumHostsPct")
    private Integer rampDownMinimumHostsPct;

    /*
     * Capacity threshold for ramp down period.
     */
    @JsonProperty(value = "rampDownCapacityThresholdPct")
    private Integer rampDownCapacityThresholdPct;

    /*
     * Should users be logged off forcefully from hosts.
     */
    @JsonProperty(value = "rampDownForceLogoffUsers")
    private Boolean rampDownForceLogoffUsers;

    /*
     * Specifies when to stop hosts during ramp down period.
     */
    @JsonProperty(value = "rampDownStopHostsWhen")
    private StopHostsWhen rampDownStopHostsWhen;

    /*
     * Number of minutes to wait to stop hosts during ramp down period.
     */
    @JsonProperty(value = "rampDownWaitTimeMinutes")
    private Integer rampDownWaitTimeMinutes;

    /*
     * Notification message for users during ramp down period.
     */
    @JsonProperty(value = "rampDownNotificationMessage")
    private String rampDownNotificationMessage;

    /*
     * Starting time for off-peak period.
     */
    @JsonProperty(value = "offPeakStartTime")
    private Time offPeakStartTime;

    /*
     * Load balancing algorithm for off-peak period.
     */
    @JsonProperty(value = "offPeakLoadBalancingAlgorithm")
    private SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm;

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

    /**
     * Get the name property: Name of the ScalingPlanPooledSchedule.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Name of the ScalingPlanPooledSchedule.
     *
     * @param name the name value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the daysOfWeek property: Set of days of the week on which this schedule is active.
     *
     * @return the daysOfWeek value.
     */
    public List<ScalingScheduleDaysOfWeekItem> daysOfWeek() {
        return this.daysOfWeek;
    }

    /**
     * Set the daysOfWeek property: Set of days of the week on which this schedule is active.
     *
     * @param daysOfWeek the daysOfWeek value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withDaysOfWeek(List<ScalingScheduleDaysOfWeekItem> daysOfWeek) {
        this.daysOfWeek = daysOfWeek;
        return this;
    }

    /**
     * Get the rampUpStartTime property: Starting time for ramp up period.
     *
     * @return the rampUpStartTime value.
     */
    public Time rampUpStartTime() {
        return this.rampUpStartTime;
    }

    /**
     * Set the rampUpStartTime property: Starting time for ramp up period.
     *
     * @param rampUpStartTime the rampUpStartTime value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withRampUpStartTime(Time rampUpStartTime) {
        this.rampUpStartTime = rampUpStartTime;
        return this;
    }

    /**
     * Get the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period.
     *
     * @return the rampUpLoadBalancingAlgorithm value.
     */
    public SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm() {
        return this.rampUpLoadBalancingAlgorithm;
    }

    /**
     * Set the rampUpLoadBalancingAlgorithm property: Load balancing algorithm for ramp up period.
     *
     * @param rampUpLoadBalancingAlgorithm the rampUpLoadBalancingAlgorithm value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withRampUpLoadBalancingAlgorithm(
        SessionHostLoadBalancingAlgorithm rampUpLoadBalancingAlgorithm) {
        this.rampUpLoadBalancingAlgorithm = rampUpLoadBalancingAlgorithm;
        return this;
    }

    /**
     * Get the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period.
     *
     * @return the rampUpMinimumHostsPct value.
     */
    public Integer rampUpMinimumHostsPct() {
        return this.rampUpMinimumHostsPct;
    }

    /**
     * Set the rampUpMinimumHostsPct property: Minimum host percentage for ramp up period.
     *
     * @param rampUpMinimumHostsPct the rampUpMinimumHostsPct value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withRampUpMinimumHostsPct(Integer rampUpMinimumHostsPct) {
        this.rampUpMinimumHostsPct = rampUpMinimumHostsPct;
        return this;
    }

    /**
     * Get the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period.
     *
     * @return the rampUpCapacityThresholdPct value.
     */
    public Integer rampUpCapacityThresholdPct() {
        return this.rampUpCapacityThresholdPct;
    }

    /**
     * Set the rampUpCapacityThresholdPct property: Capacity threshold for ramp up period.
     *
     * @param rampUpCapacityThresholdPct the rampUpCapacityThresholdPct value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withRampUpCapacityThresholdPct(Integer rampUpCapacityThresholdPct) {
        this.rampUpCapacityThresholdPct = rampUpCapacityThresholdPct;
        return this;
    }

    /**
     * Get the peakStartTime property: Starting time for peak period.
     *
     * @return the peakStartTime value.
     */
    public Time peakStartTime() {
        return this.peakStartTime;
    }

    /**
     * Set the peakStartTime property: Starting time for peak period.
     *
     * @param peakStartTime the peakStartTime value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withPeakStartTime(Time peakStartTime) {
        this.peakStartTime = peakStartTime;
        return this;
    }

    /**
     * Get the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period.
     *
     * @return the peakLoadBalancingAlgorithm value.
     */
    public SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm() {
        return this.peakLoadBalancingAlgorithm;
    }

    /**
     * Set the peakLoadBalancingAlgorithm property: Load balancing algorithm for peak period.
     *
     * @param peakLoadBalancingAlgorithm the peakLoadBalancingAlgorithm value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withPeakLoadBalancingAlgorithm(
        SessionHostLoadBalancingAlgorithm peakLoadBalancingAlgorithm) {
        this.peakLoadBalancingAlgorithm = peakLoadBalancingAlgorithm;
        return this;
    }

    /**
     * Get the rampDownStartTime property: Starting time for ramp down period.
     *
     * @return the rampDownStartTime value.
     */
    public Time rampDownStartTime() {
        return this.rampDownStartTime;
    }

    /**
     * Set the rampDownStartTime property: Starting time for ramp down period.
     *
     * @param rampDownStartTime the rampDownStartTime value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withRampDownStartTime(Time rampDownStartTime) {
        this.rampDownStartTime = rampDownStartTime;
        return this;
    }

    /**
     * Get the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period.
     *
     * @return the rampDownLoadBalancingAlgorithm value.
     */
    public SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm() {
        return this.rampDownLoadBalancingAlgorithm;
    }

    /**
     * Set the rampDownLoadBalancingAlgorithm property: Load balancing algorithm for ramp down period.
     *
     * @param rampDownLoadBalancingAlgorithm the rampDownLoadBalancingAlgorithm value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withRampDownLoadBalancingAlgorithm(
        SessionHostLoadBalancingAlgorithm rampDownLoadBalancingAlgorithm) {
        this.rampDownLoadBalancingAlgorithm = rampDownLoadBalancingAlgorithm;
        return this;
    }

    /**
     * Get the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period.
     *
     * @return the rampDownMinimumHostsPct value.
     */
    public Integer rampDownMinimumHostsPct() {
        return this.rampDownMinimumHostsPct;
    }

    /**
     * Set the rampDownMinimumHostsPct property: Minimum host percentage for ramp down period.
     *
     * @param rampDownMinimumHostsPct the rampDownMinimumHostsPct value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withRampDownMinimumHostsPct(Integer rampDownMinimumHostsPct) {
        this.rampDownMinimumHostsPct = rampDownMinimumHostsPct;
        return this;
    }

    /**
     * Get the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period.
     *
     * @return the rampDownCapacityThresholdPct value.
     */
    public Integer rampDownCapacityThresholdPct() {
        return this.rampDownCapacityThresholdPct;
    }

    /**
     * Set the rampDownCapacityThresholdPct property: Capacity threshold for ramp down period.
     *
     * @param rampDownCapacityThresholdPct the rampDownCapacityThresholdPct value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withRampDownCapacityThresholdPct(Integer rampDownCapacityThresholdPct) {
        this.rampDownCapacityThresholdPct = rampDownCapacityThresholdPct;
        return this;
    }

    /**
     * Get the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts.
     *
     * @return the rampDownForceLogoffUsers value.
     */
    public Boolean rampDownForceLogoffUsers() {
        return this.rampDownForceLogoffUsers;
    }

    /**
     * Set the rampDownForceLogoffUsers property: Should users be logged off forcefully from hosts.
     *
     * @param rampDownForceLogoffUsers the rampDownForceLogoffUsers value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withRampDownForceLogoffUsers(Boolean rampDownForceLogoffUsers) {
        this.rampDownForceLogoffUsers = rampDownForceLogoffUsers;
        return this;
    }

    /**
     * Get the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period.
     *
     * @return the rampDownStopHostsWhen value.
     */
    public StopHostsWhen rampDownStopHostsWhen() {
        return this.rampDownStopHostsWhen;
    }

    /**
     * Set the rampDownStopHostsWhen property: Specifies when to stop hosts during ramp down period.
     *
     * @param rampDownStopHostsWhen the rampDownStopHostsWhen value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withRampDownStopHostsWhen(StopHostsWhen rampDownStopHostsWhen) {
        this.rampDownStopHostsWhen = rampDownStopHostsWhen;
        return this;
    }

    /**
     * Get the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period.
     *
     * @return the rampDownWaitTimeMinutes value.
     */
    public Integer rampDownWaitTimeMinutes() {
        return this.rampDownWaitTimeMinutes;
    }

    /**
     * Set the rampDownWaitTimeMinutes property: Number of minutes to wait to stop hosts during ramp down period.
     *
     * @param rampDownWaitTimeMinutes the rampDownWaitTimeMinutes value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withRampDownWaitTimeMinutes(Integer rampDownWaitTimeMinutes) {
        this.rampDownWaitTimeMinutes = rampDownWaitTimeMinutes;
        return this;
    }

    /**
     * Get the rampDownNotificationMessage property: Notification message for users during ramp down period.
     *
     * @return the rampDownNotificationMessage value.
     */
    public String rampDownNotificationMessage() {
        return this.rampDownNotificationMessage;
    }

    /**
     * Set the rampDownNotificationMessage property: Notification message for users during ramp down period.
     *
     * @param rampDownNotificationMessage the rampDownNotificationMessage value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withRampDownNotificationMessage(String rampDownNotificationMessage) {
        this.rampDownNotificationMessage = rampDownNotificationMessage;
        return this;
    }

    /**
     * Get the offPeakStartTime property: Starting time for off-peak period.
     *
     * @return the offPeakStartTime value.
     */
    public Time offPeakStartTime() {
        return this.offPeakStartTime;
    }

    /**
     * Set the offPeakStartTime property: Starting time for off-peak period.
     *
     * @param offPeakStartTime the offPeakStartTime value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withOffPeakStartTime(Time offPeakStartTime) {
        this.offPeakStartTime = offPeakStartTime;
        return this;
    }

    /**
     * Get the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period.
     *
     * @return the offPeakLoadBalancingAlgorithm value.
     */
    public SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm() {
        return this.offPeakLoadBalancingAlgorithm;
    }

    /**
     * Set the offPeakLoadBalancingAlgorithm property: Load balancing algorithm for off-peak period.
     *
     * @param offPeakLoadBalancingAlgorithm the offPeakLoadBalancingAlgorithm value to set.
     * @return the ScalingSchedule object itself.
     */
    public ScalingSchedule withOffPeakLoadBalancingAlgorithm(
        SessionHostLoadBalancingAlgorithm offPeakLoadBalancingAlgorithm) {
        this.offPeakLoadBalancingAlgorithm = offPeakLoadBalancingAlgorithm;
        return this;
    }

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