#[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 TraceCompute {
    #[builder(
        default,
        map(
            key(type = String, into),
            value(type = super::super::super::channelvariables::api::ChannelVariableName)
        )
    )]
    #[serde(
        rename = "traceChannelVariables",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    trace_channel_variables: std::collections::BTreeMap<
        String,
        super::super::super::channelvariables::api::ChannelVariableName,
    >,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::TraceComputeConfig>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "config", skip_serializing_if = "Option::is_none", default)]
    config: Option<Box<super::TraceComputeConfig>>,
}
impl TraceCompute {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new() -> Self {
        Self::builder().build()
    }
    /// A map of plotly trace variables to the channel variables that should load into them
    #[inline]
    pub fn trace_channel_variables(
        &self,
    ) -> &std::collections::BTreeMap<
        String,
        super::super::super::channelvariables::api::ChannelVariableName,
    > {
        &self.trace_channel_variables
    }
    #[inline]
    pub fn config(&self) -> Option<&super::TraceComputeConfig> {
        self.config.as_ref().map(|o| &**o)
    }
}
