spiral-sdk 0.1.11

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 uuid::Uuid;

use crate::api::locations::objects::*;
/// Service implementations authenticate Authorization headers and enforce resource permissions.
#[async_trait]
pub trait LocationsApi: Send + Sync + 'static {
    /// Create a Location and its initial immutable version. The inventory must be an existing Table
    /// in the Project.
    async fn create_location(
        &self,
        auth_header: AuthHeader,
        request: CreateLocationRequest,
    ) -> Result<CreateLocationResponse, CallError<LocationsError>>;
    /// Create or recover an immutable successor. Use the same caller-allocated version UUIDv7 when
    /// retrying.
    async fn create_version(
        &self,
        auth_header: AuthHeader,
        location_id: Uuid,
        request: CreateVersionRequest,
    ) -> Result<VersionResponse, CallError<LocationsError>>;
    /// Read one exact immutable Location version.
    async fn read_version(
        &self,
        auth_header: AuthHeader,
        location_id: Uuid,
        version_id: Uuid,
    ) -> Result<VersionResponse, CallError<LocationsError>>;
    /// Obtain renewable storage access for one exact Location version.
    async fn storage_binding(
        &self,
        auth_header: AuthHeader,
        location_id: Uuid,
        version_id: Uuid,
    ) -> Result<StorageBinding, CallError<LocationsError>>;
}