2026-10-04 10:07:06 +02:00
namespace PrivaPub.Api.Mastodon.Entities
2026-10-01 11:52:31 +02:00
{
public class Account
{
public string Id { get ; set ; }
public string Username { get ; set ; }
public string Acct { get ; set ; }
public string DisplayName { get ; set ; }
public bool Locked { get ; set ; }
public bool Bot { get ; set ; }
public bool? Discoverable { get ; set ; }
public bool Indexable { get ; set ; }
public bool Group { get ; set ; }
public string CreatedAt { get ; set ; }
public string Note { get ; set ; }
public string Url { get ; set ; }
public string Uri { get ; set ; }
public string Avatar { get ; set ; }
public string AvatarStatic { get ; set ; }
public string Header { get ; set ; }
public string HeaderStatic { get ; set ; }
public int FollowersCount { get ; set ; }
public int FollowingCount { get ; set ; }
public int StatusesCount { get ; set ; }
public string LastStatusAt { get ; set ; }
public bool? HideCollections { get ; set ; }
public bool Noindex { get ; set ; } = true ;
2026-10-01 18:35:20 +02:00
public List < CustomEmojiEntity > Emojis { get ; set ; } = new ();
2026-10-01 11:52:31 +02:00
public List < object > Roles { get ; set ; } = new ();
2026-10-01 18:35:20 +02:00
public bool? Memorial { get ; set ; }
2026-10-17 05:23:45 +02:00
public bool? Limited { get ; set ; } //silenced by this server's staff, or its server silenced (Mastodon's `limited`)
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 18:35:20 +02:00
public string AvatarDescription { get ; set ; } = string . Empty ;
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 18:35:20 +02:00
public string HeaderDescription { get ; set ; } = string . Empty ;
2026-10-01 11:52:31 +02:00
public List < Field > Fields { get ; set ; } = new ();
public Source Source { get ; set ; }
2026-10-05 18:39:46 +02:00
public Account Moved { get ; set ; } //the account it moved to, when that account names it among its aliases
2026-10-01 11:52:31 +02:00
}
2026-10-01 18:35:20 +02:00
public class CustomEmojiEntity
{
public string Shortcode { get ; set ; }
public string Url { get ; set ; }
public string StaticUrl { get ; set ; }
public bool VisibleInPicker { get ; set ; }
public string Category { get ; set ; }
}
2026-10-01 11:52:31 +02:00
public class Field
{
public string Name { get ; set ; }
public string Value { get ; set ; }
public string VerifiedAt { get ; set ; }
}
public class Source
{
public string Privacy { get ; set ; } = "public" ;
public bool Sensitive { get ; set ; }
public string Language { get ; set ; }
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 11:52:31 +02:00
public string Note { get ; set ; } = string . Empty ;
public List < Field > Fields { get ; set ; } = new ();
public int FollowRequestsCount { get ; set ; }
public string AttributionDomains { get ; set ; }
2026-10-01 19:53:13 +02:00
public string QuotePolicy { get ; set ; } = "public" ;
2026-10-01 11:52:31 +02:00
}
2026-10-01 17:58:22 +02:00
public class PrivaPubStatus
{
public string ObjectType { get ; set ; }
2026-10-05 06:10:25 +02:00
public bool Locked { get ; set ; } //its community's moderators locked it: a reply is refused
2026-10-05 11:43:58 +02:00
public string Approval { get ; set ; } //our reply or boost its target's author must approve: "pending", "rejected"
2026-10-01 17:58:22 +02:00
public string Title { get ; set ; }
public string Excerpt { get ; set ; }
public string Cover { get ; set ; }
public PrivaPubSource Source { get ; set ; }
public PrivaPubLink Link { get ; set ; }
public PrivaPubVideo Video { get ; set ; }
public PrivaPubAudio Audio { get ; set ; }
public PrivaPubEvent Event { get ; set ; }
2026-10-04 10:07:06 +02:00
public PrivaPubPlace Place { get ; set ; } //a remote post's own place (Pixelfed), shown only
2026-10-06 08:17:10 +02:00
public Account Wall { get ; set ; } //whose wall it was written on (FEP-400e), when not its author's
2026-10-01 17:58:22 +02:00
public PrivaPubVotes Votes { get ; set ; } = new ();
2026-10-07 21:14:32 +02:00
public List < PrivaPubFlair > Flairs { get ; set ; } = new ();
2026-10-01 17:58:22 +02:00
}
public class PrivaPubSource
{
public string Content { get ; set ; }
public string MediaType { get ; set ; }
}
public class PrivaPubLink
{
public string Url { get ; set ; }
public string Title { get ; set ; }
public string Description { get ; set ; }
public string Image { get ; set ; }
public bool FromPublisher { get ; set ; }
}
public class PrivaPubVariant
{
public string Url { get ; set ; }
public string MediaType { get ; set ; }
public int? Width { get ; set ; }
public int? Height { get ; set ; }
public double? Fps { get ; set ; }
public long? Size { get ; set ; }
public List < string > Streams { get ; set ; } = new ();
}
public class PrivaPubVideo
{
public double? Duration { get ; set ; }
public List < PrivaPubVariant > Variants { get ; set ; } = new ();
public bool IsLive { get ; set ; }
public int? State { get ; set ; }
public long? Views { get ; set ; }
public int? CommentsPolicy { get ; set ; }
public bool? DownloadEnabled { get ; set ; }
public string Licence { get ; set ; }
public string Category { get ; set ; }
public string Channel { get ; set ; }
public List < PrivaPubCaption > Captions { get ; set ; } = new ();
}
public class PrivaPubCaption
{
public string Language { get ; set ; }
public string Url { get ; set ; }
}
public class PrivaPubAudio
{
public double? Duration { get ; set ; }
public List < PrivaPubVariant > Variants { get ; set ; } = new ();
public string Album { get ; set ; }
public int? Position { get ; set ; }
public string Licence { get ; set ; }
}
public class PrivaPubEvent
{
public string Start { get ; set ; }
public string End { get ; set ; }
public string TimeZone { get ; set ; }
public bool Floating { get ; set ; }
public List < PrivaPubPlace > Places { get ; set ; } = new ();
public string OnlineUrl { get ; set ; }
public string JoinMode { get ; set ; }
public int? Participants { get ; set ; }
public int? Capacity { get ; set ; }
public string Status { get ; set ; }
public string Category { get ; set ; }
2026-10-05 14:55:20 +02:00
public string Participation { get ; set ; } //the viewer's: "pending", "accepted" or "rejected"
2026-10-01 17:58:22 +02:00
}
public class PrivaPubPlace
{
public string Name { get ; set ; }
public string Address { get ; set ; }
2026-10-04 10:07:06 +02:00
public string Country { get ; set ; } //a post's own place only
2026-10-01 17:58:22 +02:00
public double? Latitude { get ; set ; }
public double? Longitude { get ; set ; }
public string Url { get ; set ; }
}
2026-10-07 21:14:32 +02:00
public class PrivaPubFlair
{
public string Id { get ; set ; }
public string Name { get ; set ; }
public string Slug { get ; set ; }
public string Description { get ; set ; }
public string Color { get ; set ; }
public string TextColor { get ; set ; }
public string BackgroundColor { get ; set ; }
public bool BlurImages { get ; set ; }
}
2026-10-01 17:58:22 +02:00
public class PrivaPubVotes
{
public int Up { get ; set ; }
public int Down { get ; set ; }
2026-10-08 02:15:28 +02:00
public bool? Downvoted { get ; set ; } //the viewer's own downvote; null with no viewer
2026-10-01 17:58:22 +02:00
}
2026-10-01 18:53:28 +02:00
public class QuoteEntity
{
public string State { get ; set ; }
public Status QuotedStatus { get ; set ; }
public string QuotedStatusId { get ; set ; }
}
public class QuoteApprovalEntity
{
public List < string > Automatic { get ; set ; } = new ();
public List < string > Manual { get ; set ; } = new ();
public string CurrentUser { get ; set ; } = "denied" ;
}
2026-10-05 02:48:49 +02:00
public class FilterEntity
{
public string Id { get ; set ; }
public string Title { get ; set ; }
public List < string > Context { get ; set ; } = new ();
public string ExpiresAt { get ; set ; }
public string FilterAction { get ; set ; }
public List < FilterKeywordEntity > Keywords { get ; set ; } = new ();
public List < FilterStatusEntity > Statuses { get ; set ; } = new ();
}
public class FilterKeywordEntity
{
public string Id { get ; set ; }
public string Keyword { get ; set ; }
public bool WholeWord { get ; set ; }
}
public class FilterStatusEntity
{
public string Id { get ; set ; }
public string StatusId { get ; set ; }
}
public class FilterResultEntity
{
public FilterEntity Filter { get ; set ; }
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0006", Justification = "The Mastodon API sends null when no keyword of the filter matched.")]
2026-10-05 02:48:49 +02:00
public List < string > KeywordMatches { get ; set ; }
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0006", Justification = "The Mastodon API sends null when no status of the filter matched.")]
2026-10-05 02:48:49 +02:00
public List < string > StatusMatches { get ; set ; }
}
// the v1 filter, which is one keyword of a v2 filter
public class FilterV1Entity
{
public string Id { get ; set ; }
public string Phrase { get ; set ; }
public List < string > Context { get ; set ; } = new ();
public bool WholeWord { get ; set ; }
public string ExpiresAt { get ; set ; }
public bool Irreversible { get ; set ; }
}
2026-10-01 18:39:18 +02:00
public class EmojiReactionEntity
{
public string Name { get ; set ; }
public int Count { get ; set ; }
public bool Me { get ; set ; }
public string Url { get ; set ; }
public string StaticUrl { get ; set ; }
}
public class PleromaStatus
{
public List < EmojiReactionEntity > EmojiReactions { get ; set ; } = new ();
}
2026-10-01 18:35:20 +02:00
public class PollEntity
{
public string Id { get ; set ; }
public string ExpiresAt { get ; set ; }
public bool Expired { get ; set ; }
public bool Multiple { get ; set ; }
public int VotesCount { get ; set ; }
public int? VotersCount { get ; set ; }
public bool? Voted { get ; set ; }
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0006", Justification = "The Mastodon API leaves own_votes null for a viewer who is not signed in.")]
2026-10-01 18:35:20 +02:00
public List < int > OwnVotes { get ; set ; }
public List < PollOptionEntity > Options { get ; set ; } = new ();
public List < CustomEmojiEntity > Emojis { get ; set ; } = new ();
}
public class PollOptionEntity
{
public string Title { get ; set ; }
public int? VotesCount { get ; set ; }
}
2026-10-01 17:53:59 +02:00
public class PreviewCard
{
public string Url { get ; set ; }
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 17:53:59 +02:00
public string Title { get ; set ; } = string . Empty ;
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 17:53:59 +02:00
public string Description { get ; set ; } = string . Empty ;
public string Type { get ; set ; } = "link" ;
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 17:53:59 +02:00
public string AuthorName { get ; set ; } = string . Empty ;
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 17:53:59 +02:00
public string AuthorUrl { get ; set ; } = string . Empty ;
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 17:53:59 +02:00
public string ProviderName { get ; set ; } = string . Empty ;
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 17:53:59 +02:00
public string ProviderUrl { get ; set ; } = string . Empty ;
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 17:53:59 +02:00
public string Html { get ; set ; } = string . Empty ;
public int Width { get ; set ; }
public int Height { get ; set ; }
public string Image { get ; set ; }
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 17:53:59 +02:00
public string ImageDescription { get ; set ; } = string . Empty ;
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 17:53:59 +02:00
public string EmbedUrl { get ; set ; } = string . Empty ;
public string Blurhash { get ; set ; }
public string Language { get ; set ; }
public string PublishedAt { get ; set ; }
public List < object > Authors { get ; set ; } = new ();
}
2026-10-01 11:52:31 +02:00
public class Status
{
public string Id { get ; set ; }
public string Uri { get ; set ; }
public string Url { get ; set ; }
public Account Account { get ; set ; }
public string InReplyToId { get ; set ; }
public string InReplyToAccountId { get ; set ; }
public Status Reblog { get ; set ; }
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 11:52:31 +02:00
public string Content { get ; set ; } = string . Empty ;
public string CreatedAt { get ; set ; }
public string EditedAt { get ; set ; }
2026-10-01 18:35:20 +02:00
public List < CustomEmojiEntity > Emojis { get ; set ; } = new ();
2026-10-01 11:52:31 +02:00
public int RepliesCount { get ; set ; }
public int ReblogsCount { get ; set ; }
public int FavouritesCount { get ; set ; }
public bool Reblogged { get ; set ; }
public bool Favourited { get ; set ; }
public bool Muted { get ; set ; }
public bool Bookmarked { get ; set ; }
public bool Pinned { get ; set ; }
public bool Sensitive { get ; set ; }
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 11:52:31 +02:00
public string SpoilerText { get ; set ; } = string . Empty ;
public string Visibility { get ; set ; }
public List < MediaAttachment > MediaAttachments { get ; set ; } = new ();
public List < StatusMention > Mentions { get ; set ; } = new ();
public List < StatusTag > Tags { get ; set ; } = new ();
2026-10-01 17:53:59 +02:00
public PreviewCard Card { get ; set ; }
2026-10-01 18:35:20 +02:00
public PollEntity Poll { get ; set ; }
2026-10-01 11:52:31 +02:00
public Application Application { get ; set ; }
public string Language { get ; set ; }
public string Text { get ; set ; }
2026-10-05 02:48:49 +02:00
public List < FilterResultEntity > Filtered { get ; set ; } = new ();
2026-10-01 17:58:22 +02:00
public PrivaPubStatus Privapub { get ; set ; }
2026-10-01 18:39:18 +02:00
public List < EmojiReactionEntity > EmojiReactions { get ; set ; } = new ();
public PleromaStatus Pleroma { get ; set ; }
2026-10-01 18:53:28 +02:00
public QuoteEntity Quote { get ; set ; }
public int QuotesCount { get ; set ; }
public QuoteApprovalEntity QuoteApproval { get ; set ; }
2026-10-05 11:43:58 +02:00
public InteractionPolicyEntity InteractionPolicy { get ; set ; } //GoToSocial's: who may like, reply to and boost a remote post
}
// GoToSocial's interaction_policy: "public", "followers", "following", "author", "me", or an account's URI
public class InteractionPolicyEntity
{
public InteractionRuleEntity CanFavourite { get ; set ; }
public InteractionRuleEntity CanReply { get ; set ; }
public InteractionRuleEntity CanReblog { get ; set ; }
}
public class InteractionRuleEntity
{
public List < string > AutomaticApproval { get ; set ; } = new ();
public List < string > ManualApproval { get ; set ; } = new ();
2026-10-01 11:52:31 +02:00
}
public class MediaAttachment
{
public string Id { get ; set ; }
public string Type { get ; set ; }
public string Url { get ; set ; }
public string PreviewUrl { get ; set ; }
public string RemoteUrl { get ; set ; }
public object Meta { get ; set ; }
public string Description { get ; set ; }
public string Blurhash { get ; set ; }
}
public class StatusMention
{
public string Id { get ; set ; }
public string Username { get ; set ; }
public string Url { get ; set ; }
public string Acct { get ; set ; }
}
public class StatusTag
{
public string Name { get ; set ; }
public string Url { get ; set ; }
}
public class Application
{
public string Id { get ; set ; }
public string Name { get ; set ; }
public string Website { get ; set ; }
public List < string > Scopes { get ; set ; } = new ();
public List < string > RedirectUris { get ; set ; } = new ();
public string RedirectUri { get ; set ; }
public string ClientId { get ; set ; }
public string ClientSecret { get ; set ; }
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 11:52:31 +02:00
public string VapidKey { get ; set ; } = string . Empty ;
}
public class Relationship
{
public string Id { get ; set ; }
public bool Following { get ; set ; }
public bool ShowingReblogs { get ; set ; }
public bool Notifying { get ; set ; }
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0006", Justification = "The Mastodon API sends null when every language of the account is followed.")]
2026-10-01 11:52:31 +02:00
public List < string > Languages { get ; set ; }
public bool FollowedBy { get ; set ; }
public bool Blocking { get ; set ; }
public bool BlockedBy { get ; set ; }
public bool Muting { get ; set ; }
public bool MutingNotifications { get ; set ; }
public bool Requested { get ; set ; }
public bool RequestedBy { get ; set ; }
public bool DomainBlocking { get ; set ; }
public bool Endorsed { get ; set ; }
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-01 11:52:31 +02:00
public string Note { get ; set ; } = string . Empty ;
}
2026-10-18 08:38:11 +02:00
// Mastodon's FeaturedTag: its count as a string and its last use as a day, as Mastodon's serializer writes them
public class FeaturedTagEntity
{
public string Id { get ; set ; }
public string Name { get ; set ; }
public string Url { get ; set ; }
public string StatusesCount { get ; set ; } = "0" ;
public string LastStatusAt { get ; set ; }
}
// Mastodon's v2 Suggestion: why (source, deprecated since 4.3, and sources) and whom
public class Suggestion
{
public string Source { get ; set ; }
public List < string > Sources { get ; set ; } = new ();
public Account Account { get ; set ; }
}
2026-10-01 11:52:31 +02:00
public class Notification
{
public string Id { get ; set ; }
public string Type { get ; set ; }
public string CreatedAt { get ; set ; }
public string GroupKey { get ; set ; }
public Account Account { get ; set ; }
public Status Status { get ; set ; }
2026-10-01 18:39:18 +02:00
public string Emoji { get ; set ; }
public string EmojiUrl { get ; set ; }
2026-10-07 21:10:58 +02:00
public AccountWarning ModerationWarning { get ; set ; }
}
public class AccountWarning
{
public string Id { get ; set ; }
public string Action { get ; set ; } = "none" ;
2026-11-10 01:24:43 +01:00
[System.Diagnostics.CodeAnalysis.SuppressMessage("HouseRules", "HR0005", Justification = "The Mastodon API sends this as a string, \"\" when empty; clients break on null.")]
2026-10-07 21:10:58 +02:00
public string Text { get ; set ; } = string . Empty ;
public List < string > StatusIds { get ; set ; } = new ();
public Account TargetAccount { get ; set ; }
public object Appeal { get ; set ; }
public string CreatedAt { get ; set ; }
2026-10-01 11:52:31 +02:00
}
public class Context
{
public List < Status > Ancestors { get ; set ; } = new ();
public List < Status > Descendants { get ; set ; } = new ();
}
public class StatusEdit
{
public string Content { get ; set ; }
public string SpoilerText { get ; set ; }
public bool Sensitive { get ; set ; }
public string CreatedAt { get ; set ; }
public Account Account { get ; set ; }
public List < MediaAttachment > MediaAttachments { get ; set ; } = new ();
2026-10-01 18:35:20 +02:00
public List < CustomEmojiEntity > Emojis { get ; set ; } = new ();
2026-10-01 11:52:31 +02:00
}
public class StatusSource
{
public string Id { get ; set ; }
public string Text { get ; set ; }
public string SpoilerText { get ; set ; }
}
public class SearchResults
{
public List < Account > Accounts { get ; set ; } = new ();
public List < Status > Statuses { get ; set ; } = new ();
public List < object > Hashtags { get ; set ; } = new ();
}
public class Conversation
{
public string Id { get ; set ; }
public bool Unread { get ; set ; }
public List < Account > Accounts { get ; set ; } = new ();
public Status LastStatus { get ; set ; }
}
public class Marker
{
public string LastReadId { get ; set ; }
public int Version { get ; set ; }
public string UpdatedAt { get ; set ; }
}
}