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

package com.azure.resourcemanager.alertsmanagement.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;

/** Recurrence object. */
@JsonTypeInfo(
    use = JsonTypeInfo.Id.NAME,
    include = JsonTypeInfo.As.PROPERTY,
    property = "recurrenceType",
    defaultImpl = Recurrence.class)
@JsonTypeName("Recurrence")
@JsonSubTypes({
    @JsonSubTypes.Type(name = "Daily", value = DailyRecurrence.class),
    @JsonSubTypes.Type(name = "Weekly", value = WeeklyRecurrence.class),
    @JsonSubTypes.Type(name = "Monthly", value = MonthlyRecurrence.class)
})
@Fluent
public class Recurrence {
    /*
     * Start time for recurrence.
     */
    @JsonProperty(value = "startTime")
    private String startTime;

    /*
     * End time for recurrence.
     */
    @JsonProperty(value = "endTime")
    private String endTime;

    /**
     * Get the startTime property: Start time for recurrence.
     *
     * @return the startTime value.
     */
    public String startTime() {
        return this.startTime;
    }

    /**
     * Set the startTime property: Start time for recurrence.
     *
     * @param startTime the startTime value to set.
     * @return the Recurrence object itself.
     */
    public Recurrence withStartTime(String startTime) {
        this.startTime = startTime;
        return this;
    }

    /**
     * Get the endTime property: End time for recurrence.
     *
     * @return the endTime value.
     */
    public String endTime() {
        return this.endTime;
    }

    /**
     * Set the endTime property: End time for recurrence.
     *
     * @param endTime the endTime value to set.
     * @return the Recurrence object itself.
     */
    public Recurrence withEndTime(String endTime) {
        this.endTime = endTime;
        return this;
    }

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