1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#[derive(Debug, Clone, Deserialize, PartialEq)]
pub struct Attachment {
pub id: String,
#[serde(rename = "type")]
pub media_type: MediaType,
pub url: String,
pub remote_url: Option<String>,
pub preview_url: String,
pub text_url: Option<String>,
pub meta: Option<Meta>,
pub description: Option<String>,
}
#[derive(Debug, Deserialize, Clone, PartialEq)]
pub struct Meta {
pub original: Option<ImageDetails>,
pub small: Option<ImageDetails>,
}
#[derive(Debug, Deserialize, Clone, PartialEq)]
pub struct ImageDetails {
width: u64,
height: u64,
size: Option<String>,
aspect: Option<f64>,
}
#[derive(Debug, Deserialize, Clone, Copy, PartialEq)]
pub enum MediaType {
#[serde(rename = "image")]
Image,
#[serde(rename = "video")]
Video,
#[serde(rename = "gifv")]
Gifv,
#[serde(rename = "unknown")]
Unknown,
}