Skip to main content

unitycatalog_server/codegen/shares/
handler.rs

1// @generated — do not edit by hand.
2//! Handler trait for [`ShareHandler`].
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 shares
14use crate::Result;
15use async_trait::async_trait;
16use unitycatalog_common::models::shares::v1::*;
17#[async_trait]
18pub trait ShareHandler<Cx = crate::api::RequestContext>: Send + Sync + 'static {
19    /// List shares.
20    async fn list_shares(
21        &self,
22        request: ListSharesRequest,
23        context: Cx,
24    ) -> Result<ListSharesResponse>;
25    /// Create a new share.
26    async fn create_share(&self, request: CreateShareRequest, context: Cx) -> Result<Share>;
27    /// Get a share by name.
28    async fn get_share(&self, request: GetShareRequest, context: Cx) -> Result<Share>;
29    /// Update a share.
30    async fn update_share(&self, request: UpdateShareRequest, context: Cx) -> Result<Share>;
31    /// Deletes a share.
32    async fn delete_share(&self, request: DeleteShareRequest, context: Cx) -> Result<()>;
33    /// Gets the permissions for a data share from the metastore.
34    async fn get_permissions(
35        &self,
36        request: GetPermissionsRequest,
37        context: Cx,
38    ) -> Result<GetPermissionsResponse>;
39    /// Updates the permissions for a data share in the metastore.
40    async fn update_permissions(
41        &self,
42        request: UpdatePermissionsRequest,
43        context: Cx,
44    ) -> Result<UpdatePermissionsResponse>;
45}