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

package com.azure.resourcemanager.netapp.models;

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

/**
 * DataProtection
 *
 * <p>DataProtection type volumes include an object containing details of the replication.
 */
@Fluent
public final class VolumePatchPropertiesDataProtection {
    /*
     * Backup Properties
     */
    @JsonProperty(value = "backup")
    private VolumeBackupProperties backup;

    /*
     * Snapshot properties.
     */
    @JsonProperty(value = "snapshot")
    private VolumeSnapshotProperties snapshot;

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

    /**
     * Get the backup property: Backup Properties.
     *
     * @return the backup value.
     */
    public VolumeBackupProperties backup() {
        return this.backup;
    }

    /**
     * Set the backup property: Backup Properties.
     *
     * @param backup the backup value to set.
     * @return the VolumePatchPropertiesDataProtection object itself.
     */
    public VolumePatchPropertiesDataProtection withBackup(VolumeBackupProperties backup) {
        this.backup = backup;
        return this;
    }

    /**
     * Get the snapshot property: Snapshot properties.
     *
     * @return the snapshot value.
     */
    public VolumeSnapshotProperties snapshot() {
        return this.snapshot;
    }

    /**
     * Set the snapshot property: Snapshot properties.
     *
     * @param snapshot the snapshot value to set.
     * @return the VolumePatchPropertiesDataProtection object itself.
     */
    public VolumePatchPropertiesDataProtection withSnapshot(VolumeSnapshotProperties snapshot) {
        this.snapshot = snapshot;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (backup() != null) {
            backup().validate();
        }
        if (snapshot() != null) {
            snapshot().validate();
        }
    }
}
