using PrivaPub.Models.ActivityPub.Extra; using System.Text.Json.Serialization; namespace PrivaPub.Models.ActivityPub { [JsonSerializable(typeof(ActivityPubActor))] public class ActivityPubActor : ActivityPubObject { [JsonPropertyName("type")] public new ObjectType? Type => ObjectType.Person; [JsonPropertyName("inbox")] public string Inbox { get; set; } [JsonPropertyName("outbox")] public string Outbox { get; set; } [JsonPropertyName("url")] public string ProfileURL { get; set; } [JsonPropertyName("preferredUsername")] public string PreferredUsername { get; set; } [JsonPropertyName("name")] public string Name { get; set; } [JsonPropertyName("summary")] public string Summary { get; set; } [JsonPropertyName("icon")] public ActivityPubIcon Icon { get; set; } [JsonPropertyName("image")] public ActivityPubIcon Thumbnail { get; set; } [JsonPropertyName("manuallyApprovesFollowers")] public bool ManuallyApprovesFollowers { get; set; } = false; [JsonPropertyName("discoverable")] public bool Discoverable { get; set; } = true; [JsonPropertyName("publicKey")] public ActivityPubPublicKey PublicKey { get; set; } = new(); [JsonPropertyName("endpoints")] public ActivityPubActorEndpoints Endpoints { get; set; } = new(); [JsonPropertyName("attachment")] public IEnumerable Attachment { get; set; } = Enumerable.Empty(); [JsonPropertyName("tag")] public IEnumerable Tags => Enumerable.Empty(); } public class ActivityPubAttachment { [JsonPropertyName("type")] public string Type { get; set; } [JsonPropertyName("name")] public string Name { get; set; } [JsonPropertyName("value")] public string Value { get; set; } } public class ActivityPubActorEndpoints { [JsonPropertyName("sharedInbox")] public string SharedInboxURL { get; set; } [JsonPropertyName("oauthAuthorizationEndpoint")] public string OAuthAuthorizationEndpoint { get; set; } [JsonExtensionData] public Dictionary OtherData { get; set; } } public class ActivityPubPublicKey { [JsonPropertyName("id")] public string Id { get; set; } [JsonPropertyName("owner")] public string Owner { get; set; } [JsonPropertyName("publicKeyPem")] public string PublicKeyPem { get; set; } } }