// 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.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import com.fasterxml.jackson.annotation.JsonTypeName;

/** The TriggerBase model. */
@JsonTypeInfo(
    use = JsonTypeInfo.Id.NAME,
    include = JsonTypeInfo.As.PROPERTY,
    property = "triggerType",
    defaultImpl = TriggerBase.class)
@JsonTypeName("TriggerBase")
@JsonSubTypes({
    @JsonSubTypes.Type(name = "Recurrence", value = RecurrenceTrigger.class),
    @JsonSubTypes.Type(name = "Cron", value = CronTrigger.class)
})
@Fluent
public class TriggerBase {
    /*
     * Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer
     * https://en.wikipedia.org/wiki/ISO_8601.
     * Recommented format would be "2022-06-01T00:00:01"
     * If not present, the schedule will run indefinitely
     */
    @JsonProperty(value = "endTime")
    private String endTime;

    /*
     * Specifies start time of schedule in ISO 8601 format, but without a UTC offset.
     */
    @JsonProperty(value = "startTime")
    private String startTime;

    /*
     * Specifies time zone in which the schedule runs.
     * TimeZone should follow Windows time zone format. Refer:
     * https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11
     */
    @JsonProperty(value = "timeZone")
    private String timeZone;

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

    /**
     * Get the endTime property: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer
     * https://en.wikipedia.org/wiki/ISO_8601. Recommented format would be "2022-06-01T00:00:01" If not present, the
     * schedule will run indefinitely.
     *
     * @return the endTime value.
     */
    public String endTime() {
        return this.endTime;
    }

    /**
     * Set the endTime property: Specifies end time of schedule in ISO 8601, but without a UTC offset. Refer
     * https://en.wikipedia.org/wiki/ISO_8601. Recommented format would be "2022-06-01T00:00:01" If not present, the
     * schedule will run indefinitely.
     *
     * @param endTime the endTime value to set.
     * @return the TriggerBase object itself.
     */
    public TriggerBase withEndTime(String endTime) {
        this.endTime = endTime;
        return this;
    }

    /**
     * Get the startTime property: Specifies start time of schedule in ISO 8601 format, but without a UTC offset.
     *
     * @return the startTime value.
     */
    public String startTime() {
        return this.startTime;
    }

    /**
     * Set the startTime property: Specifies start time of schedule in ISO 8601 format, but without a UTC offset.
     *
     * @param startTime the startTime value to set.
     * @return the TriggerBase object itself.
     */
    public TriggerBase withStartTime(String startTime) {
        this.startTime = startTime;
        return this;
    }

    /**
     * Get the timeZone property: Specifies time zone in which the schedule runs. TimeZone should follow Windows time
     * zone format. Refer:
     * https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11.
     *
     * @return the timeZone value.
     */
    public String timeZone() {
        return this.timeZone;
    }

    /**
     * Set the timeZone property: Specifies time zone in which the schedule runs. TimeZone should follow Windows time
     * zone format. Refer:
     * https://docs.microsoft.com/en-us/windows-hardware/manufacture/desktop/default-time-zones?view=windows-11.
     *
     * @param timeZone the timeZone value to set.
     * @return the TriggerBase object itself.
     */
    public TriggerBase withTimeZone(String timeZone) {
        this.timeZone = timeZone;
        return this;
    }

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