Skip to main content

gmail/model/
get_profile_response.rs

1use serde::{Serialize, Deserialize};
2///Profile for a Gmail user.
3#[derive(Debug, Clone, Serialize, Deserialize, Default)]
4pub struct GetProfileResponse {
5    ///The user's email address.
6    #[serde(rename = "emailAddress")]
7    #[serde(default, skip_serializing_if = "Option::is_none")]
8    pub email_address: Option<String>,
9    ///The ID of the mailbox's current history record.
10    #[serde(rename = "historyId")]
11    #[serde(default, skip_serializing_if = "Option::is_none")]
12    pub history_id: Option<String>,
13    ///The total number of messages in the mailbox.
14    #[serde(rename = "messagesTotal")]
15    #[serde(default, skip_serializing_if = "Option::is_none")]
16    pub messages_total: Option<i64>,
17    ///The total number of threads in the mailbox.
18    #[serde(rename = "threadsTotal")]
19    #[serde(default, skip_serializing_if = "Option::is_none")]
20    pub threads_total: Option<i64>,
21}
22impl std::fmt::Display for GetProfileResponse {
23    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> Result<(), std::fmt::Error> {
24        write!(f, "{}", serde_json::to_string(self).unwrap())
25    }
26}