use chrono::{DateTime, Utc}; use serde::{Deserialize, Serialize}; use serde_json::Value; use super::vocabulary::HASHTAG; #[derive(Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct Attachment { #[serde(rename = "type")] pub attachment_type: String, pub name: Option, pub media_type: Option, pub url: Option, } #[derive(Deserialize)] #[serde(rename_all = "camelCase")] pub struct Link { pub href: String, } fn default_tag_type() -> String { HASHTAG.to_string() } #[derive(Deserialize, Serialize)] #[serde(rename_all = "camelCase")] pub struct Tag { pub name: Option, #[serde(rename = "type", default = "default_tag_type")] pub tag_type: String, pub href: Option, #[serde(skip_serializing_if = "Option::is_none")] pub media_type: Option, } #[derive(Deserialize)] #[cfg_attr(test, derive(Default))] #[serde(rename_all = "camelCase")] pub struct Object { pub id: String, #[serde(rename = "type")] pub object_type: String, pub name: Option, pub attachment: Option, pub cc: Option, pub media_type: Option, pub published: Option>, pub attributed_to: Option, pub in_reply_to: Option, pub content: Option, pub quote_url: Option, pub tag: Option, pub to: Option, pub updated: Option>, pub url: Option, }