#[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 ParameterInput {
#[builder(
default,
map(key(type = super::VariableName), value(type = super::VariableValue))
)]
#[serde(
rename = "variables",
skip_serializing_if = "std::collections::BTreeMap::is_empty",
default
)]
variables: std::collections::BTreeMap<super::VariableName, super::VariableValue>,
#[builder(
default,
custom(
type = impl
Into<Option<super::Range>>,
convert = |v|v.into().map(Box::new)
)
)]
#[serde(rename = "timeRange", skip_serializing_if = "Option::is_none", default)]
time_range: Option<Box<super::Range>>,
}
impl ParameterInput {
#[inline]
pub fn new() -> Self {
Self::builder().build()
}
#[inline]
pub fn variables(
&self,
) -> &std::collections::BTreeMap<super::VariableName, super::VariableValue> {
&self.variables
}
#[inline]
pub fn time_range(&self) -> Option<&super::Range> {
self.time_range.as_ref().map(|o| &**o)
}
}