#[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 TableState {
    #[builder(default, into)]
    #[serde(
        rename = "columnVisibility",
        skip_serializing_if = "Option::is_none",
        default
    )]
    column_visibility: Option<std::collections::BTreeMap<super::ColumnId, bool>>,
    #[builder(default, into)]
    #[serde(rename = "columnSizing", skip_serializing_if = "Option::is_none", default)]
    column_sizing: Option<std::collections::BTreeMap<super::ColumnId, i32>>,
    #[builder(default, into)]
    #[serde(rename = "columnOrder", skip_serializing_if = "Option::is_none", default)]
    column_order: Option<Vec<super::ColumnId>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::ColumnPinningState>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "columnPinning", skip_serializing_if = "Option::is_none", default)]
    column_pinning: Option<Box<super::ColumnPinningState>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::MetricColumns>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "metricColumns", skip_serializing_if = "Option::is_none", default)]
    metric_columns: Option<Box<super::MetricColumns>>,
}
impl TableState {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new() -> Self {
        Self::builder().build()
    }
    #[inline]
    pub fn column_visibility(
        &self,
    ) -> Option<&std::collections::BTreeMap<super::ColumnId, bool>> {
        self.column_visibility.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn column_sizing(
        &self,
    ) -> Option<&std::collections::BTreeMap<super::ColumnId, i32>> {
        self.column_sizing.as_ref().map(|o| &*o)
    }
    #[inline]
    pub fn column_order(&self) -> Option<&[super::ColumnId]> {
        self.column_order.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn column_pinning(&self) -> Option<&super::ColumnPinningState> {
        self.column_pinning.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn metric_columns(&self) -> Option<&super::MetricColumns> {
        self.metric_columns.as_ref().map(|o| &**o)
    }
}
