// 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;
import java.util.List;

/** The RecurrenceSchedule model. */
@Fluent
public final class RecurrenceSchedule {
    /*
     * [Required] List of hours for the schedule.
     */
    @JsonProperty(value = "hours", required = true)
    private List<Integer> hours;

    /*
     * [Required] List of minutes for the schedule.
     */
    @JsonProperty(value = "minutes", required = true)
    private List<Integer> minutes;

    /*
     * List of month days for the schedule
     */
    @JsonProperty(value = "monthDays")
    private List<Integer> monthDays;

    /*
     * List of days for the schedule.
     */
    @JsonProperty(value = "weekDays")
    private List<WeekDay> weekDays;

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

    /**
     * Get the hours property: [Required] List of hours for the schedule.
     *
     * @return the hours value.
     */
    public List<Integer> hours() {
        return this.hours;
    }

    /**
     * Set the hours property: [Required] List of hours for the schedule.
     *
     * @param hours the hours value to set.
     * @return the RecurrenceSchedule object itself.
     */
    public RecurrenceSchedule withHours(List<Integer> hours) {
        this.hours = hours;
        return this;
    }

    /**
     * Get the minutes property: [Required] List of minutes for the schedule.
     *
     * @return the minutes value.
     */
    public List<Integer> minutes() {
        return this.minutes;
    }

    /**
     * Set the minutes property: [Required] List of minutes for the schedule.
     *
     * @param minutes the minutes value to set.
     * @return the RecurrenceSchedule object itself.
     */
    public RecurrenceSchedule withMinutes(List<Integer> minutes) {
        this.minutes = minutes;
        return this;
    }

    /**
     * Get the monthDays property: List of month days for the schedule.
     *
     * @return the monthDays value.
     */
    public List<Integer> monthDays() {
        return this.monthDays;
    }

    /**
     * Set the monthDays property: List of month days for the schedule.
     *
     * @param monthDays the monthDays value to set.
     * @return the RecurrenceSchedule object itself.
     */
    public RecurrenceSchedule withMonthDays(List<Integer> monthDays) {
        this.monthDays = monthDays;
        return this;
    }

    /**
     * Get the weekDays property: List of days for the schedule.
     *
     * @return the weekDays value.
     */
    public List<WeekDay> weekDays() {
        return this.weekDays;
    }

    /**
     * Set the weekDays property: List of days for the schedule.
     *
     * @param weekDays the weekDays value to set.
     * @return the RecurrenceSchedule object itself.
     */
    public RecurrenceSchedule withWeekDays(List<WeekDay> weekDays) {
        this.weekDays = weekDays;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (hours() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property hours in model RecurrenceSchedule"));
        }
        if (minutes() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property minutes in model RecurrenceSchedule"));
        }
    }

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