wakflo-common 0.1.3

wakflo.ai rust sdk
Documentation
use serde::{Deserialize, Serialize};
use std::str::FromStr;

/// # ConnectorType
///
/// Enum for current schema status. Defaults to idle
#[derive(
    PartialEq,
    Eq,
    Serialize,
    Deserialize,
    Clone,
    Debug,
    Default,
    strum_macros::AsRefStr,
    strum_macros::IntoStaticStr,
    strum_macros::Display,
    strum_macros::EnumString,
)]
pub enum ConnectorType {
    #[serde(rename = "loop")]
    #[strum(serialize = "loop")]
    Loop,
    #[serde(rename = "branch")]
    #[strum(serialize = "branch")]
    Branch,
    #[default]
    #[serde(rename = "normal")]
    #[strum(serialize = "normal")]
    Normal,
    #[serde(rename = "boolean")]
    #[strum(serialize = "boolean")]
    Boolean,
}

impl ConnectorType {
    pub fn convert_from_string(value: String) -> Self {
        Self::from_str(value.as_str()).expect("error: ")
    }

    pub fn convert_to_string(&self) -> String {
        self.to_string()
    }
}

/// # ConnectorType
///
/// Enum for current schema status. Defaults to idle
#[derive(
    PartialEq,
    Eq,
    Serialize,
    Deserialize,
    Clone,
    Debug,
    Default,
    strum_macros::AsRefStr,
    strum_macros::IntoStaticStr,
    strum_macros::Display,
    strum_macros::EnumString,
)]
pub enum StepType {
    #[serde(rename = "loop")]
    #[strum(serialize = "loop")]
    Loop,
    #[serde(rename = "branch")]
    #[strum(serialize = "branch")]
    Branch,
    #[default]
    #[serde(rename = "normal")]
    #[strum(serialize = "normal")]
    Normal,
    #[serde(rename = "boolean")]
    #[strum(serialize = "boolean")]
    Boolean,
    #[serde(rename = "condition")]
    #[strum(serialize = "condition")]
    Condition,
    #[serde(rename = "start")]
    #[strum(serialize = "start")]
    Start,
}

impl StepType {
    pub fn convert_from_string(value: String) -> Self {
        Self::from_str(value.as_str()).expect("error: ")
    }

    pub fn convert_to_string(&self) -> String {
        self.to_string()
    }
}

/// # ConnectorType
///
/// Enum for current schema status. Defaults to idle
#[derive(
    PartialEq,
    Eq,
    Serialize,
    Deserialize,
    Clone,
    Debug,
    Default,
    strum_macros::AsRefStr,
    strum_macros::IntoStaticStr,
    strum_macros::Display,
    strum_macros::EnumString,
)]
pub enum ConnectorPlatform {
    #[default]
    #[serde(rename = "native")]
    #[strum(serialize = "native")]
    Native,

    #[serde(rename = "plugin")]
    #[strum(serialize = "plugin")]
    Plugin,
}

impl ConnectorPlatform {
    pub fn convert_from_string(value: String) -> Self {
        Self::from_str(value.as_str()).expect("error: ")
    }

    pub fn convert_to_string(&self) -> String {
        self.to_string()
    }
}

/// # ConnectorType
///
/// Enum for current schema status. Defaults to idle
#[derive(
    PartialEq,
    Eq,
    Serialize,
    Deserialize,
    Clone,
    Debug,
    Default,
    strum_macros::AsRefStr,
    strum_macros::IntoStaticStr,
    strum_macros::Display,
    strum_macros::EnumString,
)]
pub enum AuthHandlerType {
    #[default]
    #[serde(rename = "inbuilt")]
    #[strum(serialize = "inbuilt")]
    Inbuilt,

    #[serde(rename = "custom")]
    #[strum(serialize = "custom")]
    Custom,

    #[serde(rename = "none")]
    #[strum(serialize = "none")]
    None,
}

impl AuthHandlerType {
    pub fn convert_from_string(value: String) -> Self {
        Self::from_str(value.as_str()).expect("error: ")
    }

    pub fn convert_to_string(&self) -> String {
        self.to_string()
    }
}