// 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.
namespace Duplicati.WebserverCore.Dto;
///
/// The backup and schedule DTO
///
public sealed record BackupAndScheduleInputDto
{
///
/// The backup DTO
///
public required BackupInputDto Backup { get; init; }
///
/// The schedule DTO
///
public ScheduleInputDto? Schedule { get; init; }
///
/// The backup DTO
///
public sealed record BackupInputDto
{
///
/// The backup name
///
public string Name { get; init; } = "";
///
/// The backup description
///
public string Description { get; init; } = "";
///
/// The path to the local database
///
public string? DBPath { get; init; } = null;
///
/// The backup tags
///
public string[]? Tags { get; init; }
///
/// The backup target url
///
public string TargetURL { get; init; } = "";
///
/// The backup source folders and files
///
public string[] Sources { get; init; } = [];
///
/// The backup settings
///
public IEnumerable? Settings { get; init; }
///
/// The filters applied to the source files
///
public IEnumerable? Filters { get; init; }
///
/// The backup metadata
///
public IDictionary? Metadata { get; init; }
}
///
/// The schedule DTO
///
public sealed record ScheduleInputDto
{
///
/// The Schedule ID
///
public long ID { get; init; }
///
/// The tags that this schedule affects
///
public string[]? Tags { get; init; }
///
/// The time this schedule is based on
///
public DateTime? Time { get; init; }
///
/// How often the backup is repeated
///
public string? Repeat { get; init; }
///
/// The time this schedule was last executed
///
public DateTime? LastRun { get; init; }
///
/// The rule that is parsed to figure out when to run this backup next time
///
public string? Rule { get; init; }
///
/// The days that the backup is allowed to run
///
public DayOfWeek[]? AllowedDays { get; init; }
}
///
/// The setting DTO
///
public sealed record SettingInputDto
{
///
/// The filter expression
///
public string? Filter { get; init; }
///
/// The setting option
///
public required string Name { get; init; }
///
/// The setting value
///
public string? Value { get; init; }
}
///
/// The filter DTO
///
public sealed record FilterInputDto
{
///
/// The sort order
///
public long Order { get; init; } = 0;
///
/// True if the filter includes the items, false if it excludes
///
public bool Include { get; init; }
///
/// The filter expression.
/// If the filter is a regular expression, it starts and ends with hard brackets [ ]
///
public string? Expression { get; init; }
}
}