Skip to main content

nominal_api_conjure/conjure/objects/scout/compute/api/
combine_struct_series.rs

1/// Combines named input series into one struct-valued series. Each map key becomes a field name in the
2/// resulting struct; a downstream UDF receives the struct as a JSON object keyed by these names and parses
3/// it itself. Alignment uses the interpolation configuration before producing row-aligned values.
4#[derive(
5    Debug,
6    Clone,
7    conjure_object::serde::Serialize,
8    conjure_object::serde::Deserialize,
9    conjure_object::private::DeriveWith
10)]
11#[serde(crate = "conjure_object::serde")]
12#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct CombineStructSeries {
16    #[builder(default, map(key(type = String, into), value(type = super::Series)))]
17    #[serde(
18        rename = "inputs",
19        skip_serializing_if = "std::collections::BTreeMap::is_empty",
20        default
21    )]
22    inputs: std::collections::BTreeMap<String, super::Series>,
23    #[builder(
24        default,
25        custom(
26            type = impl
27            Into<Option<super::InterpolationConfiguration>>,
28            convert = |v|v.into().map(Box::new)
29        )
30    )]
31    #[serde(
32        rename = "interpolationConfiguration",
33        skip_serializing_if = "Option::is_none",
34        default
35    )]
36    interpolation_configuration: Option<Box<super::InterpolationConfiguration>>,
37}
38impl CombineStructSeries {
39    /// Constructs a new instance of the type.
40    #[inline]
41    pub fn new() -> Self {
42        Self::builder().build()
43    }
44    /// Input series keyed by struct field name.
45    #[inline]
46    pub fn inputs(&self) -> &std::collections::BTreeMap<String, super::Series> {
47        &self.inputs
48    }
49    /// Optional interpolation rules used when aligning input series before combining them.
50    #[deprecated(note = "Setting interpolation on this node is deprecated.\n")]
51    #[inline]
52    pub fn interpolation_configuration(
53        &self,
54    ) -> Option<&super::InterpolationConfiguration> {
55        self.interpolation_configuration.as_ref().map(|o| &**o)
56    }
57}