/// a cross-range time series plot with
/// configurable range and channel groupings
#[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 ComparisonTimeSeriesPlotDefinitionV1 {
    #[builder(default, into)]
    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
    title: Option<String>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::RangeAggregationDefinition>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "rangeAggregation",
        skip_serializing_if = "Option::is_none",
        default
    )]
    range_aggregation: Option<Box<super::RangeAggregationDefinition>>,
    #[builder(default, list(item(type = super::ComparisonTimeSeriesPlotVariable)))]
    #[serde(rename = "variables", skip_serializing_if = "Vec::is_empty", default)]
    variables: Vec<super::ComparisonTimeSeriesPlotVariable>,
    #[builder(
        default,
        list(item(type = super::super::super::chartdefinition::api::ValueAxis))
    )]
    #[serde(rename = "valueAxes", skip_serializing_if = "Vec::is_empty", default)]
    value_axes: Vec<super::super::super::chartdefinition::api::ValueAxis>,
    #[serde(rename = "groupBy")]
    group_by: super::ComparisonTimeSeriesGroupBy,
    #[serde(rename = "displayOption")]
    display_option: super::ComparisonTimeSeriesDisplayOption,
}
impl ComparisonTimeSeriesPlotDefinitionV1 {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        group_by: super::ComparisonTimeSeriesGroupBy,
        display_option: super::ComparisonTimeSeriesDisplayOption,
    ) -> Self {
        Self::builder().group_by(group_by).display_option(display_option).build()
    }
    #[inline]
    pub fn title(&self) -> Option<&str> {
        self.title.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn range_aggregation(&self) -> Option<&super::RangeAggregationDefinition> {
        self.range_aggregation.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn variables(&self) -> &[super::ComparisonTimeSeriesPlotVariable] {
        &*self.variables
    }
    /// a list of value ranges, where each variable is assigned to a y-axis
    #[inline]
    pub fn value_axes(&self) -> &[super::super::super::chartdefinition::api::ValueAxis] {
        &*self.value_axes
    }
    #[inline]
    pub fn group_by(&self) -> &super::ComparisonTimeSeriesGroupBy {
        &self.group_by
    }
    #[inline]
    pub fn display_option(&self) -> &super::ComparisonTimeSeriesDisplayOption {
        &self.display_option
    }
}
