Skip to main content

nominal_api/conjure/objects/scout/compute/api/
scatter_fit_options.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 ScatterFitOptions {
13    #[builder(
14        default,
15        custom(
16            type = impl
17            Into<Option<super::DoubleConstant>>,
18            convert = |v|v.into().map(Box::new)
19        )
20    )]
21    #[serde(rename = "minX", skip_serializing_if = "Option::is_none", default)]
22    min_x: Option<Box<super::DoubleConstant>>,
23    #[builder(
24        default,
25        custom(
26            type = impl
27            Into<Option<super::DoubleConstant>>,
28            convert = |v|v.into().map(Box::new)
29        )
30    )]
31    #[serde(rename = "maxX", skip_serializing_if = "Option::is_none", default)]
32    max_x: Option<Box<super::DoubleConstant>>,
33    #[builder(
34        default,
35        custom(
36            type = impl
37            Into<Option<super::DoubleConstant>>,
38            convert = |v|v.into().map(Box::new)
39        )
40    )]
41    #[serde(rename = "minY", skip_serializing_if = "Option::is_none", default)]
42    min_y: Option<Box<super::DoubleConstant>>,
43    #[builder(
44        default,
45        custom(
46            type = impl
47            Into<Option<super::DoubleConstant>>,
48            convert = |v|v.into().map(Box::new)
49        )
50    )]
51    #[serde(rename = "maxY", skip_serializing_if = "Option::is_none", default)]
52    max_y: Option<Box<super::DoubleConstant>>,
53}
54impl ScatterFitOptions {
55    /// Constructs a new instance of the type.
56    #[inline]
57    pub fn new() -> Self {
58        Self::builder().build()
59    }
60    /// Inclusive lower bound on the x values to fit to. If omitted, does not set a bound
61    /// (equivalent to setting this to the minimum x value among all points in the time range).
62    #[inline]
63    pub fn min_x(&self) -> Option<&super::DoubleConstant> {
64        self.min_x.as_ref().map(|o| &**o)
65    }
66    /// Inclusive upper bound on the x values to fit to. If omitted, does not set a bound
67    /// (equivalent to setting this to the maximum x value among all points in the time range).
68    #[inline]
69    pub fn max_x(&self) -> Option<&super::DoubleConstant> {
70        self.max_x.as_ref().map(|o| &**o)
71    }
72    /// Inclusive lower bound on the y values to fit to. If omitted, does not set a bound
73    /// (equivalent to setting this to the minimum y value among all points in the time range).
74    #[inline]
75    pub fn min_y(&self) -> Option<&super::DoubleConstant> {
76        self.min_y.as_ref().map(|o| &**o)
77    }
78    /// Inclusive upper bound on the y values to fit to. If omitted, does not set a bound
79    /// (equivalent to setting this to the maximum y value among all points in the time range).
80    #[inline]
81    pub fn max_y(&self) -> Option<&super::DoubleConstant> {
82        self.max_y.as_ref().map(|o| &**o)
83    }
84}