#![allow(deprecated)]
use std::fmt;
use std::str;
/// Tooltip modes which affect the data displayed in chart tooltips, primarily for time series charts.
/// VERBOSE: Shows all the chart's plotted series in the hover tooltip.
/// CONCISE: Shows only the plotted series within the row currently being hovered.
/// MULTI_ROW_CONCISE: Show separate tooltips for each row, where each shows the series plotted in that row.
/// SINGLE: Shows only the plotted series closest to/under the cursor.
/// NONE: Hides the tooltip entirely (also affects tooltips for other chart types).
#[derive(
    Debug,
    Clone,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash,
    conjure_object::serde::Deserialize,
    conjure_object::serde::Serialize,
)]
#[serde(crate = "conjure_object::serde")]
pub enum ChartTooltipModeSetting {
    #[serde(rename = "VERBOSE")]
    Verbose,
    #[serde(rename = "CONCISE")]
    Concise,
    #[serde(rename = "MULTI_ROW_CONCISE")]
    MultiRowConcise,
    #[serde(rename = "SINGLE")]
    Single,
    #[serde(rename = "NONE")]
    None,
    /// An unknown variant.
    #[serde(untagged)]
    Unknown(Unknown),
}
impl ChartTooltipModeSetting {
    /// Returns the string representation of the enum.
    #[inline]
    pub fn as_str(&self) -> &str {
        match self {
            ChartTooltipModeSetting::Verbose => "VERBOSE",
            ChartTooltipModeSetting::Concise => "CONCISE",
            ChartTooltipModeSetting::MultiRowConcise => "MULTI_ROW_CONCISE",
            ChartTooltipModeSetting::Single => "SINGLE",
            ChartTooltipModeSetting::None => "NONE",
            ChartTooltipModeSetting::Unknown(v) => &*v,
        }
    }
}
impl fmt::Display for ChartTooltipModeSetting {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        fmt::Display::fmt(self.as_str(), fmt)
    }
}
impl conjure_object::Plain for ChartTooltipModeSetting {
    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
        conjure_object::Plain::fmt(self.as_str(), fmt)
    }
}
impl str::FromStr for ChartTooltipModeSetting {
    type Err = conjure_object::plain::ParseEnumError;
    #[inline]
    fn from_str(
        v: &str,
    ) -> Result<ChartTooltipModeSetting, conjure_object::plain::ParseEnumError> {
        match v {
            "VERBOSE" => Ok(ChartTooltipModeSetting::Verbose),
            "CONCISE" => Ok(ChartTooltipModeSetting::Concise),
            "MULTI_ROW_CONCISE" => Ok(ChartTooltipModeSetting::MultiRowConcise),
            "SINGLE" => Ok(ChartTooltipModeSetting::Single),
            "NONE" => Ok(ChartTooltipModeSetting::None),
            v => v.parse().map(|v| ChartTooltipModeSetting::Unknown(Unknown(v))),
        }
    }
}
impl conjure_object::FromPlain for ChartTooltipModeSetting {
    type Err = conjure_object::plain::ParseEnumError;
    #[inline]
    fn from_plain(
        v: &str,
    ) -> Result<ChartTooltipModeSetting, conjure_object::plain::ParseEnumError> {
        v.parse()
    }
}
///An unknown variant of the ChartTooltipModeSetting 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)
    }
}
