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

package com.azure.resourcemanager.dataprotection.models;

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

/**
 * AzureBackupParams
 *
 * <p>Azure backup parameters.
 */
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "objectType")
@JsonTypeName("AzureBackupParams")
@Fluent
public final class AzureBackupParams extends BackupParameters {
    /*
     * BackupType ; Full/Incremental etc
     */
    @JsonProperty(value = "backupType", required = true)
    private String backupType;

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

    /**
     * Get the backupType property: BackupType ; Full/Incremental etc.
     *
     * @return the backupType value.
     */
    public String backupType() {
        return this.backupType;
    }

    /**
     * Set the backupType property: BackupType ; Full/Incremental etc.
     *
     * @param backupType the backupType value to set.
     * @return the AzureBackupParams object itself.
     */
    public AzureBackupParams withBackupType(String backupType) {
        this.backupType = backupType;
        return this;
    }

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

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