reasoninglayer 0.1.1

Rust client SDK for the Reasoning Layer API
Documentation
//! Health check operations.

use crate::error::Error;
use crate::http::HttpClient;
use crate::types::common::RequestOptions;
use crate::types::health::EnrichedHealthResponse;

#[derive(Debug, Clone)]
pub struct HealthClient {
    http: HttpClient,
}

impl HealthClient {
    pub(crate) fn new(http: HttpClient) -> Self {
        Self { http }
    }

    /// Check the health of the backend (enriched response with component statuses + build info).
    pub async fn check(
        &self,
        options: Option<&RequestOptions>,
    ) -> Result<EnrichedHealthResponse, Error> {
        self.http.get("/health", None, options).await
    }

    /// Liveness probe.
    pub async fn live(&self, options: Option<&RequestOptions>) -> Result<serde_json::Value, Error> {
        self.http.get("/live", None, options).await
    }

    /// Readiness probe.
    pub async fn ready(
        &self,
        options: Option<&RequestOptions>,
    ) -> Result<serde_json::Value, Error> {
        self.http.get("/ready", None, options).await
    }
}