reasoninglayer 1.0.3

Rust client SDK for the Reasoning Layer API
Documentation
//! Sort-driven UI descriptor operations.

use crate::error::Error;
use crate::http::HttpClient;
use crate::types::common::RequestOptions;
use crate::api_spec::{
    UiActionRequest, UiActionResponse, UiCatalogResponse, UiDescribeRequest, UiDescribeResponse,
};

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

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

    pub async fn describe(
        &self,
        request: UiDescribeRequest,
        options: Option<&RequestOptions>,
    ) -> Result<UiDescribeResponse, Error> {
        self.http.post("/ui/describe", &request, options).await
    }

    pub async fn execute_action(
        &self,
        request: UiActionRequest,
        options: Option<&RequestOptions>,
    ) -> Result<UiActionResponse, Error> {
        self.http.post("/ui/action", &request, options).await
    }

    pub async fn catalog(
        &self,
        options: Option<&RequestOptions>,
    ) -> Result<UiCatalogResponse, Error> {
        self.http.get("/ui/catalog", None, options).await
    }
}