Expand description
Async Rust client for the UARP (Snaga) Universal Agent Runtime Platform.
use futures_util::StreamExt;
#[tokio::main]
async fn main() -> Result<(), uarp_sdk::Error> {
let client = uarp_sdk::Client::from_env()?;
let agents = client.agents();
let params = uarp_sdk::api::ListAgentsParams { limit: Some(50), ..Default::default() };
// Every item across every page.
let mut all = std::pin::pin!(agents.list_all(¶ms));
while let Some(agent) = all.next().await {
println!("{:?}", agent?.name);
}
Ok(())
}The API surface under api is generated from spec/openapi.json; the
transport, error, pagination and SSE layers are hand-written.
Modules§
- api
- One module per OpenAPI tag, each with its own
*Apiaccessor onClient. - models
- Data models for UARP — Universal Agent Runtime Platform (spec version 0.4.0).
Structs§
- ApiError
- A non-2xx response, with the parsed problem document attached.
- Client
- Client for the UARP platform API.
- Client
Builder - Fluent configuration for
Client. - Event
- One decoded
text/event-streamframe. - Event
Stream - A live SSE stream.
- Field
Error - File
Part - A file to upload.
datais sent verbatim as the part body. - Problem
- RFC 9457 problem document returned by the API on failure.
- Request
- What a generated method hands to the transport.
- Request
Options - Per-call overrides.
- Stream
Options - Reconnection and lifecycle behaviour for
EventStream. Every field defaults to a generic, spec-compliant SSE stream; the platform-specific knobs (terminal events, an inactivity watchdog,retry:pacing) are opt-in so a caller that passesDefault::defaultgets standard SSE.
Enums§
- ApiError
Kind - A coarse classification of an
ApiError, convenient formatch. - Error
- Everything that can go wrong while talking to the platform.
- Stream
State - Connection-lifecycle states reported by
EventStreamviaStreamOptions::on_state.
Constants§
- DEFAULT_
BASE_ URL - Production base URL.
- NO_BODY
- Placeholder for “this request has no body”.
- NO_
QUERY - Placeholder for “this request has no query string”.
- SCOPES
- Every scope named by the UARP security scheme.
- SPEC_
VERSION - Version of the OpenAPI document this SDK was generated from.
- VERSION
- The version of this crate.