wakflo_common/enums/
mod.rs

1use serde::{Deserialize, Serialize};
2use std::str::FromStr;
3
4/// # ConnectorType
5///
6/// Enum for current schema status. Defaults to idle
7#[derive(
8    PartialEq,
9    Eq,
10    Serialize,
11    Deserialize,
12    Clone,
13    Debug,
14    Default,
15    strum_macros::AsRefStr,
16    strum_macros::IntoStaticStr,
17    strum_macros::Display,
18    strum_macros::EnumString,
19)]
20pub enum ConnectorType {
21    #[serde(rename = "loop")]
22    #[strum(serialize = "loop")]
23    Loop,
24    #[serde(rename = "branch")]
25    #[strum(serialize = "branch")]
26    Branch,
27    #[default]
28    #[serde(rename = "normal")]
29    #[strum(serialize = "normal")]
30    Normal,
31    #[serde(rename = "boolean")]
32    #[strum(serialize = "boolean")]
33    Boolean,
34}
35
36impl ConnectorType {
37    pub fn convert_from_string(value: String) -> Self {
38        Self::from_str(value.as_str()).expect("error: ")
39    }
40
41    pub fn convert_to_string(&self) -> String {
42        self.to_string()
43    }
44}
45
46/// # ConnectorType
47///
48/// Enum for current schema status. Defaults to idle
49#[derive(
50    PartialEq,
51    Eq,
52    Serialize,
53    Deserialize,
54    Clone,
55    Debug,
56    Default,
57    strum_macros::AsRefStr,
58    strum_macros::IntoStaticStr,
59    strum_macros::Display,
60    strum_macros::EnumString,
61)]
62pub enum StepType {
63    #[serde(rename = "loop")]
64    #[strum(serialize = "loop")]
65    Loop,
66    #[serde(rename = "branch")]
67    #[strum(serialize = "branch")]
68    Branch,
69    #[default]
70    #[serde(rename = "normal")]
71    #[strum(serialize = "normal")]
72    Normal,
73    #[serde(rename = "boolean")]
74    #[strum(serialize = "boolean")]
75    Boolean,
76    #[serde(rename = "condition")]
77    #[strum(serialize = "condition")]
78    Condition,
79    #[serde(rename = "start")]
80    #[strum(serialize = "start")]
81    Start,
82}
83
84impl StepType {
85    pub fn convert_from_string(value: String) -> Self {
86        Self::from_str(value.as_str()).expect("error: ")
87    }
88
89    pub fn convert_to_string(&self) -> String {
90        self.to_string()
91    }
92}
93
94/// # ConnectorType
95///
96/// Enum for current schema status. Defaults to idle
97#[derive(
98    PartialEq,
99    Eq,
100    Serialize,
101    Deserialize,
102    Clone,
103    Debug,
104    Default,
105    strum_macros::AsRefStr,
106    strum_macros::IntoStaticStr,
107    strum_macros::Display,
108    strum_macros::EnumString,
109)]
110pub enum ConnectorPlatform {
111    #[default]
112    #[serde(rename = "native")]
113    #[strum(serialize = "native")]
114    Native,
115
116    #[serde(rename = "plugin")]
117    #[strum(serialize = "plugin")]
118    Plugin,
119}
120
121impl ConnectorPlatform {
122    pub fn convert_from_string(value: String) -> Self {
123        Self::from_str(value.as_str()).expect("error: ")
124    }
125
126    pub fn convert_to_string(&self) -> String {
127        self.to_string()
128    }
129}
130
131/// # ConnectorType
132///
133/// Enum for current schema status. Defaults to idle
134#[derive(
135    PartialEq,
136    Eq,
137    Serialize,
138    Deserialize,
139    Clone,
140    Debug,
141    Default,
142    strum_macros::AsRefStr,
143    strum_macros::IntoStaticStr,
144    strum_macros::Display,
145    strum_macros::EnumString,
146)]
147pub enum AuthHandlerType {
148    #[default]
149    #[serde(rename = "inbuilt")]
150    #[strum(serialize = "inbuilt")]
151    Inbuilt,
152
153    #[serde(rename = "custom")]
154    #[strum(serialize = "custom")]
155    Custom,
156
157    #[serde(rename = "none")]
158    #[strum(serialize = "none")]
159    None,
160}
161
162impl AuthHandlerType {
163    pub fn convert_from_string(value: String) -> Self {
164        Self::from_str(value.as_str()).expect("error: ")
165    }
166
167    pub fn convert_to_string(&self) -> String {
168        self.to_string()
169    }
170}