1use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
7#[serde(rename_all = "snake_case")]
8#[non_exhaustive]
9pub enum PauseKind {
10 User,
12 BackOff,
14 NoProgress,
16 Verification,
18 Infra,
20}
21
22impl PauseKind {
23 #[must_use]
25 pub const fn as_str(self) -> &'static str {
26 match self {
27 Self::User => "user",
28 Self::BackOff => "back_off",
29 Self::NoProgress => "no_progress",
30 Self::Verification => "verification",
31 Self::Infra => "infra",
32 }
33 }
34}
35
36#[derive(Debug, Clone, Serialize, Deserialize)]
38#[serde(tag = "outcome", rename_all = "snake_case")]
39#[non_exhaustive]
40pub enum WorkflowOutcome {
41 Completed {
43 result: serde_json::Value,
45 },
46 Paused {
48 kind: PauseKind,
50 message: String,
52 },
53 BudgetExceeded {
55 message: String,
57 },
58 Cancelled,
60 Failed {
62 error: String,
64 },
65}