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

package com.azure.resourcemanager.sqlvirtualmachine.models;

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

/** Configure backups for databases in your SQL virtual machine. */
@Fluent
public final class AutoBackupSettings {
    /*
     * Enable or disable autobackup on SQL virtual machine.
     */
    @JsonProperty(value = "enable")
    private Boolean enable;

    /*
     * Enable or disable encryption for backup on SQL virtual machine.
     */
    @JsonProperty(value = "enableEncryption")
    private Boolean enableEncryption;

    /*
     * Retention period of backup: 1-90 days.
     */
    @JsonProperty(value = "retentionPeriod")
    private Integer retentionPeriod;

    /*
     * Storage account url where backup will be taken to.
     */
    @JsonProperty(value = "storageAccountUrl")
    private String storageAccountUrl;

    /*
     * Storage container name where backup will be taken to.
     */
    @JsonProperty(value = "storageContainerName")
    private String storageContainerName;

    /*
     * Storage account key where backup will be taken to.
     */
    @JsonProperty(value = "storageAccessKey")
    private String storageAccessKey;

    /*
     * Password for encryption on backup.
     */
    @JsonProperty(value = "password")
    private String password;

    /*
     * Include or exclude system databases from auto backup.
     */
    @JsonProperty(value = "backupSystemDbs")
    private Boolean backupSystemDbs;

    /*
     * Backup schedule type.
     */
    @JsonProperty(value = "backupScheduleType")
    private BackupScheduleType backupScheduleType;

    /*
     * Frequency of full backups. In both cases, full backups begin during the next scheduled time window.
     */
    @JsonProperty(value = "fullBackupFrequency")
    private FullBackupFrequencyType fullBackupFrequency;

    /*
     * Days of the week for the backups when FullBackupFrequency is set to Weekly.
     */
    @JsonProperty(value = "daysOfWeek")
    private List<AutoBackupDaysOfWeek> daysOfWeek;

    /*
     * Start time of a given day during which full backups can take place. 0-23 hours.
     */
    @JsonProperty(value = "fullBackupStartTime")
    private Integer fullBackupStartTime;

    /*
     * Duration of the time window of a given day during which full backups can take place. 1-23 hours.
     */
    @JsonProperty(value = "fullBackupWindowHours")
    private Integer fullBackupWindowHours;

    /*
     * Frequency of log backups. 5-60 minutes.
     */
    @JsonProperty(value = "logBackupFrequency")
    private Integer logBackupFrequency;

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

    /**
     * Get the enable property: Enable or disable autobackup on SQL virtual machine.
     *
     * @return the enable value.
     */
    public Boolean enable() {
        return this.enable;
    }

    /**
     * Set the enable property: Enable or disable autobackup on SQL virtual machine.
     *
     * @param enable the enable value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withEnable(Boolean enable) {
        this.enable = enable;
        return this;
    }

    /**
     * Get the enableEncryption property: Enable or disable encryption for backup on SQL virtual machine.
     *
     * @return the enableEncryption value.
     */
    public Boolean enableEncryption() {
        return this.enableEncryption;
    }

    /**
     * Set the enableEncryption property: Enable or disable encryption for backup on SQL virtual machine.
     *
     * @param enableEncryption the enableEncryption value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withEnableEncryption(Boolean enableEncryption) {
        this.enableEncryption = enableEncryption;
        return this;
    }

    /**
     * Get the retentionPeriod property: Retention period of backup: 1-90 days.
     *
     * @return the retentionPeriod value.
     */
    public Integer retentionPeriod() {
        return this.retentionPeriod;
    }

    /**
     * Set the retentionPeriod property: Retention period of backup: 1-90 days.
     *
     * @param retentionPeriod the retentionPeriod value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withRetentionPeriod(Integer retentionPeriod) {
        this.retentionPeriod = retentionPeriod;
        return this;
    }

    /**
     * Get the storageAccountUrl property: Storage account url where backup will be taken to.
     *
     * @return the storageAccountUrl value.
     */
    public String storageAccountUrl() {
        return this.storageAccountUrl;
    }

    /**
     * Set the storageAccountUrl property: Storage account url where backup will be taken to.
     *
     * @param storageAccountUrl the storageAccountUrl value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withStorageAccountUrl(String storageAccountUrl) {
        this.storageAccountUrl = storageAccountUrl;
        return this;
    }

    /**
     * Get the storageContainerName property: Storage container name where backup will be taken to.
     *
     * @return the storageContainerName value.
     */
    public String storageContainerName() {
        return this.storageContainerName;
    }

    /**
     * Set the storageContainerName property: Storage container name where backup will be taken to.
     *
     * @param storageContainerName the storageContainerName value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withStorageContainerName(String storageContainerName) {
        this.storageContainerName = storageContainerName;
        return this;
    }

    /**
     * Get the storageAccessKey property: Storage account key where backup will be taken to.
     *
     * @return the storageAccessKey value.
     */
    public String storageAccessKey() {
        return this.storageAccessKey;
    }

    /**
     * Set the storageAccessKey property: Storage account key where backup will be taken to.
     *
     * @param storageAccessKey the storageAccessKey value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withStorageAccessKey(String storageAccessKey) {
        this.storageAccessKey = storageAccessKey;
        return this;
    }

    /**
     * Get the password property: Password for encryption on backup.
     *
     * @return the password value.
     */
    public String password() {
        return this.password;
    }

    /**
     * Set the password property: Password for encryption on backup.
     *
     * @param password the password value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withPassword(String password) {
        this.password = password;
        return this;
    }

    /**
     * Get the backupSystemDbs property: Include or exclude system databases from auto backup.
     *
     * @return the backupSystemDbs value.
     */
    public Boolean backupSystemDbs() {
        return this.backupSystemDbs;
    }

    /**
     * Set the backupSystemDbs property: Include or exclude system databases from auto backup.
     *
     * @param backupSystemDbs the backupSystemDbs value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withBackupSystemDbs(Boolean backupSystemDbs) {
        this.backupSystemDbs = backupSystemDbs;
        return this;
    }

    /**
     * Get the backupScheduleType property: Backup schedule type.
     *
     * @return the backupScheduleType value.
     */
    public BackupScheduleType backupScheduleType() {
        return this.backupScheduleType;
    }

    /**
     * Set the backupScheduleType property: Backup schedule type.
     *
     * @param backupScheduleType the backupScheduleType value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withBackupScheduleType(BackupScheduleType backupScheduleType) {
        this.backupScheduleType = backupScheduleType;
        return this;
    }

    /**
     * Get the fullBackupFrequency property: Frequency of full backups. In both cases, full backups begin during the
     * next scheduled time window.
     *
     * @return the fullBackupFrequency value.
     */
    public FullBackupFrequencyType fullBackupFrequency() {
        return this.fullBackupFrequency;
    }

    /**
     * Set the fullBackupFrequency property: Frequency of full backups. In both cases, full backups begin during the
     * next scheduled time window.
     *
     * @param fullBackupFrequency the fullBackupFrequency value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withFullBackupFrequency(FullBackupFrequencyType fullBackupFrequency) {
        this.fullBackupFrequency = fullBackupFrequency;
        return this;
    }

    /**
     * Get the daysOfWeek property: Days of the week for the backups when FullBackupFrequency is set to Weekly.
     *
     * @return the daysOfWeek value.
     */
    public List<AutoBackupDaysOfWeek> daysOfWeek() {
        return this.daysOfWeek;
    }

    /**
     * Set the daysOfWeek property: Days of the week for the backups when FullBackupFrequency is set to Weekly.
     *
     * @param daysOfWeek the daysOfWeek value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withDaysOfWeek(List<AutoBackupDaysOfWeek> daysOfWeek) {
        this.daysOfWeek = daysOfWeek;
        return this;
    }

    /**
     * Get the fullBackupStartTime property: Start time of a given day during which full backups can take place. 0-23
     * hours.
     *
     * @return the fullBackupStartTime value.
     */
    public Integer fullBackupStartTime() {
        return this.fullBackupStartTime;
    }

    /**
     * Set the fullBackupStartTime property: Start time of a given day during which full backups can take place. 0-23
     * hours.
     *
     * @param fullBackupStartTime the fullBackupStartTime value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withFullBackupStartTime(Integer fullBackupStartTime) {
        this.fullBackupStartTime = fullBackupStartTime;
        return this;
    }

    /**
     * Get the fullBackupWindowHours property: Duration of the time window of a given day during which full backups can
     * take place. 1-23 hours.
     *
     * @return the fullBackupWindowHours value.
     */
    public Integer fullBackupWindowHours() {
        return this.fullBackupWindowHours;
    }

    /**
     * Set the fullBackupWindowHours property: Duration of the time window of a given day during which full backups can
     * take place. 1-23 hours.
     *
     * @param fullBackupWindowHours the fullBackupWindowHours value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withFullBackupWindowHours(Integer fullBackupWindowHours) {
        this.fullBackupWindowHours = fullBackupWindowHours;
        return this;
    }

    /**
     * Get the logBackupFrequency property: Frequency of log backups. 5-60 minutes.
     *
     * @return the logBackupFrequency value.
     */
    public Integer logBackupFrequency() {
        return this.logBackupFrequency;
    }

    /**
     * Set the logBackupFrequency property: Frequency of log backups. 5-60 minutes.
     *
     * @param logBackupFrequency the logBackupFrequency value to set.
     * @return the AutoBackupSettings object itself.
     */
    public AutoBackupSettings withLogBackupFrequency(Integer logBackupFrequency) {
        this.logBackupFrequency = logBackupFrequency;
        return this;
    }

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