drive_v3/objects/
drive_theme.rs1use std::fmt;
2use serde::{Serialize, Deserialize};
3
4#[derive(Default, Debug, Clone, Serialize, Deserialize)]
6#[serde(rename_all = "camelCase")]
7pub struct DriveTheme {
8 #[serde(skip_serializing_if = "Option::is_none")]
10 pub id: Option<String>,
11
12 #[serde(skip_serializing_if = "Option::is_none")]
14 pub background_image_link: Option<String>,
15
16 #[serde(skip_serializing_if = "Option::is_none")]
18 pub color_rgb: Option<String>,
19}
20
21impl fmt::Display for DriveTheme {
22 fn fmt( &self, f: &mut fmt::Formatter<'_> ) -> fmt::Result {
23 let json = serde_json::to_string_pretty(&self)
24 .unwrap_or( format!("unable to parse JSON, this is the debug view:\n{:#?}", self) );
25
26 write!(f, "{}", json)
27 }
28}
29
30impl DriveTheme {
31 pub fn new() -> Self {
33 Self { ..Default::default() }
34 }
35}