use crate::client::HttpClient;
use crate::error::Result;
use crate::output::{OutputFormat, output_success};

pub async fn queue(client: &HttpClient, output_format: OutputFormat, compact: bool) -> Result<()> {
    let response: serde_json::Value = client.get("/api/v1/observer/queue", &[]).await?;
    output_success(&response, output_format, compact);
    Ok(())
}

pub async fn vikingdb(
    client: &HttpClient,
    output_format: OutputFormat,
    compact: bool,
) -> Result<()> {
    let response: serde_json::Value = client.get("/api/v1/observer/vikingdb", &[]).await?;
    output_success(&response, output_format, compact);
    Ok(())
}

pub async fn retrieval(
    client: &HttpClient,
    output_format: OutputFormat,
    compact: bool,
) -> Result<()> {
    let response: serde_json::Value = client.get("/api/v1/observer/retrieval", &[]).await?;
    output_success(&response, output_format, compact);
    Ok(())
}

pub async fn filesystem(
    client: &HttpClient,
    output_format: OutputFormat,
    compact: bool,
) -> Result<()> {
    let response: serde_json::Value = client.get("/api/v1/observer/filesystem", &[]).await?;
    output_success(&response, output_format, compact);
    Ok(())
}

pub async fn system(client: &HttpClient, output_format: OutputFormat, compact: bool) -> Result<()> {
    let response: serde_json::Value = client.get("/api/v1/observer/system", &[]).await?;
    output_success(&response, output_format, compact);
    Ok(())
}

pub async fn models(client: &HttpClient, output_format: OutputFormat, compact: bool) -> Result<()> {
    let response: serde_json::Value = client.get("/api/v1/observer/models", &[]).await?;
    output_success(&response, output_format, compact);
    Ok(())
}
