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

package com.azure.resourcemanager.automation.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.automation.models.AdvancedSchedule;
import com.azure.resourcemanager.automation.models.ScheduleFrequency;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Definition of the schedule. */
@Fluent
public final class ScheduleInner extends ProxyResource {
    /*
     * Gets or sets the properties of the schedule.
     */
    @JsonProperty(value = "properties")
    private ScheduleProperties innerProperties;

    /**
     * Get the innerProperties property: Gets or sets the properties of the schedule.
     *
     * @return the innerProperties value.
     */
    private ScheduleProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the startTime property: Gets or sets the start time of the schedule.
     *
     * @return the startTime value.
     */
    public OffsetDateTime startTime() {
        return this.innerProperties() == null ? null : this.innerProperties().startTime();
    }

    /**
     * Set the startTime property: Gets or sets the start time of the schedule.
     *
     * @param startTime the startTime value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withStartTime(OffsetDateTime startTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withStartTime(startTime);
        return this;
    }

    /**
     * Get the startTimeOffsetMinutes property: Gets the start time's offset in minutes.
     *
     * @return the startTimeOffsetMinutes value.
     */
    public Double startTimeOffsetMinutes() {
        return this.innerProperties() == null ? null : this.innerProperties().startTimeOffsetMinutes();
    }

    /**
     * Get the expiryTime property: Gets or sets the end time of the schedule.
     *
     * @return the expiryTime value.
     */
    public OffsetDateTime expiryTime() {
        return this.innerProperties() == null ? null : this.innerProperties().expiryTime();
    }

    /**
     * Set the expiryTime property: Gets or sets the end time of the schedule.
     *
     * @param expiryTime the expiryTime value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withExpiryTime(OffsetDateTime expiryTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withExpiryTime(expiryTime);
        return this;
    }

    /**
     * Get the expiryTimeOffsetMinutes property: Gets or sets the expiry time's offset in minutes.
     *
     * @return the expiryTimeOffsetMinutes value.
     */
    public Double expiryTimeOffsetMinutes() {
        return this.innerProperties() == null ? null : this.innerProperties().expiryTimeOffsetMinutes();
    }

    /**
     * Set the expiryTimeOffsetMinutes property: Gets or sets the expiry time's offset in minutes.
     *
     * @param expiryTimeOffsetMinutes the expiryTimeOffsetMinutes value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withExpiryTimeOffsetMinutes(Double expiryTimeOffsetMinutes) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withExpiryTimeOffsetMinutes(expiryTimeOffsetMinutes);
        return this;
    }

    /**
     * Get the isEnabled property: Gets or sets a value indicating whether this schedule is enabled.
     *
     * @return the isEnabled value.
     */
    public Boolean isEnabled() {
        return this.innerProperties() == null ? null : this.innerProperties().isEnabled();
    }

    /**
     * Set the isEnabled property: Gets or sets a value indicating whether this schedule is enabled.
     *
     * @param isEnabled the isEnabled value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withIsEnabled(Boolean isEnabled) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withIsEnabled(isEnabled);
        return this;
    }

    /**
     * Get the nextRun property: Gets or sets the next run time of the schedule.
     *
     * @return the nextRun value.
     */
    public OffsetDateTime nextRun() {
        return this.innerProperties() == null ? null : this.innerProperties().nextRun();
    }

    /**
     * Set the nextRun property: Gets or sets the next run time of the schedule.
     *
     * @param nextRun the nextRun value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withNextRun(OffsetDateTime nextRun) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withNextRun(nextRun);
        return this;
    }

    /**
     * Get the nextRunOffsetMinutes property: Gets or sets the next run time's offset in minutes.
     *
     * @return the nextRunOffsetMinutes value.
     */
    public Double nextRunOffsetMinutes() {
        return this.innerProperties() == null ? null : this.innerProperties().nextRunOffsetMinutes();
    }

    /**
     * Set the nextRunOffsetMinutes property: Gets or sets the next run time's offset in minutes.
     *
     * @param nextRunOffsetMinutes the nextRunOffsetMinutes value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withNextRunOffsetMinutes(Double nextRunOffsetMinutes) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withNextRunOffsetMinutes(nextRunOffsetMinutes);
        return this;
    }

    /**
     * Get the interval property: Gets or sets the interval of the schedule.
     *
     * @return the interval value.
     */
    public Object interval() {
        return this.innerProperties() == null ? null : this.innerProperties().interval();
    }

    /**
     * Set the interval property: Gets or sets the interval of the schedule.
     *
     * @param interval the interval value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withInterval(Object interval) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withInterval(interval);
        return this;
    }

    /**
     * Get the frequency property: Gets or sets the frequency of the schedule.
     *
     * @return the frequency value.
     */
    public ScheduleFrequency frequency() {
        return this.innerProperties() == null ? null : this.innerProperties().frequency();
    }

    /**
     * Set the frequency property: Gets or sets the frequency of the schedule.
     *
     * @param frequency the frequency value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withFrequency(ScheduleFrequency frequency) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withFrequency(frequency);
        return this;
    }

    /**
     * Get the timeZone property: Gets or sets the time zone of the schedule.
     *
     * @return the timeZone value.
     */
    public String timeZone() {
        return this.innerProperties() == null ? null : this.innerProperties().timeZone();
    }

    /**
     * Set the timeZone property: Gets or sets the time zone of the schedule.
     *
     * @param timeZone the timeZone value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withTimeZone(String timeZone) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withTimeZone(timeZone);
        return this;
    }

    /**
     * Get the advancedSchedule property: Gets or sets the advanced schedule.
     *
     * @return the advancedSchedule value.
     */
    public AdvancedSchedule advancedSchedule() {
        return this.innerProperties() == null ? null : this.innerProperties().advancedSchedule();
    }

    /**
     * Set the advancedSchedule property: Gets or sets the advanced schedule.
     *
     * @param advancedSchedule the advancedSchedule value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withAdvancedSchedule(AdvancedSchedule advancedSchedule) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withAdvancedSchedule(advancedSchedule);
        return this;
    }

    /**
     * Get the creationTime property: Gets or sets the creation time.
     *
     * @return the creationTime value.
     */
    public OffsetDateTime creationTime() {
        return this.innerProperties() == null ? null : this.innerProperties().creationTime();
    }

    /**
     * Set the creationTime property: Gets or sets the creation time.
     *
     * @param creationTime the creationTime value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withCreationTime(OffsetDateTime creationTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withCreationTime(creationTime);
        return this;
    }

    /**
     * Get the lastModifiedTime property: Gets or sets the last modified time.
     *
     * @return the lastModifiedTime value.
     */
    public OffsetDateTime lastModifiedTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastModifiedTime();
    }

    /**
     * Set the lastModifiedTime property: Gets or sets the last modified time.
     *
     * @param lastModifiedTime the lastModifiedTime value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withLastModifiedTime(OffsetDateTime lastModifiedTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withLastModifiedTime(lastModifiedTime);
        return this;
    }

    /**
     * Get the description property: Gets or sets the description.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Set the description property: Gets or sets the description.
     *
     * @param description the description value to set.
     * @return the ScheduleInner object itself.
     */
    public ScheduleInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new ScheduleProperties();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

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