From 5976c392ad58060894bde80d3ff22e1ee605be1b Mon Sep 17 00:00:00 2001 From: Dominik Csapak Date: Tue, 6 Oct 2020 12:25:23 +0200 Subject: [PATCH] api2/types: add TaskStateType struct the same as the regular TaskState, but without its fields, so that we can use the api macro and use it as api call parameter Signed-off-by: Dominik Csapak --- src/api2/types/mod.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/api2/types/mod.rs b/src/api2/types/mod.rs index 348d3bf4..75b68879 100644 --- a/src/api2/types/mod.rs +++ b/src/api2/types/mod.rs @@ -662,6 +662,20 @@ impl From for TaskListItem { } } +#[api()] +#[derive(Eq, PartialEq, Debug, Serialize, Deserialize)] +#[serde(rename_all = "lowercase")] +pub enum TaskStateType { + /// Ok + OK, + /// Warning + Warning, + /// Error + Error, + /// Unknown + Unknown, +} + #[api()] #[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "lowercase")]