unitycatalog_server/codegen/recipients/handler.rs
1// @generated — do not edit by hand.
2//! Handler trait for [`RecipientHandler`].
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//! Recipients
14//!
15//! A recipient is an object you create using recipients/create to represent an organization which
16//! you want to allow access shares. when you create a recipient object, Unity Catalog generates an
17//! activation link you can send to the recipient. The recipient follows the activation link to download
18//! the credential file, and then uses the credential file to establish a secure connection to receive
19//! the shared data. This sharing mode is called open sharing.
20use crate::Result;
21use async_trait::async_trait;
22use unitycatalog_common::models::recipients::v1::*;
23#[async_trait]
24pub trait RecipientHandler<Cx = crate::api::RequestContext>: Send + Sync + 'static {
25 /// List recipients.
26 async fn list_recipients(
27 &self,
28 request: ListRecipientsRequest,
29 context: Cx,
30 ) -> Result<ListRecipientsResponse>;
31 /// Create a new recipient.
32 async fn create_recipient(
33 &self,
34 request: CreateRecipientRequest,
35 context: Cx,
36 ) -> Result<Recipient>;
37 /// Get a recipient by name.
38 async fn get_recipient(&self, request: GetRecipientRequest, context: Cx) -> Result<Recipient>;
39 /// Update a recipient.
40 async fn update_recipient(
41 &self,
42 request: UpdateRecipientRequest,
43 context: Cx,
44 ) -> Result<Recipient>;
45 /// Delete a recipient.
46 async fn delete_recipient(&self, request: DeleteRecipientRequest, context: Cx) -> Result<()>;
47}