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

package com.azure.resourcemanager.postgresqlflexibleserver.models;

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

/** The settings for the long term backup. */
@Fluent
public final class BackupSettings {
    /*
     * Backup Name for the current backup
     */
    @JsonProperty(value = "backupName", required = true)
    private String backupName;

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

    /**
     * Get the backupName property: Backup Name for the current backup.
     *
     * @return the backupName value.
     */
    public String backupName() {
        return this.backupName;
    }

    /**
     * Set the backupName property: Backup Name for the current backup.
     *
     * @param backupName the backupName value to set.
     * @return the BackupSettings object itself.
     */
    public BackupSettings withBackupName(String backupName) {
        this.backupName = backupName;
        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);
}
