Skip to main content

paperless_api/
document_type.rs

1use serde::{Deserialize, Serialize};
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Deserialize, Serialize)]
4#[repr(transparent)]
5pub struct DocumentTypeId(pub i32);
6
7#[derive(Debug, Clone, Deserialize)]
8pub struct DocumentType {
9    pub id: DocumentTypeId,
10    pub slug: String,
11    pub name: String,
12
13    pub is_insensitive: Option<bool>,
14    pub document_count: u32,
15    pub owner: Option<i32>,
16    pub user_can_change: bool,
17}
18
19impl std::fmt::Display for DocumentTypeId {
20    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
21        write!(f, "{}", self.0)
22    }
23}