Skip to main content

nominal_api/conjure/objects/scout/compute/api/
summarize_cartesian3d.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 SummarizeCartesian3d {
13    #[builder(custom(type = super::Cartesian3d, convert = Box::new))]
14    #[serde(rename = "input")]
15    input: Box<super::Cartesian3d>,
16    #[builder(
17        default,
18        custom(
19            type = impl
20            Into<Option<super::Cartesian3dBounds>>,
21            convert = |v|v.into().map(Box::new)
22        )
23    )]
24    #[serde(rename = "bounds", skip_serializing_if = "Option::is_none", default)]
25    bounds: Option<Box<super::Cartesian3dBounds>>,
26    #[builder(default, into)]
27    #[serde(rename = "maxPoints", skip_serializing_if = "Option::is_none", default)]
28    max_points: Option<i32>,
29    #[builder(
30        default,
31        custom(
32            type = impl
33            Into<Option<super::ScatterSummarizationStrategy>>,
34            convert = |v|v.into().map(Box::new)
35        )
36    )]
37    #[serde(
38        rename = "summarizationStrategy",
39        skip_serializing_if = "Option::is_none",
40        default
41    )]
42    summarization_strategy: Option<Box<super::ScatterSummarizationStrategy>>,
43}
44impl SummarizeCartesian3d {
45    /// Constructs a new instance of the type.
46    #[inline]
47    pub fn new(input: super::Cartesian3d) -> Self {
48        Self::builder().input(input).build()
49    }
50    #[inline]
51    pub fn input(&self) -> &super::Cartesian3d {
52        &*self.input
53    }
54    #[inline]
55    pub fn bounds(&self) -> Option<&super::Cartesian3dBounds> {
56        self.bounds.as_ref().map(|o| &**o)
57    }
58    /// The maximum number of points to return in the response.
59    /// If more points are found, a BucketedCartesian3dPlot will be returned.
60    /// Maximum is 10,000. Defaults to 2,000 if not specified.
61    #[inline]
62    pub fn max_points(&self) -> Option<i32> {
63        self.max_points.as_ref().map(|o| *o)
64    }
65    /// The strategy to use when summarizing the series. Only spatial decimation is supported.
66    #[inline]
67    pub fn summarization_strategy(
68        &self,
69    ) -> Option<&super::ScatterSummarizationStrategy> {
70        self.summarization_strategy.as_ref().map(|o| &**o)
71    }
72}