diff options
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; } +} |
