2 objects::instance::ApubSite,
3 protocol::{ImageObject, Source},
5 use chrono::{DateTime, FixedOffset};
6 use lemmy_apub_lib::{object_id::ObjectId, signatures::PublicKey, values::MediaTypeHtml};
7 use serde::{Deserialize, Serialize};
8 use serde_with::skip_serializing_none;
11 #[derive(Clone, Copy, Debug, Deserialize, Serialize, PartialEq)]
12 pub enum InstanceType {
17 #[skip_serializing_none]
18 #[derive(Clone, Debug, Deserialize, Serialize)]
19 #[serde(rename_all = "camelCase")]
21 #[serde(rename = "type")]
22 pub(crate) kind: InstanceType,
23 pub(crate) id: ObjectId<ApubSite>,
25 pub(crate) name: String,
26 pub(crate) inbox: Url,
27 /// mandatory field in activitypub, lemmy currently serves an empty outbox
28 pub(crate) outbox: Url,
29 pub(crate) public_key: PublicKey,
32 pub(crate) content: Option<String>,
33 #[serde(deserialize_with = "crate::deserialize_skip_error", default)]
34 pub(crate) source: Option<Source>,
35 // short instance description
36 pub(crate) summary: Option<String>,
37 pub(crate) media_type: Option<MediaTypeHtml>,
39 pub(crate) icon: Option<ImageObject>,
41 pub(crate) image: Option<ImageObject>,
42 pub(crate) published: DateTime<FixedOffset>,
43 pub(crate) updated: Option<DateTime<FixedOffset>>,