2 objects::instance::ApubSite,
3 protocol::{ImageObject, Source},
5 use activitypub_federation::{
6 core::{object_id::ObjectId, signatures::PublicKey},
7 deser::{helpers::deserialize_skip_error, values::MediaTypeHtml},
9 use chrono::{DateTime, FixedOffset};
10 use serde::{Deserialize, Serialize};
11 use serde_with::skip_serializing_none;
14 #[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq)]
15 pub enum InstanceType {
20 #[skip_serializing_none]
21 #[derive(Clone, Debug, Deserialize, Serialize)]
22 #[serde(rename_all = "camelCase")]
24 #[serde(rename = "type")]
25 pub(crate) kind: InstanceType,
26 pub(crate) id: ObjectId<ApubSite>,
28 pub(crate) name: String,
29 pub(crate) inbox: Url,
30 /// mandatory field in activitypub, lemmy currently serves an empty outbox
31 pub(crate) outbox: Url,
32 pub(crate) public_key: PublicKey,
35 pub(crate) content: Option<String>,
36 #[serde(deserialize_with = "deserialize_skip_error", default)]
37 pub(crate) source: Option<Source>,
38 // short instance description
39 pub(crate) summary: Option<String>,
40 pub(crate) media_type: Option<MediaTypeHtml>,
42 pub(crate) icon: Option<ImageObject>,
44 pub(crate) image: Option<ImageObject>,
45 pub(crate) published: DateTime<FixedOffset>,
46 pub(crate) updated: Option<DateTime<FixedOffset>>,