1use serde::{Deserialize, Serialize};
2use uuid::Uuid;
3
4use crate::{context::Context, error::Result, team::Team};
5
6#[derive(Debug, Deserialize, PartialEq, Serialize)]
7#[serde(rename_all = "camelCase")]
8pub struct User {
9 pub id: Uuid,
10 pub name: String,
11 pub email: Option<String>,
12 pub user_path: String,
13 pub photo: String,
14 pub teams: Vec<Team>,
15}
16
17impl User {
18 pub async fn me(context: &Context) -> Result<User> {
19 context.get("me").await
20 }
21}
22
23#[derive(Debug, Deserialize, PartialEq, Serialize)]
24#[serde(rename_all = "camelCase")]
25pub struct SimplifiedUser {
26 name: String,
27 photo: String,
28 biography: Option<String>,
29 user_path: String,
30}