use serde::{Deserialize, Serialize}; #[serde(deny_unknown_fields)] #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub(crate) struct Attachment { pub(crate) id: String, pub(crate) r#type: AttachmentType, pub(crate) url: String, pub(crate) preview_url: String, pub(crate) remote_url: Option, pub(crate) text_url: Option, pub(crate) meta: Option, // TODO - is this the best type for the API? pub(crate) description: Option, pub(crate) blurhash: Option, } #[serde(rename_all = "lowercase", deny_unknown_fields)] #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] pub(crate) enum AttachmentType { Unknown, Image, Gifv, Video, Audio, }