#![allow(deprecated)]
use std::fmt;
use std::str;
#[derive(
    Debug,
    Clone,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    conjure_object::serde::Deserialize,
    conjure_object::serde::Serialize,
)]
#[serde(crate = "conjure_object::serde")]
pub enum RunDataReviewEvaluationStatus {
    #[serde(rename = "NO_CHECKS_APPLIED")]
    NoChecksApplied,
    #[serde(rename = "FAILED_TO_EXECUTE")]
    FailedToExecute,
    #[serde(rename = "EXECUTING")]
    Executing,
    #[serde(rename = "PENDING_EXECUTION")]
    PendingExecution,
    #[serde(rename = "CLOSED_WITH_FURTHER_ACTION")]
    ClosedWithFurtherAction,
    #[serde(rename = "GENERATED_ALERTS")]
    GeneratedAlerts,
    #[serde(rename = "CLOSED_WITH_IGNORE")]
    ClosedWithIgnore,
    #[serde(rename = "PASSING")]
    Passing,
    /// An unknown variant.
    #[serde(untagged)]
    Unknown(Unknown),
}
impl RunDataReviewEvaluationStatus {
    /// Returns the string representation of the enum.
    #[inline]
    pub fn as_str(&self) -> &str {
        match self {
            RunDataReviewEvaluationStatus::NoChecksApplied => "NO_CHECKS_APPLIED",
            RunDataReviewEvaluationStatus::FailedToExecute => "FAILED_TO_EXECUTE",
            RunDataReviewEvaluationStatus::Executing => "EXECUTING",
            RunDataReviewEvaluationStatus::PendingExecution => "PENDING_EXECUTION",
            RunDataReviewEvaluationStatus::ClosedWithFurtherAction => {
                "CLOSED_WITH_FURTHER_ACTION"
            }
            RunDataReviewEvaluationStatus::GeneratedAlerts => "GENERATED_ALERTS",
            RunDataReviewEvaluationStatus::ClosedWithIgnore => "CLOSED_WITH_IGNORE",
            RunDataReviewEvaluationStatus::Passing => "PASSING",
            RunDataReviewEvaluationStatus::Unknown(v) => &*v,
        }
    }
}
impl fmt::Display for RunDataReviewEvaluationStatus {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        fmt::Display::fmt(self.as_str(), fmt)
    }
}
impl conjure_object::Plain for RunDataReviewEvaluationStatus {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        conjure_object::Plain::fmt(self.as_str(), fmt)
    }
}
impl str::FromStr for RunDataReviewEvaluationStatus {
    type Err = conjure_object::plain::ParseEnumError;
    #[inline]
    fn from_str(
        v: &str,
    ) -> Result<RunDataReviewEvaluationStatus, conjure_object::plain::ParseEnumError> {
        match v {
            "NO_CHECKS_APPLIED" => Ok(RunDataReviewEvaluationStatus::NoChecksApplied),
            "FAILED_TO_EXECUTE" => Ok(RunDataReviewEvaluationStatus::FailedToExecute),
            "EXECUTING" => Ok(RunDataReviewEvaluationStatus::Executing),
            "PENDING_EXECUTION" => Ok(RunDataReviewEvaluationStatus::PendingExecution),
            "CLOSED_WITH_FURTHER_ACTION" => {
                Ok(RunDataReviewEvaluationStatus::ClosedWithFurtherAction)
            }
            "GENERATED_ALERTS" => Ok(RunDataReviewEvaluationStatus::GeneratedAlerts),
            "CLOSED_WITH_IGNORE" => Ok(RunDataReviewEvaluationStatus::ClosedWithIgnore),
            "PASSING" => Ok(RunDataReviewEvaluationStatus::Passing),
            v => v.parse().map(|v| RunDataReviewEvaluationStatus::Unknown(Unknown(v))),
        }
    }
}
impl conjure_object::FromPlain for RunDataReviewEvaluationStatus {
    type Err = conjure_object::plain::ParseEnumError;
    #[inline]
    fn from_plain(
        v: &str,
    ) -> Result<RunDataReviewEvaluationStatus, conjure_object::plain::ParseEnumError> {
        v.parse()
    }
}
///An unknown variant of the RunDataReviewEvaluationStatus enum.
#[derive(
    Debug,
    Clone,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    conjure_object::serde::Deserialize,
    conjure_object::serde::Serialize,
)]
#[serde(crate = "conjure_object::serde", transparent)]
pub struct Unknown(conjure_object::private::Variant);
impl std::ops::Deref for Unknown {
    type Target = str;
    #[inline]
    fn deref(&self) -> &str {
        &self.0
    }
}
impl fmt::Display for Unknown {
    #[inline]
    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
        fmt::Display::fmt(&self.0, fmt)
    }
}
