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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
pub mod create_or_modify;
pub mod get_details;
pub mod is_user_admin;
pub mod list_joined_rooms;
pub mod list_users;
pub mod reset_password;
use crate::serde::boolean_as_uint;
use ruma::{thirdparty::ThirdPartyIdentifier, SecondsSinceUnixEpoch};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Clone, Debug)]
pub struct UserDetails {
pub name: String,
pub password_hash: String,
#[serde(with = "boolean_as_uint")]
pub is_guest: bool,
#[serde(with = "boolean_as_uint")]
pub admin: bool,
#[serde(skip_serializing_if = "Option::is_none")]
pub consent_version: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub consent_server_notice_sent: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub appservice_id: Option<String>,
pub creation_ts: Option<SecondsSinceUnixEpoch>,
#[serde(skip_serializing_if = "Option::is_none")]
pub user_type: Option<String>,
#[serde(with = "boolean_as_uint")]
pub deactivated: bool,
pub displayname: String,
#[serde(skip_serializing_if = "Option::is_none")]
pub avatar_url: Option<String>,
#[serde(default, skip_serializing_if = "Vec::is_empty")]
pub threepids: Vec<ThirdPartyIdentifier>,
}