#![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 EventTimeFilterCondition {
    #[serde(rename = "START_TIME_BEFORE_INCLUSIVE")]
    StartTimeBeforeInclusive,
    #[serde(rename = "START_TIME_BEFORE_EXCLUSIVE")]
    StartTimeBeforeExclusive,
    #[serde(rename = "START_TIME_AFTER_INCLUSIVE")]
    StartTimeAfterInclusive,
    #[serde(rename = "START_TIME_AFTER_EXCLUSIVE")]
    StartTimeAfterExclusive,
    #[serde(rename = "END_TIME_BEFORE_INCLUSIVE")]
    EndTimeBeforeInclusive,
    #[serde(rename = "END_TIME_BEFORE_EXCLUSIVE")]
    EndTimeBeforeExclusive,
    #[serde(rename = "END_TIME_AFTER_INCLUSIVE")]
    EndTimeAfterInclusive,
    #[serde(rename = "END_TIME_AFTER_EXCLUSIVE")]
    EndTimeAfterExclusive,
    /// An unknown variant.
    #[serde(untagged)]
    Unknown(Unknown),
}
impl EventTimeFilterCondition {
    /// Returns the string representation of the enum.
    #[inline]
    pub fn as_str(&self) -> &str {
        match self {
            EventTimeFilterCondition::StartTimeBeforeInclusive => {
                "START_TIME_BEFORE_INCLUSIVE"
            }
            EventTimeFilterCondition::StartTimeBeforeExclusive => {
                "START_TIME_BEFORE_EXCLUSIVE"
            }
            EventTimeFilterCondition::StartTimeAfterInclusive => {
                "START_TIME_AFTER_INCLUSIVE"
            }
            EventTimeFilterCondition::StartTimeAfterExclusive => {
                "START_TIME_AFTER_EXCLUSIVE"
            }
            EventTimeFilterCondition::EndTimeBeforeInclusive => {
                "END_TIME_BEFORE_INCLUSIVE"
            }
            EventTimeFilterCondition::EndTimeBeforeExclusive => {
                "END_TIME_BEFORE_EXCLUSIVE"
            }
            EventTimeFilterCondition::EndTimeAfterInclusive => "END_TIME_AFTER_INCLUSIVE",
            EventTimeFilterCondition::EndTimeAfterExclusive => "END_TIME_AFTER_EXCLUSIVE",
            EventTimeFilterCondition::Unknown(v) => &*v,
        }
    }
}
impl fmt::Display for EventTimeFilterCondition {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        fmt::Display::fmt(self.as_str(), fmt)
    }
}
impl conjure_object::Plain for EventTimeFilterCondition {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        conjure_object::Plain::fmt(self.as_str(), fmt)
    }
}
impl str::FromStr for EventTimeFilterCondition {
    type Err = conjure_object::plain::ParseEnumError;
    #[inline]
    fn from_str(
        v: &str,
    ) -> Result<EventTimeFilterCondition, conjure_object::plain::ParseEnumError> {
        match v {
            "START_TIME_BEFORE_INCLUSIVE" => {
                Ok(EventTimeFilterCondition::StartTimeBeforeInclusive)
            }
            "START_TIME_BEFORE_EXCLUSIVE" => {
                Ok(EventTimeFilterCondition::StartTimeBeforeExclusive)
            }
            "START_TIME_AFTER_INCLUSIVE" => {
                Ok(EventTimeFilterCondition::StartTimeAfterInclusive)
            }
            "START_TIME_AFTER_EXCLUSIVE" => {
                Ok(EventTimeFilterCondition::StartTimeAfterExclusive)
            }
            "END_TIME_BEFORE_INCLUSIVE" => {
                Ok(EventTimeFilterCondition::EndTimeBeforeInclusive)
            }
            "END_TIME_BEFORE_EXCLUSIVE" => {
                Ok(EventTimeFilterCondition::EndTimeBeforeExclusive)
            }
            "END_TIME_AFTER_INCLUSIVE" => {
                Ok(EventTimeFilterCondition::EndTimeAfterInclusive)
            }
            "END_TIME_AFTER_EXCLUSIVE" => {
                Ok(EventTimeFilterCondition::EndTimeAfterExclusive)
            }
            v => v.parse().map(|v| EventTimeFilterCondition::Unknown(Unknown(v))),
        }
    }
}
impl conjure_object::FromPlain for EventTimeFilterCondition {
    type Err = conjure_object::plain::ParseEnumError;
    #[inline]
    fn from_plain(
        v: &str,
    ) -> Result<EventTimeFilterCondition, conjure_object::plain::ParseEnumError> {
        v.parse()
    }
}
///An unknown variant of the EventTimeFilterCondition 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)
    }
}
