Skip to main content

nominal_api/conjure/objects/scout/compute/api/
multivariate_bucket.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 MultivariateBucket {
13    #[builder(
14        custom(type = super::super::super::super::api::Timestamp, convert = Box::new)
15    )]
16    #[serde(rename = "timestamp")]
17    timestamp: Box<super::super::super::super::api::Timestamp>,
18    #[builder(default, list(item(type = super::Value)))]
19    #[serde(rename = "values", skip_serializing_if = "Vec::is_empty", default)]
20    values: Vec<super::Value>,
21}
22impl MultivariateBucket {
23    /// Constructs a new instance of the type.
24    #[inline]
25    pub fn new(timestamp: super::super::super::super::api::Timestamp) -> Self {
26        Self::builder().timestamp(timestamp).build()
27    }
28    #[inline]
29    pub fn timestamp(&self) -> &super::super::super::super::api::Timestamp {
30        &*self.timestamp
31    }
32    /// Values for each input series in the bucket.
33    #[inline]
34    pub fn values(&self) -> &[super::Value] {
35        &*self.values
36    }
37}