use printobserver_printer_api::{
Adjustable, FileFacts, FilePrint, HeaterSnapshot, JobSnapshot, PrinterSnapshot, PrinterState,
ToolFilament,
};
use printobserver_types::contract::TypeContract;
pub fn declared() -> Vec<TypeContract> {
vec![
TypeContract::of::<Adjustable>("Adjustable"),
TypeContract::of::<FileFacts>("FileFacts"),
TypeContract::of::<FilePrint>("FilePrint"),
TypeContract::of::<HeaterSnapshot>("HeaterSnapshot"),
TypeContract::of::<JobSnapshot>("JobSnapshot"),
TypeContract::of::<PrinterSnapshot>("PrinterSnapshot"),
TypeContract::of::<PrinterState>("PrinterState"),
TypeContract::of::<ToolFilament>("ToolFilament"),
]
}
pub fn contract(type_name: &str) -> TypeContract {
declared()
.into_iter()
.find(|entry| entry.name == type_name)
.unwrap_or_else(|| panic!("{type_name} is declared"))
}