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
66
67
68
69
70
71
72
73
74
75
76
use std::collections::HashMap;
use serde::{Deserialize, Serialize};
use serde_json::Value;
use super::{preferences::Preferences, target::Target};
/// User
#[derive(Debug, Serialize, Deserialize, Clone, Default, PartialEq)]
pub struct User {
/// User ID.
#[serde(rename = "$id")]
pub id: String,
/// User creation date in ISO 8601 format.
#[serde(rename = "$createdAt")]
pub created_at: String,
/// User update date in ISO 8601 format.
#[serde(rename = "$updatedAt")]
pub updated_at: String,
/// User name.
pub name: String,
/// Hashed user password.
pub password: Option<String>,
/// Password hashing algorithm.
pub hash: Option<String>,
/// Password hashing algorithm configuration.
#[serde(rename = "hashOptions")]
pub hash_options: Option<HashMap<String, Value>>,
/// User registration date in ISO 8601 format.
pub registration: String,
/// User status. Pass `true` for enabled and `false` for disabled.
pub status: bool,
/// Labels for the user.
pub labels: Vec<Value>,
/// Password update time in ISO 8601 format.
#[serde(rename = "passwordUpdate")]
pub password_update: String,
/// User email address.
pub email: String,
/// User phone number in E.164 format.
pub phone: String,
/// Email verification status.
#[serde(rename = "emailVerification")]
pub email_verification: bool,
/// Phone verification status.
#[serde(rename = "phoneVerification")]
pub phone_verification: bool,
/// Multi factor authentication status.
pub mfa: Option<bool>,
/// User preferences as a key-value object
#[serde(rename = "prefs")]
pub preferences: Preferences,
/// A user-owned message receiver. A single user may have multiple e.g. emails, phones, and a browser. Each target is registered with a single provider.
pub targets: Option<Vec<Target>>,
/// Most recent access date in ISO 8601 format. This attribute is only updated again after 24 hours.
#[serde(rename = "accessedAt")]
pub accessed_at: String,
}