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

package com.azure.resourcemanager.recoveryservicesbackup.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** Weekly retention schedule. */
@Fluent
public final class WeeklyRetentionSchedule {
    /*
     * List of days of week for weekly retention policy.
     */
    @JsonProperty(value = "daysOfTheWeek")
    private List<DayOfWeek> daysOfTheWeek;

    /*
     * Retention times of retention policy.
     */
    @JsonProperty(value = "retentionTimes")
    private List<OffsetDateTime> retentionTimes;

    /*
     * Retention duration of retention Policy.
     */
    @JsonProperty(value = "retentionDuration")
    private RetentionDuration retentionDuration;

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

    /**
     * Get the daysOfTheWeek property: List of days of week for weekly retention policy.
     *
     * @return the daysOfTheWeek value.
     */
    public List<DayOfWeek> daysOfTheWeek() {
        return this.daysOfTheWeek;
    }

    /**
     * Set the daysOfTheWeek property: List of days of week for weekly retention policy.
     *
     * @param daysOfTheWeek the daysOfTheWeek value to set.
     * @return the WeeklyRetentionSchedule object itself.
     */
    public WeeklyRetentionSchedule withDaysOfTheWeek(List<DayOfWeek> daysOfTheWeek) {
        this.daysOfTheWeek = daysOfTheWeek;
        return this;
    }

    /**
     * Get the retentionTimes property: Retention times of retention policy.
     *
     * @return the retentionTimes value.
     */
    public List<OffsetDateTime> retentionTimes() {
        return this.retentionTimes;
    }

    /**
     * Set the retentionTimes property: Retention times of retention policy.
     *
     * @param retentionTimes the retentionTimes value to set.
     * @return the WeeklyRetentionSchedule object itself.
     */
    public WeeklyRetentionSchedule withRetentionTimes(List<OffsetDateTime> retentionTimes) {
        this.retentionTimes = retentionTimes;
        return this;
    }

    /**
     * Get the retentionDuration property: Retention duration of retention Policy.
     *
     * @return the retentionDuration value.
     */
    public RetentionDuration retentionDuration() {
        return this.retentionDuration;
    }

    /**
     * Set the retentionDuration property: Retention duration of retention Policy.
     *
     * @param retentionDuration the retentionDuration value to set.
     * @return the WeeklyRetentionSchedule object itself.
     */
    public WeeklyRetentionSchedule withRetentionDuration(RetentionDuration retentionDuration) {
        this.retentionDuration = retentionDuration;
        return this;
    }

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