Skip to main content

nominal_api/conjure/objects/scout/compute/api/
summarize_multivariate.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct SummarizeMultivariate {
13    #[builder(default, list(item(type = super::MultivariateInput)))]
14    #[serde(rename = "inputs", skip_serializing_if = "Vec::is_empty", default)]
15    inputs: Vec<super::MultivariateInput>,
16    #[builder(default, into)]
17    #[serde(rename = "outputFormat", skip_serializing_if = "Option::is_none", default)]
18    output_format: Option<super::OutputFormat>,
19    #[builder(default, into)]
20    #[serde(rename = "bucketCount", skip_serializing_if = "Option::is_none", default)]
21    bucket_count: Option<i32>,
22    #[builder(
23        default,
24        custom(
25            type = impl
26            Into<Option<super::InterpolationConfiguration>>,
27            convert = |v|v.into().map(Box::new)
28        )
29    )]
30    #[serde(
31        rename = "interpolationConfiguration",
32        skip_serializing_if = "Option::is_none",
33        default
34    )]
35    interpolation_configuration: Option<Box<super::InterpolationConfiguration>>,
36}
37impl SummarizeMultivariate {
38    /// Constructs a new instance of the type.
39    #[inline]
40    pub fn new() -> Self {
41        Self::builder().build()
42    }
43    /// List of input series to temporally align at the raw point level, then bucket the aligned
44    /// tuples together. The series with the largest tag group acts as the "driver" that determines
45    /// which raw timestamps are included in the alignment. All subsequent series are aligned to the
46    /// driver's raw timestamps using the interpolation configuration. After alignment, the resulting
47    /// (x, y, z, ...) tuples are bucketed into time windows and aggregated.
48    #[inline]
49    pub fn inputs(&self) -> &[super::MultivariateInput] {
50        &*self.inputs
51    }
52    /// The output format of the response. Defaults to LEGACY (JSON).
53    #[inline]
54    pub fn output_format(&self) -> Option<&super::OutputFormat> {
55        self.output_format.as_ref().map(|o| &*o)
56    }
57    /// The number of buckets to return in the response. Maximum is 10,000. Defaults to 1,000 if not specified.
58    #[inline]
59    pub fn bucket_count(&self) -> Option<i32> {
60        self.bucket_count.as_ref().map(|o| *o)
61    }
62    /// Controls how the N input series are aligned at the raw point level when producing multivariate buckets.
63    ///
64    /// When present, the server may fill forward a series value from the most recent prior raw point
65    /// (bounded by the interpolation radius). This alignment happens BEFORE bucketing,
66    /// ensuring that aggregated values in each bucket are computed from temporally aligned raw tuples.
67    ///
68    /// When absent, the default interpolation configuration is used.
69    #[inline]
70    pub fn interpolation_configuration(
71        &self,
72    ) -> Option<&super::InterpolationConfiguration> {
73        self.interpolation_configuration.as_ref().map(|o| &**o)
74    }
75}