]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/create_or_update/post.rs
2061c88151f0ba7ea17a0fd121408b53ea9f9ee4
[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 lemmy_apub_lib::object_id::ObjectId;
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 = "crate::deserialize_one_or_many")]
14   pub(crate) to: Vec<Url>,
15   pub(crate) object: Page,
16   #[serde(deserialize_with = "crate::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   #[serde(flatten)]
22   pub(crate) unparsed: Unparsed,
23 }