// 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;

/**
 * Tiering Policy for a target tier. If the policy is not specified for a given target tier, service retains the
 * existing configured tiering policy for that tier.
 */
@Fluent
public final class TieringPolicy {
    /*
     * Tiering Mode to control automatic tiering of recovery points. Supported values are:
     * 1. TierRecommended: Tier all recovery points recommended to be tiered
     * 2. TierAfter: Tier all recovery points after a fixed period, as specified in duration + durationType below.
     * 3. DoNotTier: Do not tier any recovery points
     */
    @JsonProperty(value = "tieringMode")
    private TieringMode tieringMode;

    /*
     * Number of days/weeks/months/years to retain backups in current tier before tiering.
     * Used only if TieringMode is set to TierAfter
     */
    @JsonProperty(value = "duration")
    private Integer duration;

    /*
     * Retention duration type: days/weeks/months/years
     * Used only if TieringMode is set to TierAfter
     */
    @JsonProperty(value = "durationType")
    private RetentionDurationType durationType;

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

    /**
     * Get the tieringMode property: Tiering Mode to control automatic tiering of recovery points. Supported values are:
     * 1. TierRecommended: Tier all recovery points recommended to be tiered 2. TierAfter: Tier all recovery points
     * after a fixed period, as specified in duration + durationType below. 3. DoNotTier: Do not tier any recovery
     * points.
     *
     * @return the tieringMode value.
     */
    public TieringMode tieringMode() {
        return this.tieringMode;
    }

    /**
     * Set the tieringMode property: Tiering Mode to control automatic tiering of recovery points. Supported values are:
     * 1. TierRecommended: Tier all recovery points recommended to be tiered 2. TierAfter: Tier all recovery points
     * after a fixed period, as specified in duration + durationType below. 3. DoNotTier: Do not tier any recovery
     * points.
     *
     * @param tieringMode the tieringMode value to set.
     * @return the TieringPolicy object itself.
     */
    public TieringPolicy withTieringMode(TieringMode tieringMode) {
        this.tieringMode = tieringMode;
        return this;
    }

    /**
     * Get the duration property: Number of days/weeks/months/years to retain backups in current tier before tiering.
     * Used only if TieringMode is set to TierAfter.
     *
     * @return the duration value.
     */
    public Integer duration() {
        return this.duration;
    }

    /**
     * Set the duration property: Number of days/weeks/months/years to retain backups in current tier before tiering.
     * Used only if TieringMode is set to TierAfter.
     *
     * @param duration the duration value to set.
     * @return the TieringPolicy object itself.
     */
    public TieringPolicy withDuration(Integer duration) {
        this.duration = duration;
        return this;
    }

    /**
     * Get the durationType property: Retention duration type: days/weeks/months/years Used only if TieringMode is set
     * to TierAfter.
     *
     * @return the durationType value.
     */
    public RetentionDurationType durationType() {
        return this.durationType;
    }

    /**
     * Set the durationType property: Retention duration type: days/weeks/months/years Used only if TieringMode is set
     * to TierAfter.
     *
     * @param durationType the durationType value to set.
     * @return the TieringPolicy object itself.
     */
    public TieringPolicy withDurationType(RetentionDurationType durationType) {
        this.durationType = durationType;
        return this;
    }

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