spiral-sdk 0.1.7

Rust SDK for Spiral resource and table APIs
Documentation
// Generated by tools/service-contracts/rust.py. Do not edit.
#![doc = "Transport-independent service interface for local and remote calls."]

use async_trait::async_trait;
use spiral_contract::auth::AuthHeader;
use spiral_contract::call::CallError;

use crate::api::project::objects::*;
/// Service implementations authenticate Authorization headers and enforce resource permissions.
#[async_trait]
pub trait ProjectApi: Send + Sync + 'static {
    /// Create a Project with the same provisioning and default grants as the legacy API. Requires
    /// Organization create-project permission.
    async fn create_project(
        &self,
        auth_header: AuthHeader,
        request: CreateProjectRequest,
    ) -> Result<CreateProjectResponse, CallError<ProjectError>>;
    /// Drop a Project with Project drop permission. Existing resource guards must permit deletion.
    async fn delete_project(
        &self,
        auth_header: AuthHeader,
        project_id: String,
    ) -> Result<(), CallError<ProjectError>>;
    /// List Projects the caller can access, ordered by Project ID. Authorization is evaluated for
    /// every page.
    async fn list_projects(
        &self,
        auth_header: AuthHeader,
        request: ListProjectsRequest,
    ) -> Result<ProjectPage, CallError<ProjectError>>;
    /// Read shared presentation state with Project view permission.
    async fn read_presentation(
        &self,
        auth_header: AuthHeader,
        project_id: String,
        request: PresentationKey,
    ) -> Result<Presentation, CallError<ProjectError>>;
    /// Read a Project with Project view permission.
    async fn read_project(
        &self,
        auth_header: AuthHeader,
        project_id: String,
    ) -> Result<Project, CallError<ProjectError>>;
    /// Save shared presentation state with Catalog publish permission. An outdated revision returns
    /// Conflict.
    async fn save_presentation(
        &self,
        auth_header: AuthHeader,
        project_id: String,
        request: SavePresentation,
    ) -> Result<Presentation, CallError<ProjectError>>;
}