pub struct UserProfile {Show 36 fields
pub id: UserId,
pub username: String,
pub email: String,
pub is_oauth: bool,
pub given_name: String,
pub family_name: String,
pub profile_image: Option<ImageId>,
pub language_app: String,
pub language_emails: String,
pub languages_spoken: Vec<String>,
pub opt_into_edu_resources: bool,
pub over_18: bool,
pub timezone: Tz,
pub bio: String,
pub badge: Option<UserBadge>,
pub location_public: bool,
pub organization_public: bool,
pub persona_public: bool,
pub languages_spoken_public: bool,
pub bio_public: bool,
pub circles: Vec<CircleId>,
pub scopes: Vec<UserScope>,
pub created_at: DateTime<Utc>,
pub updated_at: Option<DateTime<Utc>>,
pub organization: Option<String>,
pub persona: Vec<String>,
pub subjects: Vec<SubjectId>,
pub age_ranges: Vec<AgeRangeId>,
pub affiliations: Vec<AffiliationId>,
pub location: Option<Value>,
pub jig_count: u64,
pub resource_count: u64,
pub course_count: u64,
pub playlist_count: u64,
pub total_asset_count: u64,
pub account_summary: Option<UserAccountSummary>,
}
Expand description
A user’s profile.
Fields§
§id: UserId
The user’s id.
username: String
The user’s username.
email: String
The user’s email address.
is_oauth: bool
Indicator for Oauth email
given_name: String
The user’s given name (first name)
family_name: String
The user’s family name (last name)
profile_image: Option<ImageId>
ID to the user’s profile image in the user image library.
language_app: String
The user’s preferred application language.
language_emails: String
The user’s preferred email language.
languages_spoken: Vec<String>
The user’s preferred language.
opt_into_edu_resources: bool
Does the user want educational resources sent to them?
over_18: bool
Is the user over 18 years old?
timezone: Tz
The user’s timezone.
bio: String
Bio for User
badge: Option<UserBadge>
Badge of User
location_public: bool
Allow location to be public
organization_public: bool
Allow organization to be public
persona_public: bool
Allow persona to be public
languages_spoken_public: bool
Allow languages_spoken to be public
bio_public: bool
Allow bio to be public
circles: Vec<CircleId>
User associated Circles
scopes: Vec<UserScope>
The scopes associated with the user.
created_at: DateTime<Utc>
When the user was created.
updated_at: Option<DateTime<Utc>>
When the user was last updated.
organization: Option<String>
The organization that the user belongs to.
persona: Vec<String>
The persona of the user
subjects: Vec<SubjectId>
The user’s taught subjects.
age_ranges: Vec<AgeRangeId>
The user’s age-ranges.
affiliations: Vec<AffiliationId>
The user’s affiliations.
location: Option<Value>
The user’s location
jig_count: u64
Number of Jigs
resource_count: u64
Number of Resources
course_count: u64
Number of Courses
playlist_count: u64
Number of playlists
total_asset_count: u64
Total number of assets
account_summary: Option<UserAccountSummary>
The user’s account summary, if available.
Note: This is not set when fetching a user profile. It must be explicitly set using a
function such as [db::account::get_user_account_summary()
]
Implementations§
Source§impl UserProfile
impl UserProfile
Sourcepub fn school_or_organization(&self) -> Option<&str>
pub fn school_or_organization(&self) -> Option<&str>
Returns the school or organization associated with this user if any.
Source§impl UserProfile
impl UserProfile
Sourcepub fn display_name(&self) -> String
pub fn display_name(&self) -> String
Returns the display name for UI purposes
Trait Implementations§
Source§impl Clone for UserProfile
impl Clone for UserProfile
Source§fn clone(&self) -> UserProfile
fn clone(&self) -> UserProfile
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more