void.cat/VoidCat/Model/VoidFile.cs

47 lines
1.2 KiB
C#
Raw Normal View History

2022-02-17 15:52:49 +00:00
using Newtonsoft.Json;
2022-02-21 09:39:59 +00:00
using VoidCat.Model.Paywall;
2022-01-25 23:39:51 +00:00
namespace VoidCat.Model
2022-01-25 16:17:48 +00:00
{
2022-02-17 15:52:49 +00:00
public abstract record VoidFile<TMeta> where TMeta : VoidFileMeta
2022-01-25 16:17:48 +00:00
{
2022-02-17 15:52:49 +00:00
/// <summary>
/// Id of the file
/// </summary>
2022-01-25 23:39:51 +00:00
[JsonConverter(typeof(Base58GuidConverter))]
public Guid Id { get; init; }
2022-02-17 15:52:49 +00:00
/// <summary>
/// Metadta related to the file
/// </summary>
public TMeta? Metadata { get; init; }
/// <summary>
/// Optional paywall config
/// </summary>
2022-02-21 09:39:59 +00:00
public PaywallConfig? Paywall { get; init; }
2022-02-27 13:54:25 +00:00
/// <summary>
/// User profile that uploaded the file
/// </summary>
public PublicVoidUser? Uploader { get; init; }
/// <summary>
/// Traffic stats for this file
/// </summary>
public Bandwidth? Bandwidth { get; init; }
2022-03-07 13:38:28 +00:00
/// <summary>
/// Virus scanner results
/// </summary>
public VirusScanResult? VirusScan { get; init; }
2022-01-25 16:17:48 +00:00
}
2022-01-25 23:39:51 +00:00
2022-02-17 15:52:49 +00:00
public sealed record PublicVoidFile : VoidFile<VoidFileMeta>
2022-01-25 23:39:51 +00:00
{
}
2022-02-17 15:52:49 +00:00
public sealed record PrivateVoidFile : VoidFile<SecretVoidFileMeta>
2022-01-25 23:39:51 +00:00
{
}
2022-02-17 15:52:49 +00:00
}