1#![expect(
2 single_use_lifetimes,
3 reason = "endpoint structs hold Cow<'a, str> for cheap borrowed string parameters; the lifetime appears once in the struct but propagates to every call site"
4)]
5#![expect(
6 clippy::module_name_repetitions,
7 reason = "Redmine REST resource types share their module's name (e.g. ListIssues in api::issues) for self-documenting public re-exports"
8)]
9#![expect(
10 clippy::future_not_send,
11 reason = "the async client is not Send by design; the underlying reqwest::Client is shared via Arc"
12)]
13#![cfg_attr(
14 test,
15 expect(
16 unreachable_pub,
17 clippy::unwrap_used,
18 clippy::panic,
19 clippy::indexing_slicing,
20 clippy::arithmetic_side_effects,
21 clippy::print_stderr,
22 reason = "tests use panicking patterns and helper items idiomatically"
23 )
24)]
25#![doc = include_str!("../README.md")]
26
27pub mod api;
28pub use reqwest;
31
32use thiserror::Error;
33
34#[derive(Debug, Error)]
36pub enum Error {
37 #[error("reqwest error: {0}")]
39 ReqwestError(#[from] reqwest::Error),
40 #[error("error in json serialization/deserialization: {0}")]
42 SerdeJsonError(#[from] serde_json::Error),
43 #[error("error when parsing URL: {0}")]
45 UrlParseError(#[from] url::ParseError),
46 #[error("error when reading environment variables: {0}")]
48 EnvyError(#[from] envy::Error),
49 #[error("empty response body with status: {0}")]
51 EmptyResponseBody(reqwest::StatusCode),
52 #[error("JSON but non-object response body with status: {0}")]
54 NonObjectResponseBody(reqwest::StatusCode),
55 #[error("JSON wrapper pagination key missing: {0}")]
57 PaginationKeyMissing(String),
58 #[error("JSON wrapper pagination key has an unexpected type: {0}")]
60 PaginationKeyHasWrongType(String),
61 #[error("Parsing string {0} to time object failed")]
63 TimeParseError(String, time::error::Parse),
64 #[error("Error when opening or reading file {0} to upload: {1}")]
66 UploadFileError(std::path::PathBuf, std::io::Error),
67 #[error("HTTP Error response: {0}")]
69 HttpErrorResponse(reqwest::StatusCode),
70}