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

package com.azure.resourcemanager.labservices.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.labservices.fluent.models.ScheduleUpdateProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Schedule for automatically turning virtual machines in a lab on and off at specified times. Used for updates. */
@Fluent
public final class ScheduleUpdate {
    /*
     * Schedule resource properties
     */
    @JsonProperty(value = "properties")
    private ScheduleUpdateProperties innerProperties;

    /**
     * Get the innerProperties property: Schedule resource properties.
     *
     * @return the innerProperties value.
     */
    private ScheduleUpdateProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and
     * timeZoneId is used instead.
     *
     * @return the startAt value.
     */
    public OffsetDateTime startAt() {
        return this.innerProperties() == null ? null : this.innerProperties().startAt();
    }

    /**
     * Set the startAt property: When lab user virtual machines will be started. Timestamp offsets will be ignored and
     * timeZoneId is used instead.
     *
     * @param startAt the startAt value to set.
     * @return the ScheduleUpdate object itself.
     */
    public ScheduleUpdate withStartAt(OffsetDateTime startAt) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleUpdateProperties();
        }
        this.innerProperties().withStartAt(startAt);
        return this;
    }

    /**
     * Get the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and
     * timeZoneId is used instead.
     *
     * @return the stopAt value.
     */
    public OffsetDateTime stopAt() {
        return this.innerProperties() == null ? null : this.innerProperties().stopAt();
    }

    /**
     * Set the stopAt property: When lab user virtual machines will be stopped. Timestamp offsets will be ignored and
     * timeZoneId is used instead.
     *
     * @param stopAt the stopAt value to set.
     * @return the ScheduleUpdate object itself.
     */
    public ScheduleUpdate withStopAt(OffsetDateTime stopAt) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleUpdateProperties();
        }
        this.innerProperties().withStopAt(stopAt);
        return this;
    }

    /**
     * Get the recurrencePattern property: The recurrence pattern of the scheduled actions.
     *
     * @return the recurrencePattern value.
     */
    public RecurrencePattern recurrencePattern() {
        return this.innerProperties() == null ? null : this.innerProperties().recurrencePattern();
    }

    /**
     * Set the recurrencePattern property: The recurrence pattern of the scheduled actions.
     *
     * @param recurrencePattern the recurrencePattern value to set.
     * @return the ScheduleUpdate object itself.
     */
    public ScheduleUpdate withRecurrencePattern(RecurrencePattern recurrencePattern) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleUpdateProperties();
        }
        this.innerProperties().withRecurrencePattern(recurrencePattern);
        return this;
    }

    /**
     * Get the timeZoneId property: The IANA timezone id for the schedule.
     *
     * @return the timeZoneId value.
     */
    public String timeZoneId() {
        return this.innerProperties() == null ? null : this.innerProperties().timeZoneId();
    }

    /**
     * Set the timeZoneId property: The IANA timezone id for the schedule.
     *
     * @param timeZoneId the timeZoneId value to set.
     * @return the ScheduleUpdate object itself.
     */
    public ScheduleUpdate withTimeZoneId(String timeZoneId) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleUpdateProperties();
        }
        this.innerProperties().withTimeZoneId(timeZoneId);
        return this;
    }

    /**
     * Get the notes property: Notes for this schedule.
     *
     * @return the notes value.
     */
    public String notes() {
        return this.innerProperties() == null ? null : this.innerProperties().notes();
    }

    /**
     * Set the notes property: Notes for this schedule.
     *
     * @param notes the notes value to set.
     * @return the ScheduleUpdate object itself.
     */
    public ScheduleUpdate withNotes(String notes) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleUpdateProperties();
        }
        this.innerProperties().withNotes(notes);
        return this;
    }

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