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
impl Client
Sourcepub fn new(api_key: impl Into<String>) -> Result<Self>
pub fn new(api_key: impl Into<String>) -> Result<Self>
Build a client for the production endpoint with the given API key.
Sourcepub fn from_env() -> Result<Self>
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.
pub fn builder() -> ClientBuilder
pub fn base_url(&self) -> &Url
Sourcepub fn with_options(&self, options: RequestOptions) -> Client
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.
Sourcepub fn with_idempotency_key(&self, key: impl Into<String>) -> Client
pub fn with_idempotency_key(&self, key: impl Into<String>) -> Client
Reuse a specific idempotency key, e.g. to safely replay a create.
pub fn with_timeout(&self, timeout: Duration) -> Client
pub fn with_max_retries(&self, retries: u32) -> Client
Sourcepub fn with_header(
&self,
name: impl Into<String>,
value: impl Into<String>,
) -> Client
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.
Sourcepub fn with_query(
&self,
name: impl Into<String>,
value: impl Into<String>,
) -> Client
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.
Sourcepub fn with_stream_options(&self, stream: StreamOptions) -> Client
pub fn with_stream_options(&self, stream: StreamOptions) -> Client
Reconnection behaviour for event streams opened through this clone.
Sourcepub async fn request_json<Q, B, R>(&self, req: Request<'_, Q, B>) -> Result<R>
pub async fn request_json<Q, B, R>(&self, req: Request<'_, Q, B>) -> Result<R>
Send a request and decode a JSON response body.
Sourcepub async fn request_empty<Q, B>(&self, req: Request<'_, Q, B>) -> Result<()>
pub async fn request_empty<Q, B>(&self, req: Request<'_, Q, B>) -> Result<()>
Send a request and discard the response body.
Sourcepub async fn request_bytes<Q, B>(&self, req: Request<'_, Q, B>) -> Result<Bytes>
pub async fn request_bytes<Q, B>(&self, req: Request<'_, Q, B>) -> Result<Bytes>
Send a request and return the raw response bytes (file downloads).
Sourcepub async fn request_text<Q, B>(&self, req: Request<'_, Q, B>) -> Result<String>
pub async fn request_text<Q, B>(&self, req: Request<'_, Q, B>) -> Result<String>
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.
Sourcepub async fn request_multipart<Q, R, F>(
&self,
req: Request<'_, Q, ()>,
make_form: F,
) -> Result<R>
pub async fn request_multipart<Q, R, F>( &self, req: Request<'_, Q, ()>, make_form: F, ) -> Result<R>
Send a multipart/form-data request. The form is rebuilt for each retry.
Sourcepub fn request_stream<Q>(
&self,
path: &str,
query: Option<&Q>,
headers: Vec<(&'static str, String)>,
) -> EventStream
pub fn request_stream<Q>( &self, path: &str, query: Option<&Q>, headers: Vec<(&'static str, String)>, ) -> EventStream
Open a server-sent event stream.
Source§impl Client
impl Client
Sourcepub fn admin_config(&self) -> AdminConfigApi
pub fn admin_config(&self) -> AdminConfigApi
Platform configuration: pricing, plans, feature flags, rate limits, runtime
Source§impl Client
impl Client
Sourcepub fn billing(&self) -> BillingApi
pub fn billing(&self) -> BillingApi
Usage tracking, quota management, and Stripe webhooks
Source§impl Client
impl Client
Sourcepub fn data_explorer(&self) -> DataExplorerApi
pub fn data_explorer(&self) -> DataExplorerApi
KV data explorer for admin diagnostics
Source§impl Client
impl Client
Sourcepub fn evaluations(&self) -> EvaluationsApi
pub fn evaluations(&self) -> EvaluationsApi
Agent evaluation datasets and runs
Source§impl Client
impl Client
Sourcepub fn feedback(&self) -> FeedbackApi
pub fn feedback(&self) -> FeedbackApi
Error reports from any tenant; the inbox is super-admin only
Source§impl Client
impl Client
Sourcepub fn governance(&self) -> GovernanceApi
pub fn governance(&self) -> GovernanceApi
Agent governance: constitution, voting, permissions, emergency protocols
Source§impl Client
impl Client
Sourcepub fn guardrails(&self) -> GuardrailsApi
pub fn guardrails(&self) -> GuardrailsApi
Guardrail policies
Source§impl Client
impl Client
Sourcepub fn integrations(&self) -> IntegrationsApi
pub fn integrations(&self) -> IntegrationsApi
OAuth integrations and connector management
Source§impl Client
impl Client
Sourcepub fn llm_credentials(&self) -> LLMCredentialsApi
pub fn llm_credentials(&self) -> LLMCredentialsApi
LLM provider API key management
Source§impl Client
impl Client
Sourcepub fn marketplace(&self) -> MarketplaceApi
pub fn marketplace(&self) -> MarketplaceApi
Agent marketplace: publish, search, rate
Source§impl Client
impl Client
Sourcepub fn missions(&self) -> MissionsApi
pub fn missions(&self) -> MissionsApi
Mission Execution Framework: goal → objectives → authorization gate → execution → after-action review
Source§impl Client
impl Client
Sourcepub fn notifications(&self) -> NotificationsApi
pub fn notifications(&self) -> NotificationsApi
User notifications
Source§impl Client
impl Client
Sourcepub fn open_ai_compat(&self) -> OpenAiCompatApi
pub fn open_ai_compat(&self) -> OpenAiCompatApi
OpenAI-compatible ChatCompletion endpoint
Source§impl Client
impl Client
Sourcepub fn playground(&self) -> PlaygroundApi
pub fn playground(&self) -> PlaygroundApi
Visual builder and agent playground
Source§impl Client
impl Client
Sourcepub fn projects(&self) -> ProjectsApi
pub fn projects(&self) -> ProjectsApi
Projects — a workspace grouping agents, sessions and files
Source§impl Client
impl Client
Sourcepub fn providers(&self) -> ProvidersApi
pub fn providers(&self) -> ProvidersApi
LLM provider discovery and model listing
Source§impl Client
impl Client
Sourcepub fn registry(&self) -> RegistryApi
pub fn registry(&self) -> RegistryApi
Spec registry — publish, search, yank, share spec artifacts
Source§impl Client
impl Client
Sourcepub fn reports(&self) -> ReportsApi
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
impl Client
Sourcepub fn workspaces(&self) -> WorkspacesApi
pub fn workspaces(&self) -> WorkspacesApi
Workspace management, file storage, and sharing