2 objects::instance::ApubSite,
3 protocol::{objects::LanguageTag, ImageObject, Source},
5 use activitypub_federation::{
6 core::{object_id::ObjectId, signatures::PublicKey},
7 deser::{helpers::deserialize_skip_error, values::MediaTypeHtml},
9 use activitystreams_kinds::actor::ApplicationType;
10 use chrono::{DateTime, FixedOffset};
11 use serde::{Deserialize, Serialize};
12 use serde_with::skip_serializing_none;
15 #[skip_serializing_none]
16 #[derive(Clone, Debug, Deserialize, Serialize)]
17 #[serde(rename_all = "camelCase")]
19 #[serde(rename = "type")]
20 pub(crate) kind: ApplicationType,
21 pub(crate) id: ObjectId<ApubSite>,
23 pub(crate) name: String,
24 pub(crate) inbox: Url,
25 /// mandatory field in activitypub, lemmy currently serves an empty outbox
26 pub(crate) outbox: Url,
27 pub(crate) public_key: PublicKey,
30 pub(crate) content: Option<String>,
31 #[serde(deserialize_with = "deserialize_skip_error", default)]
32 pub(crate) source: Option<Source>,
33 // short instance description
34 pub(crate) summary: Option<String>,
35 pub(crate) media_type: Option<MediaTypeHtml>,
37 pub(crate) icon: Option<ImageObject>,
39 pub(crate) image: Option<ImageObject>,
41 pub(crate) language: Vec<LanguageTag>,
42 pub(crate) published: DateTime<FixedOffset>,
43 pub(crate) updated: Option<DateTime<FixedOffset>>,