]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/create_or_update/post.rs
d40073cf336baa4b8897542232c72de9c5b499e8
[lemmy.git] / crates / apub / src / protocol / activities / create_or_update / post.rs
1 use crate::{
2   objects::person::ApubPerson,
3   protocol::{activities::CreateOrUpdateType, objects::page::Page, Unparsed},
4 };
5 use activitypub_federation::{core::object_id::ObjectId, deser::helpers::deserialize_one_or_many};
6 use serde::{Deserialize, Serialize};
7 use url::Url;
8
9 #[derive(Clone, Debug, Deserialize, Serialize)]
10 #[serde(rename_all = "camelCase")]
11 pub struct CreateOrUpdatePost {
12   pub(crate) actor: ObjectId<ApubPerson>,
13   #[serde(deserialize_with = "deserialize_one_or_many")]
14   pub(crate) to: Vec<Url>,
15   pub(crate) object: Page,
16   #[serde(deserialize_with = "deserialize_one_or_many")]
17   pub(crate) cc: Vec<Url>,
18   #[serde(rename = "type")]
19   pub(crate) kind: CreateOrUpdateType,
20   pub(crate) id: Url,
21
22   #[serde(flatten)]
23   pub(crate) unparsed: Unparsed,
24 }