Skip to main content

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

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct BucketedEnumPlot {
16    #[builder(default, list(item(type = super::super::super::super::api::Timestamp)))]
17    #[serde(rename = "timestamps", skip_serializing_if = "Vec::is_empty", default)]
18    timestamps: Vec<super::super::super::super::api::Timestamp>,
19    #[builder(default, list(item(type = super::EnumBucket)))]
20    #[serde(rename = "buckets", skip_serializing_if = "Vec::is_empty", default)]
21    buckets: Vec<super::EnumBucket>,
22    #[builder(default, list(item(type = String, into)))]
23    #[serde(rename = "categories", skip_serializing_if = "Vec::is_empty", default)]
24    categories: Vec<String>,
25}
26impl BucketedEnumPlot {
27    /// Constructs a new instance of the type.
28    #[inline]
29    pub fn new() -> Self {
30        Self::builder().build()
31    }
32    /// The end of the bucket, exclusive.
33    #[inline]
34    pub fn timestamps(&self) -> &[super::super::super::super::api::Timestamp] {
35        &*self.timestamps
36    }
37    #[inline]
38    pub fn buckets(&self) -> &[super::EnumBucket] {
39        &*self.buckets
40    }
41    #[inline]
42    pub fn categories(&self) -> &[String] {
43        &*self.categories
44    }
45}