Skip to main content

nominal_api_conjure/conjure/objects/scout/compute/api/
page_info.rs

1/// Specification of a page for a series. Returns full resolution points beginning nearest to the given page
2/// token, advancing pageSize points in the time direction specified by the sign of the page size. Throws if the
3/// absolute pageSize is greater than 5,000.
4/// Paging cursors are not guaranteed to distinguish exact duplicate non-log points with the same timestamp,
5/// tags, and value. If those duplicates straddle a page boundary, later duplicates may be skipped.
6#[derive(
7    Debug,
8    Clone,
9    conjure_object::serde::Serialize,
10    conjure_object::serde::Deserialize,
11    PartialEq,
12    Eq,
13    PartialOrd,
14    Ord,
15    Hash
16)]
17#[serde(crate = "conjure_object::serde")]
18#[conjure_object::private::staged_builder::staged_builder]
19#[builder(crate = conjure_object::private::staged_builder, update, inline)]
20pub struct PageInfo {
21    #[builder(
22        default,
23        custom(
24            type = impl
25            Into<Option<super::PageToken>>,
26            convert = |v|v.into().map(Box::new)
27        )
28    )]
29    #[serde(rename = "pageToken", skip_serializing_if = "Option::is_none", default)]
30    page_token: Option<Box<super::PageToken>>,
31    #[serde(rename = "pageSize")]
32    page_size: i32,
33}
34impl PageInfo {
35    /// Constructs a new instance of the type.
36    #[inline]
37    pub fn new(page_size: i32) -> Self {
38        Self::builder().page_size(page_size).build()
39    }
40    #[inline]
41    pub fn page_token(&self) -> Option<&super::PageToken> {
42        self.page_token.as_ref().map(|o| &**o)
43    }
44    #[inline]
45    pub fn page_size(&self) -> i32 {
46        self.page_size
47    }
48}