Skip to main content

muse_code_sdk/msp/view/item_subagent_workflow/
catch_all.rs

1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3use super::SubagentControlStatus;
4use serde::{Deserialize, Deserializer, Serialize, Serializer};
5
6impl SubagentControlStatus {
7    /// The exact wire spelling, including an unknown word kept verbatim.
8    pub fn as_str(&self) -> &str {
9        match self {
10            Self::Accepted => "accepted",
11            Self::Starting => "starting",
12            Self::Running => "running",
13            Self::ResultReady => "resultReady",
14            Self::Closing => "closing",
15            Self::Closed => "closed",
16            Self::RecoveryPending => "recoveryPending",
17            Self::ManualReconciliation => "manualReconciliation",
18            Self::Unknown(word) => word,
19        }
20    }
21}
22
23impl Serialize for SubagentControlStatus {
24    fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Error> {
25        serializer.serialize_str(self.as_str())
26    }
27}
28
29impl<'de> Deserialize<'de> for SubagentControlStatus {
30    fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
31        let word = String::deserialize(deserializer)?;
32        Ok(match word.as_str() {
33            "accepted" => Self::Accepted,
34            "starting" => Self::Starting,
35            "running" => Self::Running,
36            "resultReady" => Self::ResultReady,
37            "closing" => Self::Closing,
38            "closed" => Self::Closed,
39            "recoveryPending" => Self::RecoveryPending,
40            "manualReconciliation" => Self::ManualReconciliation,
41            _ => Self::Unknown(word),
42        })
43    }
44}