paperless_api/user.rs
1//! Types related to users.
2
3use paperless_api_macros::{CreateDto, Item, UpdateDto};
4use serde::Deserialize;
5
6/// A paperless user.
7#[derive(Debug, Clone, Deserialize, CreateDto, UpdateDto, Item)]
8#[api_info(endpoint = "users")]
9pub struct User {
10 /// Unique identifier of the user.
11 #[dto(skip)]
12 pub id: crate::id::UserId,
13
14 /// Username.
15 pub username: String,
16
17 /// Email address.
18 pub email: String,
19
20 /// First name of the user.
21 pub first_name: String,
22
23 /// Last name of the user.
24 pub last_name: String,
25
26 /// Whether the user is a superuser.
27 pub is_superuser: bool,
28
29 /// Whether the user is a staff member.
30 pub is_staff: bool,
31
32 /// Whether the user is active.
33 pub is_active: bool,
34
35 /// Groups the user belongs to.
36 pub groups: Vec<crate::id::GroupId>,
37}