Skip to main content

muse_code_sdk/msp/view/approval/
decision.rs

1// @generated from the MSP stable schema and protocol sources; do not edit by hand.
2
3use super::ApprovalStageResolution;
4use crate::msp::error::ApprovalRequirementRef;
5use serde::Deserialize;
6use serde::Serialize;
7
8#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
9#[serde(rename_all = "camelCase")]
10#[non_exhaustive]
11pub struct ApprovalChoice {
12    pub choice_id: String,
13    pub label: String,
14    pub decision: ApprovalDecision,
15    pub scope: ApprovalChoiceScope,
16    #[serde(skip_serializing_if = "Option::is_none")]
17    pub rule_preview: Option<String>,
18    #[serde(default, skip_serializing_if = "std::ops::Not::not")]
19    pub accepts_feedback: bool,
20}
21
22#[derive(Debug, Clone, PartialEq, Eq)]
23#[non_exhaustive]
24pub enum ApprovalDecision {
25    Approved,
26    ApprovedForSession,
27    ApprovedPolicyAmendment,
28    Denied,
29    DeniedPolicyAmendment,
30    TimedOut,
31    Abort,
32    /// A value from a newer host, kept verbatim so an older client decodes the
33    /// rest of the message. Excluded from the generated schema while the enum
34    /// stays declared open; never construct it with a known word.
35    Unknown(String),
36}
37
38#[derive(Debug, Clone, PartialEq, Eq)]
39#[non_exhaustive]
40pub enum ApprovalChoiceScope {
41    Once,
42    Session,
43    LocalPersistent,
44    /// A value from a newer host, kept verbatim so an older client decodes the
45    /// rest of the message. Excluded from the generated schema while the enum
46    /// stays declared open; never construct it with a known word.
47    Unknown(String),
48}
49
50#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
51#[serde(rename_all = "camelCase")]
52#[non_exhaustive]
53pub struct ApprovalChange {
54    pub kind: String,
55    #[serde(skip_serializing_if = "Option::is_none")]
56    pub requirement_id: Option<ApprovalRequirementRef>,
57    #[serde(skip_serializing_if = "Option::is_none")]
58    pub choice_id: Option<String>,
59    #[serde(skip_serializing_if = "Option::is_none")]
60    pub decision: Option<ApprovalDecision>,
61    #[serde(skip_serializing_if = "Option::is_none")]
62    pub status: Option<ApprovalPersistenceStatus>,
63    #[serde(skip_serializing_if = "Option::is_none")]
64    pub reason: Option<String>,
65    #[serde(skip_serializing_if = "Option::is_none")]
66    pub reparsed: Option<bool>,
67    #[serde(skip_serializing_if = "Option::is_none")]
68    pub executable: Option<bool>,
69}
70
71#[derive(Debug, Clone, PartialEq, Eq)]
72#[non_exhaustive]
73pub enum ApprovalPersistenceStatus {
74    Succeeded,
75    Failed,
76    /// A value from a newer host, kept verbatim so an older client decodes the
77    /// rest of the message. Excluded from the generated schema while the enum
78    /// stays declared open; never construct it with a known word.
79    Unknown(String),
80}
81
82#[derive(Debug, Clone, PartialEq, Eq)]
83#[non_exhaustive]
84pub enum ApprovalPolicyResult {
85    Allow,
86    Deny,
87    /// A value from a newer host, kept verbatim so an older client decodes the
88    /// rest of the message. Excluded from the generated schema while the enum
89    /// stays declared open; never construct it with a known word.
90    Unknown(String),
91}
92
93#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
94#[serde(rename_all = "camelCase")]
95#[non_exhaustive]
96pub struct ApprovalAmendment {
97    pub durability: ApprovalAmendmentDurability,
98    pub rule_preview: String,
99}
100
101#[derive(Debug, Clone, PartialEq, Eq)]
102#[non_exhaustive]
103pub enum ApprovalAmendmentDurability {
104    Session,
105    LocalPersistent,
106    /// A value from a newer host, kept verbatim so an older client decodes the
107    /// rest of the message. Excluded from the generated schema while the enum
108    /// stays declared open; never construct it with a known word.
109    Unknown(String),
110}
111
112#[derive(Debug, Clone, PartialEq, Eq)]
113#[non_exhaustive]
114pub enum ApprovalResolvedBy {
115    User,
116    Policy,
117    LlmJudge,
118    /// A value from a newer host, kept verbatim so an older client decodes the
119    /// rest of the message. Excluded from the generated schema while the enum
120    /// stays declared open; never construct it with a known word.
121    Unknown(String),
122}
123
124#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
125#[serde(rename_all = "camelCase")]
126#[non_exhaustive]
127pub struct ApprovalStageEvidence {
128    pub requirement_id: ApprovalRequirementRef,
129    pub position: usize,
130    pub total_stages: usize,
131    pub argv: Vec<String>,
132    pub resolution: ApprovalStageResolution,
133}