Iceshrimp.NET/Iceshrimp.Backend/Controllers/Schemas/NoteResponse.cs

48 lines
No EOL
2 KiB
C#

using J = System.Text.Json.Serialization.JsonPropertyNameAttribute;
using JI = System.Text.Json.Serialization.JsonIgnoreAttribute;
namespace Iceshrimp.Backend.Controllers.Schemas;
public class NoteResponse : NoteWithQuote
{
[J("reply")] public NoteBase? Reply { get; set; }
[J("replyId")] public string? ReplyId { get; set; }
[J("renote")] public NoteWithQuote? Renote { get; set; }
[J("renoteId")] public string? RenoteId { get; set; }
}
public class NoteWithQuote : NoteBase
{
[J("quote")] public NoteBase? Quote { get; set; }
[J("quoteId")] public string? QuoteId { get; set; }
}
public class NoteBase
{
[J("id")] public required string Id { get; set; }
[J("createdAt")] public required string CreatedAt { get; set; }
[J("text")] public required string? Text { get; set; }
[J("cw")] public required string? Cw { get; set; }
[J("visibility")] public required string Visibility { get; set; }
[J("user")] public required UserResponse User { get; set; }
[J("attachments")] public required List<NoteAttachment> Attachments { get; set; }
[J("reactions")] public required List<NoteReactionSchema> Reactions { get; set; }
}
public class NoteAttachment
{
[JI] public required string Id;
[J("url")] public required string Url { get; set; }
[J("thumbnailUrl")] public required string ThumbnailUrl { get; set; }
[J("blurhash")] public required string? Blurhash { get; set; }
[J("alt")] public required string? AltText { get; set; }
}
public class NoteReactionSchema
{
[JI] public required string NoteId;
[J("name")] public required string Name { get; set; }
[J("count")] public required int Count { get; set; }
[J("reacted")] public required bool Reacted { get; set; }
[J("url")] public required string? Url { get; set; }
}