2020-04-03 18:41:53 +02:00
|
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
|
|
|
|
#[serde(deny_unknown_fields)]
|
2020-04-24 01:28:26 +02:00
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
2020-04-29 22:18:45 +02:00
|
|
|
pub(in super::super) struct Attachment {
|
2020-04-29 23:58:01 +02:00
|
|
|
pub(in super::super) id: String,
|
|
|
|
pub(in super::super) r#type: AttachmentType,
|
|
|
|
pub(in super::super) url: String,
|
|
|
|
pub(in super::super) preview_url: String,
|
|
|
|
pub(in super::super) remote_url: Option<String>,
|
|
|
|
pub(in super::super) text_url: Option<String>,
|
|
|
|
pub(in super::super) meta: Option<serde_json::Value>, // TODO - is this the best type for the API?
|
|
|
|
pub(in super::super) description: Option<String>,
|
|
|
|
pub(in super::super) blurhash: Option<String>,
|
2020-04-03 18:41:53 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
#[serde(rename_all = "lowercase", deny_unknown_fields)]
|
2020-04-24 01:28:26 +02:00
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
|
2020-04-29 23:58:01 +02:00
|
|
|
pub(in super::super) enum AttachmentType {
|
2020-04-03 18:41:53 +02:00
|
|
|
Unknown,
|
|
|
|
Image,
|
|
|
|
Gifv,
|
|
|
|
Video,
|
|
|
|
Audio,
|
|
|
|
}
|