drive_v3/objects/
reply.rs1use std::fmt;
2use serde::{Serialize, Deserialize};
3
4use super::User;
5
6#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
8#[serde(rename_all = "camelCase")]
9pub struct Reply {
10 #[serde(skip_serializing_if = "Option::is_none")]
12 pub id: Option<String>,
13
14 #[serde(skip_serializing_if = "Option::is_none")]
18 pub kind: Option<String>,
19
20 #[serde(skip_serializing_if = "Option::is_none")]
22 pub created_time: Option<String>,
23
24 #[serde(skip_serializing_if = "Option::is_none")]
27 pub modified_time: Option<String>,
28
29 #[serde(skip_serializing_if = "Option::is_none")]
35 pub action: Option<String>,
36
37 #[serde(skip_serializing_if = "Option::is_none")]
41 pub author: Option<User>,
42
43 #[serde(skip_serializing_if = "Option::is_none")]
47 pub deleted: Option<bool>,
48
49 #[serde(skip_serializing_if = "Option::is_none")]
51 pub html_content: Option<String>,
52
53 #[serde(skip_serializing_if = "Option::is_none")]
59 pub content: Option<String>,
60}
61
62#[doc(hidden)]
63impl From<&Self> for Reply {
64 fn from( reference: &Self ) -> Self {
65 reference.clone()
66 }
67}
68
69impl fmt::Display for Reply {
70 fn fmt( &self, f: &mut fmt::Formatter<'_> ) -> fmt::Result {
71 let json = serde_json::to_string_pretty(&self)
72 .unwrap_or( format!("unable to parse JSON, this is the debug view:\n{:#?}", self) );
73
74 write!(f, "{}", json)
75 }
76}
77
78impl Reply {
79 pub fn new() -> Self {
81 Self { ..Default::default() }
82 }
83}
84
85#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
87#[serde(rename_all = "camelCase")]
88pub struct ReplyList {
89 #[serde(skip_serializing_if = "Option::is_none")]
97 pub next_page_token: Option<String>,
98
99 #[serde(skip_serializing_if = "Option::is_none")]
103 pub kind: Option<String>,
104
105 #[serde(skip_serializing_if = "Option::is_none")]
111 pub replies: Option<Vec<Reply>>,
112}
113
114impl fmt::Display for ReplyList {
115 fn fmt( &self, f: &mut fmt::Formatter<'_> ) -> fmt::Result {
116 let json = serde_json::to_string_pretty(&self)
117 .unwrap_or( format!("unable to parse JSON, this is the debug view:\n{:#?}", self) );
118
119 write!(f, "{}", json)
120 }
121}
122
123impl ReplyList {
124 pub fn new() -> Self {
126 Self { ..Default::default() }
127 }
128}