ocpi/types/image.rs
1use super::CiString;
2use url::Url;
3
4/// # 8.4.15. Image class
5/// This class references an image related to an EVSE in terms of a file name or url.
6/// According to the roaming connection between one EVSE Operator and one or more
7/// Navigation Service Providers,
8/// the hosting or file exchange of image payload data has to be defined.
9/// The exchange of this content data is out of scope of OCPI.
10/// However, the recommended setup is a public available web server hosted and updated
11/// by the EVSE Operator.
12/// Per charge point an unlimited number of images of each type is allowed.
13/// Recommended are at least two images where one is a network or provider logo and the
14/// second is a station photo.
15/// If two images of the same type are defined, not only one should be selected but both
16/// should be displayed together.
17///
18/// ### Photo Dimensions:
19/// The recommended dimensions for all photos is a
20/// minimum width of 800 pixels
21/// and a minimum height of 600 pixels.
22/// Thumbnail should always have the same orientation as the original photo
23/// with a size of 200 by 200 pixels.
24///
25/// ### Logo Dimensions:
26/// The recommended dimensions for logos are exactly 512 pixels in width height.
27/// Thumbnail representations of logos should be exactly 128 pixels in width and height.
28/// If not squared, thumbnails should have the same orientation as the original.
29///
30
31#[derive(Clone, Debug, PartialEq, Eq, serde::Serialize, serde::Deserialize)]
32pub struct Image {
33 /// URL from where the image data can be fetched through a web browser.
34 pub url: Url,
35
36 /// URL from where a thumbnail of the image can be fetched through a
37 /// webbrowser.
38 pub thumbnail: Option<Url>,
39
40 /// Describes what the image is used for.
41 pub category: super::ImageCategory,
42
43 /// Image type like: gif, jpeg, png, svg.
44 pub r#type: CiString<4>,
45
46 /// Width of the full scale image.
47 pub width: Option<i32>,
48
49 /// Height of the full scale image.
50 pub height: Option<i32>,
51}