notra 0.1.1

Unofficial Rust SDK for the Notra API
Documentation
use serde::Deserialize;

pub type Result<T> = std::result::Result<T, NotraError>;

#[derive(Debug, thiserror::Error)]
pub enum NotraError {
    #[error("HTTP request failed: {0}")]
    Http(#[from] reqwest::Error),

    #[error("API error ({status}): {message}")]
    Api {
        status: u16,
        message: String,
    },

    #[error("failed to build client: {0}")]
    Builder(String),
}

#[derive(Debug, Deserialize)]
pub struct ErrorResponse {
    pub message: Option<String>,
    pub code: Option<String>,
    pub details: Option<serde_json::Value>,
}