]> Untitled Git - lemmy.git/blob - crates/apub/src/protocol/activities/deletion/delete.rs
Remove ActivityFields trait, deserialize into another struct instead
[lemmy.git] / crates / apub / src / protocol / activities / deletion / delete.rs
1 use crate::{fetcher::object_id::ObjectId, objects::person::ApubPerson};
2 use activitystreams::{activity::kind::DeleteType, unparsed::Unparsed};
3 use serde::{Deserialize, Serialize};
4 use serde_with::skip_serializing_none;
5 use url::Url;
6
7 #[skip_serializing_none]
8 #[derive(Clone, Debug, Deserialize, Serialize)]
9 #[serde(rename_all = "camelCase")]
10 pub struct Delete {
11   pub(crate) actor: ObjectId<ApubPerson>,
12   pub(crate) to: Vec<Url>,
13   pub(crate) object: Url,
14   pub(crate) cc: Vec<Url>,
15   #[serde(rename = "type")]
16   pub(crate) kind: DeleteType,
17   /// If summary is present, this is a mod action (Remove in Lemmy terms). Otherwise, its a user
18   /// deleting their own content.
19   pub(crate) summary: Option<String>,
20   pub(crate) id: Url,
21   #[serde(flatten)]
22   pub(crate) unparsed: Unparsed,
23 }