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