#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct ValueTableDefinitionV2 {
    #[builder(default, into)]
    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
    title: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "showUnits", skip_serializing_if = "Option::is_none", default)]
    show_units: Option<bool>,
    #[builder(default, into)]
    #[serde(
        rename = "showStalenessIndicator",
        skip_serializing_if = "Option::is_none",
        default
    )]
    show_staleness_indicator: Option<bool>,
    #[builder(custom(type = super::ValueTableLayout, convert = Box::new))]
    #[serde(rename = "layout")]
    layout: Box<super::ValueTableLayout>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::ValueTableStalenessConfig>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "stalenessIndicator",
        skip_serializing_if = "Option::is_none",
        default
    )]
    staleness_indicator: Option<Box<super::ValueTableStalenessConfig>>,
}
impl ValueTableDefinitionV2 {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(layout: super::ValueTableLayout) -> Self {
        Self::builder().layout(layout).build()
    }
    /// The display title of the panel.
    #[inline]
    pub fn title(&self) -> Option<&str> {
        self.title.as_ref().map(|o| &**o)
    }
    /// If true, display units in the cells when available.
    #[inline]
    pub fn show_units(&self) -> Option<bool> {
        self.show_units.as_ref().map(|o| *o)
    }
    /// If true, display staleness indicator in the cells when available.
    #[inline]
    pub fn show_staleness_indicator(&self) -> Option<bool> {
        self.show_staleness_indicator.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn layout(&self) -> &super::ValueTableLayout {
        &*self.layout
    }
    /// Configuration for showing staleness of values in the value table while streaming.
    #[inline]
    pub fn staleness_indicator(&self) -> Option<&super::ValueTableStalenessConfig> {
        self.staleness_indicator.as_ref().map(|o| &**o)
    }
}
