Skip to main content

nominal_api/conjure/objects/scout/compute/api/
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 EnumPlot {
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 = i32)))]
20    #[serde(rename = "values", skip_serializing_if = "Vec::is_empty", default)]
21    values: Vec<i32>,
22    #[builder(default, list(item(type = String, into)))]
23    #[serde(rename = "categories", skip_serializing_if = "Vec::is_empty", default)]
24    categories: Vec<String>,
25    #[builder(
26        default,
27        custom(
28            type = impl
29            Into<Option<super::PageToken>>,
30            convert = |v|v.into().map(Box::new)
31        )
32    )]
33    #[serde(rename = "nextPageToken", skip_serializing_if = "Option::is_none", default)]
34    next_page_token: Option<Box<super::PageToken>>,
35}
36impl EnumPlot {
37    /// Constructs a new instance of the type.
38    #[inline]
39    pub fn new() -> Self {
40        Self::builder().build()
41    }
42    #[inline]
43    pub fn timestamps(&self) -> &[super::super::super::super::api::Timestamp] {
44        &*self.timestamps
45    }
46    #[inline]
47    pub fn values(&self) -> &[i32] {
48        &*self.values
49    }
50    #[inline]
51    pub fn categories(&self) -> &[String] {
52        &*self.categories
53    }
54    /// Continuation token for this paged result. Can only be returned if paging was requested.
55    /// To retrieve the next page, repeat the same request with this
56    /// value as `pageToken` and keep the pageSize sign unchanged. Returned only when this response
57    /// contains exactly `abs(pageSize)` points; the next response may still be empty if this page ended exactly at
58    /// the result-set boundary. Empty means this response was short and there are no further points in the
59    /// requested direction.
60    #[inline]
61    pub fn next_page_token(&self) -> Option<&super::PageToken> {
62        self.next_page_token.as_ref().map(|o| &**o)
63    }
64}