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

package com.azure.resourcemanager.mysqlflexibleserver.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Backup Settings. */
@Fluent
public final class BackupSettings {
    /*
     * The name of the backup.
     */
    @JsonProperty(value = "backupName", required = true)
    private String backupName;

    /*
     * Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE)
     */
    @JsonProperty(value = "backupFormat")
    private BackupFormat backupFormat;

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

    /**
     * Get the backupName property: The name of the backup.
     *
     * @return the backupName value.
     */
    public String backupName() {
        return this.backupName;
    }

    /**
     * Set the backupName property: The name of the backup.
     *
     * @param backupName the backupName value to set.
     * @return the BackupSettings object itself.
     */
    public BackupSettings withBackupName(String backupName) {
        this.backupName = backupName;
        return this;
    }

    /**
     * Get the backupFormat property: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE).
     *
     * @return the backupFormat value.
     */
    public BackupFormat backupFormat() {
        return this.backupFormat;
    }

    /**
     * Set the backupFormat property: Backup Format for the current backup. (CollatedFormat is INTERNAL – DO NOT USE).
     *
     * @param backupFormat the backupFormat value to set.
     * @return the BackupSettings object itself.
     */
    public BackupSettings withBackupFormat(BackupFormat backupFormat) {
        this.backupFormat = backupFormat;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (backupName() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException("Missing required property backupName in model BackupSettings"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(BackupSettings.class);
}
