Skip to main content

paperless_api/
custom_field.rs

1use serde::{Deserialize, Serialize};
2
3use crate::id::CustomFieldId;
4
5/// Custom field definition.
6#[derive(Debug, Clone, Deserialize)]
7pub struct CustomField {
8    /// Unique identifier of the custom field.
9    pub id: CustomFieldId,
10
11    /// Name of the custom field.
12    pub name: String,
13
14    /// Data type of the custom field.
15    pub data_type: String,
16}
17
18/// Custom field value of an existing document
19#[derive(Debug, Clone, Deserialize, Serialize)]
20pub struct DocumentCustomField {
21    /// Unique identifier of the custom field.
22    pub field: CustomFieldId,
23
24    /// Value of the custom field.
25    pub value: String,
26}