drive_v3/objects/
change.rs1use std::fmt;
2use serde::{Serialize, Deserialize};
3
4use super::{File, DriveInfo};
5
6#[derive(Default, Debug, Clone, Serialize, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct ChangeList {
10 #[serde(skip_serializing_if = "Option::is_none")]
14 pub kind: Option<String>,
15
16 #[serde(skip_serializing_if = "Option::is_none")]
21 pub next_page_token: Option<String>,
22
23 #[serde(skip_serializing_if = "Option::is_none")]
28 pub new_start_page_token: Option<String>,
29
30 #[serde(skip_serializing_if = "Option::is_none")]
36 pub changes: Option<Vec<Change>>,
37}
38
39impl fmt::Display for ChangeList {
40 fn fmt( &self, f: &mut fmt::Formatter<'_> ) -> fmt::Result {
41 let json = serde_json::to_string_pretty(&self)
42 .unwrap_or( format!("unable to parse JSON, this is the debug view:\n{:#?}", self) );
43
44 write!(f, "{}", json)
45 }
46}
47
48impl ChangeList {
49 pub fn new() -> Self {
51 Self { ..Default::default() }
52 }
53}
54
55#[derive(Default, Debug, Clone, Serialize, Deserialize)]
57#[serde(rename_all = "camelCase")]
58pub struct Change {
59 #[serde(skip_serializing_if = "Option::is_none")]
63 pub kind: Option<String>,
64
65 #[serde(skip_serializing_if = "Option::is_none")]
68 pub removed: Option<bool>,
69
70 #[serde(skip_serializing_if = "Option::is_none")]
75 pub file: Option<File>,
76
77 #[serde(skip_serializing_if = "Option::is_none")]
79 pub file_id: Option<String>,
80
81 #[serde(skip_serializing_if = "Option::is_none")]
83 pub time: Option<String>,
84
85 #[serde(skip_serializing_if = "Option::is_none")]
87 pub drive_id: Option<String>,
88
89 #[serde(skip_serializing_if = "Option::is_none")]
93 pub change_type: Option<String>,
94
95 #[serde(skip_serializing_if = "Option::is_none")]
101 pub drive: Option<DriveInfo>,
102}
103
104impl fmt::Display for Change {
105 fn fmt( &self, f: &mut fmt::Formatter<'_> ) -> fmt::Result {
106 let json = serde_json::to_string_pretty(&self)
107 .unwrap_or( format!("unable to parse JSON, this is the debug view:\n{:#?}", self) );
108
109 write!(f, "{}", json)
110 }
111}
112
113impl Change {
114 pub fn new() -> Self {
116 Self { ..Default::default() }
117 }
118}