// Copyright (C) 2025, The Duplicati Team
// https://duplicati.com, hello@duplicati.com
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE.
#nullable enable
using System;
using System.Collections.Generic;
namespace Duplicati.Library.Snapshots.Windows;
///
/// Interface for the snapshot information
///
internal interface ISnapshotInfo
{
///
/// The path where the snapshot is located
///
string SnapshotDeviceObject { get; }
}
///
/// Interface for a snapshot provider
///
internal interface ISnapshotProvider : IDisposable
{
///
/// Explicitly enables the selected writer GUIDs
///
/// The GUIDs to enable
void EnableWriterClasses(Guid[] guids);
///
/// Explicitly disable the selected writer GUIDs
///
/// The GUIDs to disable
void DisableWriterClasses(Guid[] guids);
///
/// Gather writer metadata prior to the snapshot
///
void GatherWriterMetadata();
///
/// Release any allocated metadata
///
void FreeWriterMetadata();
///
/// Verify that the writes are enabled on the snapshot
///
/// The writer GUIDs to verify as enabled
void VerifyWriters(Guid[] guids);
///
/// Gets information of a snapshot
///
/// The shadow copy id
/// The snapshot information
ISnapshotInfo GetSnapshotProperties(Guid shadowId);
///
/// Creates a snapshot
///
void StartSnapshotSet();
///
/// Starts the snapshot as a backup snapshot
///
void PrepareForBackup();
///
/// Finalizes the snapshot creation
///
void DoSnapshotSet();
///
/// Checks if the volume is supported by the snapshot
///
/// The drive to check
/// true if the volume is supported; false otherwise
bool IsVolumeSupported(string drive);
///
/// Adds a drive to the snapshot set
///
/// The drive to add
/// The shadow id
Guid AddToSnapshotSet(string drive);
///
/// Completes the snapshot after the backup has completed
///
void BackupComplete();
///
/// Releases all resources held by the snapshot
///
/// The snapshot shadow id
/// Flag to choose force deletion
void DeleteSnapshot(Guid shadowId, bool forceDelete);
///
/// Parses write metadata
///
/// The writers to return information from
/// The writer metadata
IEnumerable ParseWriterMetaData(Guid[] writers);
}