diff options
| author | Jake Mannens <jake@asger.xyz> | 2026-04-30 00:37:15 +1000 |
|---|---|---|
| committer | Jake Mannens <jake@asger.xyz> | 2026-05-06 04:26:12 +1000 |
| commit | 9d90e21684eeaab3ac9f89a1d8013168a1d577d7 (patch) | |
| tree | c3a03b37b693b1f38dabb58740b148bb770db551 /Feed.cs | |
v0.13av0.13a
Diffstat (limited to 'Feed.cs')
| -rw-r--r-- | Feed.cs | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -0,0 +1,28 @@ +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; } +} |
