Remove unused fields from Object and Activity types

This commit is contained in:
silverpill 2022-12-10 17:30:19 +00:00
parent f21f72b96e
commit cc728afb7d

View file

@ -38,72 +38,33 @@ pub struct Tag {
pub media_type: Option<String>,
}
#[derive(Default, Deserialize, Serialize)]
#[derive(Deserialize)]
#[cfg_attr(test, derive(Default))]
#[serde(rename_all = "camelCase")]
pub struct Object {
#[serde(rename = "@context")]
pub context: Option<Value>,
pub id: String,
#[serde(rename = "type")]
pub object_type: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub actor: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub attachment: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cc: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub former_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub media_type: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub object: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub published: Option<DateTime<Utc>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub attributed_to: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub in_reply_to: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub content: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub quote_url: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tag: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub to: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub updated: Option<DateTime<Utc>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub url: Option<Value>,
}
#[derive(Deserialize, Serialize)]
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct Activity {
#[serde(rename = "@context")]
pub context: Value,
pub id: String,
#[serde(rename = "type")]
@ -111,13 +72,7 @@ pub struct Activity {
pub actor: String,
pub object: Value,
#[serde(skip_serializing_if = "Option::is_none")]
pub target: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub to: Option<Value>,
#[serde(skip_serializing_if = "Option::is_none")]
pub cc: Option<Value>,
}