#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct ComparisonTableColumn {
    #[builder(default, into)]
    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
    title: Option<String>,
    #[builder(custom(type = super::VariableLocator, convert = Box::new))]
    #[serde(rename = "locator")]
    locator: Box<super::VariableLocator>,
    #[builder(
        custom(
            type = super::ComparisonTableColumnVisualizationOptions,
            convert = Box::new
        )
    )]
    #[serde(rename = "visualizationOptions")]
    visualization_options: Box<super::ComparisonTableColumnVisualizationOptions>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::AggregationType>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "aggregationType",
        skip_serializing_if = "Option::is_none",
        default
    )]
    aggregation_type: Option<Box<super::AggregationType>>,
}
impl ComparisonTableColumn {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        locator: super::VariableLocator,
        visualization_options: super::ComparisonTableColumnVisualizationOptions,
    ) -> Self {
        Self::builder()
            .locator(locator)
            .visualization_options(visualization_options)
            .build()
    }
    #[inline]
    pub fn title(&self) -> Option<&str> {
        self.title.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn locator(&self) -> &super::VariableLocator {
        &*self.locator
    }
    #[inline]
    pub fn visualization_options(
        &self,
    ) -> &super::ComparisonTableColumnVisualizationOptions {
        &*self.visualization_options
    }
    /// optional for backcompatibility.
    #[inline]
    pub fn aggregation_type(&self) -> Option<&super::AggregationType> {
        self.aggregation_type.as_ref().map(|o| &**o)
    }
}
