Skip to main content

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