Skip to main content

unitycatalog_server/codegen/agents/
handler.rs

1// @generated — do not edit by hand.
2//! Handler trait for [`AgentHandler`].
3//!
4//! Implement this trait to provide a custom backend for this service, then mount the
5//! generated handler functions (in the sibling `server` module) onto an `axum::Router`
6//! with your implementation as state.
7//!
8//! # Composability
9//!
10//! A single struct can implement multiple handler traits to serve multiple
11//! services. Use [`axum::Router::merge`] to compose per-service routers together.
12//!
13//! Service for managing agents in Unity Catalog.
14//!
15//! Agents are remote invocable services (endpoint + invocation protocol) within a
16//! schema. This is an early-stage (v0alpha1) surface aligned with the Open
17//! Sharing agent community proposal.
18use crate::Result;
19use async_trait::async_trait;
20use unitycatalog_common::models::agents::v0alpha1::*;
21#[async_trait]
22pub trait AgentHandler<Cx = crate::api::RequestContext>: Send + Sync + 'static {
23    /// Lists agents.
24    async fn list_agents(
25        &self,
26        request: ListAgentsRequest,
27        context: Cx,
28    ) -> Result<ListAgentsResponse>;
29    async fn create_agent(&self, request: CreateAgentRequest, context: Cx) -> Result<Agent>;
30    async fn get_agent(&self, request: GetAgentRequest, context: Cx) -> Result<Agent>;
31    async fn update_agent(&self, request: UpdateAgentRequest, context: Cx) -> Result<Agent>;
32    async fn delete_agent(&self, request: DeleteAgentRequest, context: Cx) -> Result<()>;
33}