#[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 TimeSeriesTablePanelDefinitionV1 {
    #[builder(default, into)]
    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
    title: Option<String>,
    #[builder(default, list(item(type = super::TableColumn)))]
    #[serde(rename = "columns", skip_serializing_if = "Vec::is_empty", default)]
    columns: Vec<super::TableColumn>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::NumberFormat>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "numberFormat", skip_serializing_if = "Option::is_none", default)]
    number_format: Option<Box<super::NumberFormat>>,
    #[builder(default, into)]
    #[serde(
        rename = "timestampColumnWidth",
        skip_serializing_if = "Option::is_none",
        default
    )]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    timestamp_column_width: Option<f64>,
    #[builder(default, into)]
    #[serde(
        rename = "summaryRowVisible",
        skip_serializing_if = "Option::is_none",
        default
    )]
    summary_row_visible: Option<bool>,
    #[builder(default, into)]
    #[serde(
        rename = "comparisonBarsVisible",
        skip_serializing_if = "Option::is_none",
        default
    )]
    comparison_bars_visible: Option<bool>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::PanelBucketStrategy>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "bucketStrategy", skip_serializing_if = "Option::is_none", default)]
    bucket_strategy: Option<Box<super::PanelBucketStrategy>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::super::api::Timestamp>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "anchorPoint", skip_serializing_if = "Option::is_none", default)]
    anchor_point: Option<Box<super::super::super::super::api::Timestamp>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::DataRequestMode>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "dataRequestMode",
        skip_serializing_if = "Option::is_none",
        default
    )]
    data_request_mode: Option<Box<super::DataRequestMode>>,
}
impl TimeSeriesTablePanelDefinitionV1 {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new() -> Self {
        Self::builder().build()
    }
    #[inline]
    pub fn title(&self) -> Option<&str> {
        self.title.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn columns(&self) -> &[super::TableColumn] {
        &*self.columns
    }
    /// Optional panel-level number formatting for numeric columns.
    /// Per-column number formatting overrides this value.
    #[inline]
    pub fn number_format(&self) -> Option<&super::NumberFormat> {
        self.number_format.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn timestamp_column_width(&self) -> Option<f64> {
        self.timestamp_column_width.as_ref().map(|o| *o)
    }
    /// Whether to display the summary row at the bottom of the table. Default is true.
    #[inline]
    pub fn summary_row_visible(&self) -> Option<bool> {
        self.summary_row_visible.as_ref().map(|o| *o)
    }
    /// Whether to display the comparison-style bars within numeric table cells. Default is false.
    #[inline]
    pub fn comparison_bars_visible(&self) -> Option<bool> {
        self.comparison_bars_visible.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn bucket_strategy(&self) -> Option<&super::PanelBucketStrategy> {
        self.bucket_strategy.as_ref().map(|o| &**o)
    }
    /// Optional anchor point for fixed bucket alignment. When set,
    /// buckets align to this time instead of the viewport start.
    #[inline]
    pub fn anchor_point(&self) -> Option<&super::super::super::super::api::Timestamp> {
        self.anchor_point.as_ref().map(|o| &**o)
    }
    /// The mode to use when requesting data from the backend. Default is full rate.
    #[inline]
    pub fn data_request_mode(&self) -> Option<&super::DataRequestMode> {
        self.data_request_mode.as_ref().map(|o| &**o)
    }
}
