/// Selects between two numeric series point-wise based on a boolean condition series. For every
/// aligned timestamp, emits the value from `trueValue` where `condition` is true, and the value
/// from `falseValue` otherwise.
#[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 NumericIfElseSeries {
    #[builder(custom(type = super::BooleanSeries, convert = Box::new))]
    #[serde(rename = "condition")]
    condition: Box<super::BooleanSeries>,
    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
    #[serde(rename = "trueValue")]
    true_value: Box<super::NumericSeries>,
    #[builder(custom(type = super::NumericSeries, convert = Box::new))]
    #[serde(rename = "falseValue")]
    false_value: Box<super::NumericSeries>,
}
impl NumericIfElseSeries {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        condition: super::BooleanSeries,
        true_value: super::NumericSeries,
        false_value: super::NumericSeries,
    ) -> Self {
        Self::builder()
            .condition(condition)
            .true_value(true_value)
            .false_value(false_value)
            .build()
    }
    /// Boolean series evaluated at each point to choose between the `trueValue` and `falseValue` branches.
    #[inline]
    pub fn condition(&self) -> &super::BooleanSeries {
        &*self.condition
    }
    /// Value emitted at points where `condition` is true.
    #[inline]
    pub fn true_value(&self) -> &super::NumericSeries {
        &*self.true_value
    }
    /// Value emitted at points where `condition` is false.
    #[inline]
    pub fn false_value(&self) -> &super::NumericSeries {
        &*self.false_value
    }
}
