lit_node_core/models/
auth_method.rs

1use serde::{Deserialize, Serialize};
2
3#[cfg(not(test))]
4use std::fmt::{self, Debug, Display, Formatter};
5
6#[derive(Serialize, Deserialize, Clone, Default)]
7#[cfg_attr(test, derive(Debug))]
8#[serde(rename_all = "camelCase")]
9pub struct AuthMethod {
10    pub auth_method_type: u32,
11    pub access_token: String,
12}
13
14#[cfg(not(test))]
15impl Debug for AuthMethod {
16    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
17        f.debug_struct("AuthMethod")
18            .field("auth_method_type", &self.auth_method_type)
19            .field("access_token", &"****filtered****")
20            .finish()
21    }
22}
23
24#[cfg(not(test))]
25impl Display for AuthMethod {
26    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
27        write!(
28            f,
29            "AuthMethod {{ auth_method_type: {}, access_token: ****filtered**** }}",
30            self.auth_method_type
31        )
32    }
33}