1use serde::{Deserialize, Serialize};
5use thiserror::Error;
6
7#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
8pub struct ProblemDetails {
9 pub title: Option<String>,
10 pub status: Option<u16>,
11 pub detail: Option<String>,
12 pub trace: Option<String>,
13}
14
15#[derive(Debug, Error)]
16pub enum RbacApiClientError {
17 #[error("request failed: {0}")]
18 Http(#[from] reqwest::Error),
19 #[error("server returned problem response")]
20 Problem(ProblemDetails),
21 #[error("transport error: {0}")]
22 Transport(String),
23 #[error("invalid client configuration: {0}")]
24 Configuration(String),
25 #[error("serialization error: {0}")]
26 Serialization(String),
27}