#[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 ChannelVariable {
#[builder(default, into)]
#[serde(rename = "displayName", skip_serializing_if = "Option::is_none", default)]
display_name: Option<String>,
#[serde(rename = "variableName")]
variable_name: super::VariableName,
#[builder(custom(type = super::ComputeNodeWithContext, convert = Box::new))]
#[serde(rename = "value")]
value: Box<super::ComputeNodeWithContext>,
#[builder(custom(type = super::ComparisonWorkbookDataScope, convert = Box::new))]
#[serde(rename = "dataScope")]
data_scope: Box<super::ComparisonWorkbookDataScope>,
}
impl ChannelVariable {
#[inline]
pub fn new(
variable_name: super::VariableName,
value: super::ComputeNodeWithContext,
data_scope: super::ComparisonWorkbookDataScope,
) -> Self {
Self::builder()
.variable_name(variable_name)
.value(value)
.data_scope(data_scope)
.build()
}
#[inline]
pub fn display_name(&self) -> Option<&str> {
self.display_name.as_ref().map(|o| &**o)
}
#[inline]
pub fn variable_name(&self) -> &super::VariableName {
&self.variable_name
}
#[inline]
pub fn value(&self) -> &super::ComputeNodeWithContext {
&*self.value
}
#[inline]
pub fn data_scope(&self) -> &super::ComparisonWorkbookDataScope {
&*self.data_scope
}
}