fastcomments_sdk/sso/simple_sso_user_data.rs
1use serde::{Deserialize, Serialize};
2
3#[derive(Serialize, Deserialize, Default, Clone)]
4pub struct SimpleSSOUserData {
5 /// If you don't set id, it defaults to their email.
6 pub id: Option<String>,
7 /// Their locale, for email notifications etc, in the format "en_us".
8 pub locale: Option<String>,
9 /// Set a non-unique name (since username must be unique within your tenant).
10 pub display_name: Option<String>,
11 /// Show a nice label with their comments, like "VIP User".
12 pub display_label: Option<String>,
13 /// Defaults to true when null.
14 pub is_profile_activity_private: Option<bool>,
15 /// This must be unique when paired with an email.
16 pub username: String,
17 /// The user's email.
18 pub email: String,
19 /// The user's avatar.
20 pub avatar: String,
21 /// The user's website, blog, or personal account page to show with their comments.
22 pub website_url: Option<String>,
23}
24
25impl SimpleSSOUserData {
26 pub fn new(
27 username: String,
28 email: String,
29 avatar: String,
30 ) -> SimpleSSOUserData {
31 SimpleSSOUserData {
32 username,
33 email,
34 avatar,
35 ..Default::default()
36 }
37 }
38}