using System.Text.Json.Serialization; namespace HyperBooru.ApiModels; public enum SortOrder { ObjectId, LastWriteTime, Random, } [JsonPolymorphic] [JsonDerivedType(typeof(FeedSearchRequest), "FeedSearchRequest")] [JsonDerivedType(typeof(FeedTagRequest), "FeedTagRequest")] public record FeedRequest { public bool SelectIngest { get; init; } public bool IncludeNsfw { get; init; } public Media? Key { get; init; } = null; public int Count { get; init; } = 50; public SortOrder SortOrder { get; init; } = SortOrder.ObjectId; } public record FeedSearchRequest : FeedRequest { public string Query { get; init; } } public record FeedTagRequest : FeedRequest { public Guid TagId { get; init; } }