Skip to main content

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)]
8pub struct User {
9    /// Unique identifier of the user.
10    #[dto(skip)]
11    pub id: crate::id::UserId,
12
13    /// Username.
14    pub username: String,
15
16    /// Email address.
17    pub email: String,
18
19    /// First name of the user.
20    pub first_name: String,
21
22    /// Last name of the user.
23    pub last_name: String,
24
25    /// Whether the user is a superuser.
26    pub is_superuser: bool,
27
28    /// Whether the user is a staff member.
29    pub is_staff: bool,
30
31    /// Whether the user is active.
32    pub is_active: bool,
33
34    /// Groups the user belongs to.
35    pub groups: Vec<crate::id::GroupId>,
36}