mailboxlib/jsonb/
account_service_settings.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40

use serde::{Deserialize, Serialize};
use uuid::Uuid;

#[derive(Serialize, Deserialize, Debug, Clone, PartialEq)]
#[serde(rename_all = "camelCase")]
pub struct AccountServiceSettings {
    pub imap_server: Option<String>,
    pub pop_server: Option<String>,
    pub smtp_server: Option<String>,
    pub imap_port: Option<i32>,
    pub pop_port: Option<i32>,
    pub smtp_port: i32,
    pub interval: i32,
    pub oauth2_token: Option<String>,
    pub oauth2_refrash_token: Option<String>,
    pub pkce_code_verifier : Option<String>,
    pub state : Option<String>,
    pub exp : Option<i64>,
}
impl AccountServiceSettings {
    pub fn response_settings(
        &self
    )->AccountServiceSettings {
        AccountServiceSettings {
            imap_server: self.imap_server.clone(),
            pop_server: self.pop_server.clone(),
            smtp_server: self.smtp_server.clone(),
            imap_port: self.imap_port.clone(),
            pop_port: self.pop_port,
            smtp_port: self.smtp_port,
            interval: self.interval,
            oauth2_token: self.oauth2_token.clone(),
            oauth2_refrash_token: None,
            pkce_code_verifier: None,
            state: None,
            exp: None,
        }
    }
}