use std::str::FromStr;
pub mod api_key;
pub mod audit_log;
pub mod dashboard;
pub mod init;
pub mod logs;
pub mod run;
pub mod schedule;
pub mod secret;
pub mod stats;
pub mod template;
pub mod user;
pub mod workflow;
pub(crate) fn parse_enum<T: FromStr + ToString>(
raw: &str,
accepted: &[T],
noun: &str,
) -> Result<T, String> {
T::from_str(raw).map_err(|_| {
let accepted: Vec<String> = accepted.iter().map(ToString::to_string).collect();
format!("unknown {noun} '{raw}'; accepted: {}", accepted.join(", "))
})
}