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

package com.azure.resourcemanager.redisenterprise.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * Persistence settings
 *
 * <p>Persistence-related configuration for the RedisEnterprise database.
 */
@Fluent
public final class Persistence {
    /*
     * Sets whether AOF is enabled.
     */
    @JsonProperty(value = "aofEnabled")
    private Boolean aofEnabled;

    /*
     * Sets whether RDB is enabled.
     */
    @JsonProperty(value = "rdbEnabled")
    private Boolean rdbEnabled;

    /*
     * Sets the frequency at which data is written to disk.
     */
    @JsonProperty(value = "aofFrequency")
    private AofFrequency aofFrequency;

    /*
     * Sets the frequency at which a snapshot of the database is created.
     */
    @JsonProperty(value = "rdbFrequency")
    private RdbFrequency rdbFrequency;

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

    /**
     * Get the aofEnabled property: Sets whether AOF is enabled.
     *
     * @return the aofEnabled value.
     */
    public Boolean aofEnabled() {
        return this.aofEnabled;
    }

    /**
     * Set the aofEnabled property: Sets whether AOF is enabled.
     *
     * @param aofEnabled the aofEnabled value to set.
     * @return the Persistence object itself.
     */
    public Persistence withAofEnabled(Boolean aofEnabled) {
        this.aofEnabled = aofEnabled;
        return this;
    }

    /**
     * Get the rdbEnabled property: Sets whether RDB is enabled.
     *
     * @return the rdbEnabled value.
     */
    public Boolean rdbEnabled() {
        return this.rdbEnabled;
    }

    /**
     * Set the rdbEnabled property: Sets whether RDB is enabled.
     *
     * @param rdbEnabled the rdbEnabled value to set.
     * @return the Persistence object itself.
     */
    public Persistence withRdbEnabled(Boolean rdbEnabled) {
        this.rdbEnabled = rdbEnabled;
        return this;
    }

    /**
     * Get the aofFrequency property: Sets the frequency at which data is written to disk.
     *
     * @return the aofFrequency value.
     */
    public AofFrequency aofFrequency() {
        return this.aofFrequency;
    }

    /**
     * Set the aofFrequency property: Sets the frequency at which data is written to disk.
     *
     * @param aofFrequency the aofFrequency value to set.
     * @return the Persistence object itself.
     */
    public Persistence withAofFrequency(AofFrequency aofFrequency) {
        this.aofFrequency = aofFrequency;
        return this;
    }

    /**
     * Get the rdbFrequency property: Sets the frequency at which a snapshot of the database is created.
     *
     * @return the rdbFrequency value.
     */
    public RdbFrequency rdbFrequency() {
        return this.rdbFrequency;
    }

    /**
     * Set the rdbFrequency property: Sets the frequency at which a snapshot of the database is created.
     *
     * @param rdbFrequency the rdbFrequency value to set.
     * @return the Persistence object itself.
     */
    public Persistence withRdbFrequency(RdbFrequency rdbFrequency) {
        this.rdbFrequency = rdbFrequency;
        return this;
    }

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