1 //! All kinds of user object 2 3 use serde::{Deserialize, Serialize}; 4 5 use std::collections::HashMap; 6 7 use crate::{Country, Followers, Image, SubscriptionLevel, UserId}; 8 9 /// Public user object 10 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] 11 pub struct PublicUser { 12 pub display_name: Option<String>, 13 pub external_urls: HashMap<String, String>, 14 pub followers: Option<Followers>, 15 pub href: String, 16 pub id: UserId, 17 #[serde(default = "Vec::new")] 18 pub images: Vec<Image>, 19 } 20 21 /// Private user object 22 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)] 23 pub struct PrivateUser { 24 pub country: Option<Country>, 25 pub display_name: Option<String>, 26 pub email: Option<String>, 27 pub external_urls: HashMap<String, String>, 28 pub explicit_content: Option<ExplicitContent>, 29 pub followers: Option<Followers>, 30 pub href: String, 31 pub id: UserId, 32 pub images: Option<Vec<Image>>, 33 pub product: Option<SubscriptionLevel>, 34 } 35 36 /// Explicit content setting object 37 #[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, Default)] 38 pub struct ExplicitContent { 39 pub filter_enabled: bool, 40 pub filter_locked: bool, 41 } 42