1#![doc = include_str!("../README.md")]
2
3pub mod client;
4pub mod document;
5pub mod document_query;
6pub mod dto;
7pub mod group;
8pub mod id;
9pub mod metadata;
10pub mod note;
11pub mod saved_view;
12pub mod share_link;
13pub mod share_link_bundle;
14pub mod task;
15pub mod user;
16pub mod util;
17pub mod workflow;
18
19pub use client::{PaperlessClient, RefreshMetaData};
20pub use document::Document;
21pub use document_query::DocumentQuery;
22pub use group::Group;
23pub use saved_view::{CreateSavedView, SavedView};
24pub use share_link::ShareLink;
25pub use task::Task;
26pub use user::User;
27pub use workflow::Workflow;
28
29#[derive(Debug, thiserror::Error)]
30pub enum Error {
31 #[error("response error: status code {status_code}, body: {body}")]
32 Response { status_code: u16, body: String },
33
34 #[error(transparent)]
35 Request(#[from] Box<dyn std::error::Error + Send + Sync + 'static>),
36
37 #[error("other error: {0}")]
38 Other(String),
39
40 #[error("invalid json: {0}")]
41 InvalidJson(String),
42
43 #[error("not found")]
44 NotFound,
45
46 #[error("not changeable")]
47 NotChangeable,
48
49 #[error("already deleted")]
50 AlreadyDeleted,
51}
52
53type Result<T> = std::result::Result<T, Error>;