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
//! User
use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};
/// User identity.
#[derive(Serialize, Deserialize, Debug)]
pub struct Identity {
provider: String,
#[serde(rename = "isSocial")]
is_social: bool,
connection: String,
}
/// User
#[derive(Deserialize, Debug)]
pub struct User<AppMetadata, UserMetadata> {
/// ID of the user which can be used when interacting with other APIs.
pub user_id: String,
/// Email address of this user.
pub email: String,
/// Whether this email address is verified (true) or unverified (false).
pub email_verified: bool,
/// Username of this user.
pub username: Option<String>,
/// Phone number for this user when using SMS connections.
/// [Follows the E.164 recommendation.](https://en.wikipedia.org/wiki/E.164)
pub phone_number: Option<String>,
/// Whether this phone number has been verified (true) or not (false).
#[serde(default)]
pub phone_verified: bool,
/// Date and time when this user was created.
pub created_at: DateTime<Utc>,
/// Date and time when this user was last updated/modified.
pub updated_at: DateTime<Utc>,
/// Array of user identity objects when accounts are linked.
pub identities: Vec<Identity>,
/// URL to picture, photo, or avatar of this user.
pub picture: String,
/// Name of this user.
pub name: String,
/// Preferred nickname or alias of this user.
pub nickname: String,
/// List of multi-factor authentication providers with which this user has enrolled.
pub multifactor: Option<Vec<String>>,
/// Last IP address from which this user logged in.
pub last_ip: Option<String>,
/// Last date and time this user logged in.
pub last_login: Option<DateTime<Utc>>,
/// Total number of logins this user has performed.
#[serde(default)]
pub logins_count: u32,
/// Whether this user was blocked by an administrator (true) or is not (false).
#[serde(default)]
pub blocked: bool,
/// Given name/first name/forename of this user.
pub given_name: Option<String>,
/// Family name/last name/surname of this user.
pub family_name: Option<String>,
/// User metadata to which this user has read-only access.
pub app_metadata: Option<AppMetadata>,
/// User metadata to which this user has read/write access.
pub user_metadata: Option<UserMetadata>,
}