cencori 1.4.0

Official Rust SDK for Cencori - AI Infrastructure for Production
Documentation
//! Project management requires a future, separately scoped management credential.

use std::sync::Arc;

use crate::client::InnerClient;
use crate::error::CencoriError;
use crate::types::{CreateProjectParams, Project};

const MANAGEMENT_AUTH_ERROR: &str =
    "Project management is not available with a project API key. Use the Cencori dashboard until a separately scoped management credential is supported.";

#[derive(Debug, Clone)]
pub struct ProjectsModule {
    _inner: Arc<InnerClient>,
}

impl ProjectsModule {
    pub(crate) fn new(inner: Arc<InnerClient>) -> Self {
        Self { _inner: inner }
    }

    fn unsupported<T>() -> Result<T, CencoriError> {
        Err(CencoriError::NotImplemented(MANAGEMENT_AUTH_ERROR.into()))
    }

    pub fn list(&self, _org_slug: &str) -> Result<Vec<Project>, CencoriError> {
        Self::unsupported()
    }

    pub fn create(
        &self,
        _org_slug: &str,
        _params: &CreateProjectParams,
    ) -> Result<Project, CencoriError> {
        Self::unsupported()
    }

    pub fn get(&self, _org_slug: &str, _project_slug: &str) -> Result<Project, CencoriError> {
        Self::unsupported()
    }

    pub fn update(
        &self,
        _org_slug: &str,
        _project_slug: &str,
        _params: &CreateProjectParams,
    ) -> Result<(), CencoriError> {
        Self::unsupported()
    }

    pub fn delete(&self, _org_slug: &str, _project_slug: &str) -> Result<(), CencoriError> {
        Self::unsupported()
    }
}