ulule/
image.rs

1use serde::{Serialize, Deserialize};
2
3// Image is the image resource.
4#[derive(Debug, Serialize, Deserialize)]
5pub struct Image {
6    // color
7    pub color: Option<String>,
8    // Unique id of the image
9    pub id: u64,
10    // Language of the image
11    pub lang: String,
12    // filename
13    pub name: Option<String>,
14    // Type of the image (main, background, secondary)
15    #[serde(alias = "type")]
16    pub kind: String,
17    // Publicly available URL of the image
18    pub url: Option<String>,
19    // Path to the file.
20    pub value: Option<String>,
21    // Versions of the image
22    pub versions: Option<Versions>
23}
24
25// Versions is the image versions resource.
26#[derive(Debug, Serialize, Deserialize)]
27pub struct Versions {
28    pub full: Option<Version>,
29    pub large: Option<Version>,
30    pub medium: Option<Version>,
31    pub small: Option<Version>,
32}
33
34// Version is the image version resource.
35#[derive(Debug, Serialize, Deserialize)]
36pub struct Version {
37    // Image height in pixel, null in case it is the original version of the file
38    pub height: Option<u64>,
39    // Image URL
40    pub url: String,
41    // Image width in pixel, null in case it is the original version of the file
42    pub width: Option<u64>,
43}