summaryrefslogtreecommitdiff
path: root/Feed.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Feed.cs')
-rw-r--r--Feed.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/Feed.cs b/Feed.cs
new file mode 100644
index 0000000..11d877a
--- /dev/null
+++ b/Feed.cs
@@ -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; }
+}