use crate::common::ApiState;
use crate::common::{ApiError, ApiResult, Json, State};
use std::collections::HashMap;
#[utoipa::path(
get,
path = "/v1/input/vision",
tag = "input",
responses(
(status = 200, description = "Vision input configuration", body = HashMap<String, serde_json::Value>),
(status = 500, description = "Internal server error")
)
)]
pub async fn get_vision(
State(_state): State<ApiState>,
) -> ApiResult<Json<HashMap<String, serde_json::Value>>> {
Ok(Json(HashMap::new()))
}
#[utoipa::path(
post,
path = "/v1/input/vision",
tag = "input",
responses(
(status = 200, description = "Vision input updated", content_type = "application/json"),
(status = 500, description = "Not yet implemented")
)
)]
pub async fn post_vision(
State(_state): State<ApiState>,
Json(_req): Json<HashMap<String, serde_json::Value>>,
) -> ApiResult<Json<HashMap<String, String>>> {
Err(ApiError::internal("Not yet implemented"))
}
#[utoipa::path(get, path = "/v1/input/sources", tag = "input")]
pub async fn get_sources(State(_state): State<ApiState>) -> ApiResult<Json<Vec<String>>> {
Ok(Json(vec!["vision".to_string()]))
}
#[utoipa::path(post, path = "/v1/input/configure", tag = "input")]
pub async fn post_configure(
State(_state): State<ApiState>,
Json(_req): Json<HashMap<String, serde_json::Value>>,
) -> ApiResult<Json<HashMap<String, String>>> {
Ok(Json(HashMap::from([(
"message".to_string(),
"Input configured".to_string(),
)])))
}