Skip to main content

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