namespace decePubClient.Models.Mastodon;
/// A persona, a remote account or a community, as PrivaPub's Mastodon API sends it.
public class Account
{
public string Id { get; set; }
public string Username { get; set; }
/// username for a local account, username@host for a remote one.
public string Acct { get; set; }
public string DisplayName { get; set; }
public bool Locked { get; set; }
public bool Bot { get; set; }
public bool Group { get; set; }
public DateTime? 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 List Emojis { get; set; } = [];
public List Fields { get; set; } = [];
/// Whether it is listed in the directory and suggested; null when its server does not say.
public bool? Discoverable { get; set; }
/// Whether its public posts may be found by full-text search.
public bool? Indexable { get; set; }
/// The persona's own account only (verify_credentials, update_credentials): its profile as written and its
/// posting defaults.
public AccountSource Source { get; set; }
/// The account's server: the host of its ActivityPub id.
public string Host => System.Uri.TryCreate(Uri, UriKind.Absolute, out var uri) ? uri.Host.ToLowerInvariant() : default;
/// The name to show: the display name, or the username when there is none.
public string Name => string.IsNullOrWhiteSpace(DisplayName) ? Username : DisplayName;
}
public class AccountSource
{
/// The biography as written, before PrivaPub renders it.
public string Note { get; set; }
public List Fields { get; set; } = [];
/// The default visibility of a new post: public, unlisted or private.
public string Privacy { get; set; }
public bool Sensitive { get; set; }
public string Language { get; set; }
/// Who may quote the persona's posts: public, followers or nobody.
public string QuotePolicy { get; set; }
public int FollowRequestsCount { get; set; }
}
/// A page of accounts (mutes, blocks), and the cursor of the next one: null at the end.
public class AccountPage
{
public List Accounts { get; set; } = [];
public string MaxId { get; set; }
}
public class AccountField
{
public string Name { get; set; }
public string Value { get; set; }
public DateTime? VerifiedAt { get; set; }
}
public class CustomEmoji
{
public string Shortcode { get; set; }
public string Url { get; set; }
public string StaticUrl { get; set; }
}
public class Relationship
{
public string Id { get; set; }
public bool Following { 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 ShowingReblogs { get; set; }
public bool Notifying { get; set; }
public bool Requested { get; set; }
public bool RequestedBy { get; set; }
public bool DomainBlocking { get; set; }
}
/// /api/v2/search: what matched, a remote handle or URL resolved by PrivaPub.
public class SearchResults
{
public List Accounts { get; set; } = [];
public List Statuses { get; set; } = [];
public List Hashtags { get; set; } = [];
}