Skip to main content

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

1/// A generic Arrow IPC plot response. Used for all Arrow-serialized plot types (numeric, bucketed numeric,
2/// enum, bucketed enum, struct, bucketed struct, full resolution, and bucketed multivariate).
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct ArrowPlot {
18    #[builder(into)]
19    #[serde(rename = "arrowBinary")]
20    arrow_binary: conjure_object::Bytes,
21    #[builder(default, into)]
22    #[serde(rename = "groupByKeys", skip_serializing_if = "Option::is_none", default)]
23    group_by_keys: Option<Vec<String>>,
24    #[builder(
25        default,
26        custom(
27            type = impl
28            Into<Option<super::PageToken>>,
29            convert = |v|v.into().map(Box::new)
30        )
31    )]
32    #[serde(rename = "nextPageToken", skip_serializing_if = "Option::is_none", default)]
33    next_page_token: Option<Box<super::PageToken>>,
34}
35impl ArrowPlot {
36    /// Constructs a new instance of the type.
37    #[inline]
38    pub fn new(arrow_binary: impl Into<conjure_object::Bytes>) -> Self {
39        Self::builder().arrow_binary(arrow_binary).build()
40    }
41    /// The raw binary containing an Arrow IPC stream.
42    #[inline]
43    pub fn arrow_binary(&self) -> &conjure_object::Bytes {
44        &self.arrow_binary
45    }
46    /// This field specifies the tags that the final output is grouped by. When you combine multiple channels,
47    /// this list represents the superset of all group by keys used across every individual channel.
48    #[inline]
49    pub fn group_by_keys(&self) -> Option<&[String]> {
50        self.group_by_keys.as_ref().map(|o| &**o)
51    }
52    /// Continuation token for this paged result. Can only be returned if paging was requested.
53    /// To retrieve the next page, repeat the same request with this
54    /// value as `pageToken` and keep the pageSize sign unchanged. Returned only when this response
55    /// contains exactly `abs(pageSize)` points; the next response may still be empty if this page ended exactly at
56    /// the result-set boundary. Empty means this response was short and there are no further points in the
57    /// requested direction.
58    #[inline]
59    pub fn next_page_token(&self) -> Option<&super::PageToken> {
60        self.next_page_token.as_ref().map(|o| &**o)
61    }
62}