Skip to main content

paperless_api/
lib.rs

1pub mod client;
2pub mod correspondent;
3pub mod custom_field;
4pub mod document;
5pub mod document_type;
6pub mod tag;
7pub mod task;
8
9pub use client::{PaperlessClient, RefreshData};
10pub use custom_field::{CustomField, DocumentCustomField};
11pub use document::Document;
12pub use tag::Tag;
13pub use task::Task;
14
15#[derive(Debug, thiserror::Error)]
16pub enum Error {
17    #[error("response error: status code {status_code}, body: {body}")]
18    Response { status_code: u16, body: String },
19
20    #[error(transparent)]
21    Request(#[from] Box<dyn std::error::Error + Send + Sync + 'static>),
22
23    #[error("other error: {0}")]
24    Other(String),
25
26    #[error("invalid json: {0}")]
27    InvalidJson(String),
28
29    #[error("not found")]
30    NotFound,
31
32    #[error("not changeable")]
33    NotChangeable,
34}
35
36type Result<T> = std::result::Result<T, Error>;