Skip to main content

Client

Struct Client 

Source
pub struct Client { /* private fields */ }
Expand description

Client for the UARP platform API.

Cloning is cheap: every clone shares one connection pool.

let client = uarp_sdk::Client::from_env()?;
let page = client.agents().list(&Default::default()).await?;

Implementations§

Source§

impl Client

Source

pub fn new(api_key: impl Into<String>) -> Result<Self>

Build a client for the production endpoint with the given API key.

Source

pub fn from_env() -> Result<Self>

Read the API key from UARP_API_KEY (or SNAGA_API_KEY) and the base URL from UARP_BASE_URL.

Source

pub fn builder() -> ClientBuilder

Source

pub fn base_url(&self) -> &Url

Source

pub fn with_options(&self, options: RequestOptions) -> Client

A clone of this client that applies options to every call made through it. The connection pool is shared, so this is cheap.

Source

pub fn with_idempotency_key(&self, key: impl Into<String>) -> Client

Reuse a specific idempotency key, e.g. to safely replay a create.

Source

pub fn with_timeout(&self, timeout: Duration) -> Client

Source

pub fn with_max_retries(&self, retries: u32) -> Client

Source

pub fn with_header( &self, name: impl Into<String>, value: impl Into<String>, ) -> Client

Add a header to every request made through the returned client.

Source

pub fn with_query( &self, name: impl Into<String>, value: impl Into<String>, ) -> Client

Add a query parameter to every request made through the returned client.

Source

pub fn with_stream_options(&self, stream: StreamOptions) -> Client

Reconnection behaviour for event streams opened through this clone.

Source

pub async fn request_json<Q, B, R>(&self, req: Request<'_, Q, B>) -> Result<R>

Send a request and decode a JSON response body.

Source

pub async fn request_empty<Q, B>(&self, req: Request<'_, Q, B>) -> Result<()>
where Q: Serialize + ?Sized + Sync, B: Serialize + ?Sized + Sync,

Send a request and discard the response body.

Source

pub async fn request_bytes<Q, B>(&self, req: Request<'_, Q, B>) -> Result<Bytes>
where Q: Serialize + ?Sized + Sync, B: Serialize + ?Sized + Sync,

Send a request and return the raw response bytes (file downloads).

Source

pub async fn request_text<Q, B>(&self, req: Request<'_, Q, B>) -> Result<String>
where Q: Serialize + ?Sized + Sync, B: Serialize + ?Sized + Sync,

Send a request and return the response body as text.

Separate from request_json because a text payload is not JSON that happens to be a string: deserialising JSONL or CSS into a String fails, and on the one input where it would succeed — a body that is a single quoted JSON string — it would silently strip the quotes.

Source

pub async fn request_multipart<Q, R, F>( &self, req: Request<'_, Q, ()>, make_form: F, ) -> Result<R>
where Q: Serialize + ?Sized + Sync, R: DeserializeOwned, F: Fn() -> Result<Form> + Send + Sync,

Send a multipart/form-data request. The form is rebuilt for each retry.

Source

pub fn request_stream<Q>( &self, path: &str, query: Option<&Q>, headers: Vec<(&'static str, String)>, ) -> EventStream
where Q: Serialize + ?Sized,

Open a server-sent event stream.

Source

pub async fn raw<R: DeserializeOwned>( &self, method: Method, path: &str, body: Option<&Value>, ) -> Result<R>

Escape hatch for endpoints the generated surface does not cover.

Source§

impl Client

Source

pub fn a2a(&self) -> A2AApi

Agent-to-Agent protocol: discovery and task execution

Source§

impl Client

Source

pub fn acp(&self) -> ACPApi

Agent Communication Protocol bridge sessions

Source§

impl Client

Source

pub fn admin(&self) -> AdminApi

Platform admin: tenants, audit, reconciliation, DLQ, analytics

Source§

impl Client

Source

pub fn admin_config(&self) -> AdminConfigApi

Platform configuration: pricing, plans, feature flags, rate limits, runtime

Source§

impl Client

Source

pub fn agents(&self) -> AgentsApi

Agent CRUD and versioning

Source§

impl Client

Source

pub fn analytics(&self) -> AnalyticsApi

Tenant-scoped usage analytics

Source§

impl Client

Source

pub fn auth(&self) -> AuthApi

User registration and OTP authentication

Source§

impl Client

Source

pub fn billing(&self) -> BillingApi

Usage tracking, quota management, and Stripe webhooks

Source§

impl Client

Source

pub fn bootstrap(&self) -> BootstrapApi

First-time platform setup

Source§

impl Client

Source

pub fn bridge(&self) -> BridgeApi

Local agent bridge for Snaga desktop connections

Source§

impl Client

Source

pub fn canvas(&self) -> CanvasApi

Canvas documents attached to a session

Source§

impl Client

Source

pub fn companies(&self) -> CompaniesApi

Company management

Source§

impl Client

Source

pub fn data_explorer(&self) -> DataExplorerApi

KV data explorer for admin diagnostics

Source§

impl Client

Source

pub fn evaluations(&self) -> EvaluationsApi

Agent evaluation datasets and runs

Source§

impl Client

Source

pub fn feed(&self) -> FeedApi

Activity feed and real-time event streaming

Source§

impl Client

Source

pub fn feedback(&self) -> FeedbackApi

Error reports from any tenant; the inbox is super-admin only

Source§

impl Client

Source

pub fn files(&self) -> FilesApi

File upload for multimodal content

Source§

impl Client

Source

pub fn gdpr(&self) -> GDPRApi

Data subject access and erasure requests

Source§

impl Client

Source

pub fn governance(&self) -> GovernanceApi

Agent governance: constitution, voting, permissions, emergency protocols

Source§

impl Client

Source

pub fn guardrails(&self) -> GuardrailsApi

Guardrail policies

Source§

impl Client

Source

pub fn health(&self) -> HealthApi

Health checks, readiness, and metrics

Source§

impl Client

Source

pub fn integrations(&self) -> IntegrationsApi

OAuth integrations and connector management

Source§

impl Client

Source

pub fn knowledge(&self) -> KnowledgeApi

Knowledge base management

Source§

impl Client

Source

pub fn llm_credentials(&self) -> LLMCredentialsApi

LLM provider API key management

Source§

impl Client

Source

pub fn marketplace(&self) -> MarketplaceApi

Agent marketplace: publish, search, rate

Source§

impl Client

Source

pub fn mcp(&self) -> MCPApi

Model Context Protocol server endpoints

Source§

impl Client

Source

pub fn me(&self) -> MeApi

The calling identity: profile, tenants, head agent

Source§

impl Client

Source

pub fn memory(&self) -> MemoryApi

Agent memory management

Source§

impl Client

Source

pub fn meta(&self) -> MetaApi

API metadata

Source§

impl Client

Source

pub fn missions(&self) -> MissionsApi

Mission Execution Framework: goal → objectives → authorization gate → execution → after-action review

Source§

impl Client

Source

pub fn notifications(&self) -> NotificationsApi

User notifications

Source§

impl Client

Source

pub fn open_ai_compat(&self) -> OpenAiCompatApi

OpenAI-compatible ChatCompletion endpoint

Source§

impl Client

Source

pub fn playground(&self) -> PlaygroundApi

Visual builder and agent playground

Source§

impl Client

Source

pub fn programs(&self) -> ProgramsApi

Program (curriculum) management

Source§

impl Client

Source

pub fn projects(&self) -> ProjectsApi

Projects — a workspace grouping agents, sessions and files

Source§

impl Client

Source

pub fn providers(&self) -> ProvidersApi

LLM provider discovery and model listing

Source§

impl Client

Source

pub fn public(&self) -> PublicApi

Unauthenticated public-facing endpoints

Source§

impl Client

Source

pub fn registry(&self) -> RegistryApi

Spec registry — publish, search, yank, share spec artifacts

Source§

impl Client

Source

pub fn reports(&self) -> ReportsApi

Content reports — abuse/moderation reporting for authenticated users and anonymous public-chat visitors, plus the operator inbox

Source§

impl Client

Source

pub fn runs(&self) -> RunsApi

Agent execution runs, SSE streaming, HITL, continuation

Source§

impl Client

Source

pub fn scheduler(&self) -> SchedulerApi

Cron-based scheduling

Source§

impl Client

Source

pub fn sessions(&self) -> SessionsApi

Conversation sessions

Source§

impl Client

Source

pub fn squads(&self) -> SquadsApi

Squads — multi-agent groups that run a shared brief

Source§

impl Client

Source

pub fn teams(&self) -> TeamsApi

Team management and team chat

Source§

impl Client

Source

pub fn tenants(&self) -> TenantsApi

Tenant management and API keys

Source§

impl Client

Source

pub fn users(&self) -> UsersApi

User management, invites, roles

Source§

impl Client

Source

pub fn webhooks(&self) -> WebhooksApi

Webhook subscriptions

Source§

impl Client

Source

pub fn workspaces(&self) -> WorkspacesApi

Workspace management, file storage, and sharing

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Client

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more