fundaia 0.52.3

Command line for the Fundaia deployment platform: projects, services, variables, deployments, logs and metrics
use super::*;

impl ApiClient {
    pub async fn previews(&self, project_id: &str) -> Result<Answer<PreviewStatus>> {
        self.get_answer(&format!("/api/infra/projects/{project_id}/previews"))
            .await
    }

    pub async fn set_previews(
        &self,
        project_id: &str,
        enabled: bool,
    ) -> Result<Answer<PreviewStatus>> {
        self.answer(
            Method::PUT,
            &format!("/api/infra/projects/{project_id}/previews"),
            Some(&serde_json::json!({ "enabled": enabled })),
        )
        .await
    }
}