void.cat/VoidCat/Model/VoidFile.cs

32 lines
774 B
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-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
}