Skip to main content

nominal_api/conjure/objects/scout/datasource/connection/api/
connection_plotting_configuration.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith,
7    Copy
8)]
9#[serde(crate = "conjure_object::serde")]
10#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
11#[conjure_object::private::staged_builder::staged_builder]
12#[builder(crate = conjure_object::private::staged_builder, update, inline)]
13pub struct ConnectionPlottingConfiguration {
14    #[builder(default, into)]
15    #[serde(
16        rename = "maxUndecimatedPointsPerPage",
17        skip_serializing_if = "Option::is_none",
18        default
19    )]
20    max_undecimated_points_per_page: Option<i32>,
21    #[builder(default, into)]
22    #[serde(
23        rename = "maxUnboundedRange",
24        skip_serializing_if = "Option::is_none",
25        default
26    )]
27    max_unbounded_range: Option<conjure_object::SafeLong>,
28    #[builder(default, into)]
29    #[serde(
30        rename = "maxUndecimatedPageReadsPerSecond",
31        skip_serializing_if = "Option::is_none",
32        default
33    )]
34    #[derive_with(with = conjure_object::private::DoubleWrapper)]
35    max_undecimated_page_reads_per_second: Option<f64>,
36    #[builder(default, into)]
37    #[serde(
38        rename = "maxPermitsPerSecond",
39        skip_serializing_if = "Option::is_none",
40        default
41    )]
42    #[derive_with(with = conjure_object::private::DoubleWrapper)]
43    max_permits_per_second: Option<f64>,
44    #[builder(default, into)]
45    #[serde(rename = "maxConnections", skip_serializing_if = "Option::is_none", default)]
46    max_connections: Option<i32>,
47}
48impl ConnectionPlottingConfiguration {
49    /// Constructs a new instance of the type.
50    #[inline]
51    pub fn new() -> Self {
52        Self::builder().build()
53    }
54    /// The maximum number of points to return per page for undecimated queries
55    #[inline]
56    pub fn max_undecimated_points_per_page(&self) -> Option<i32> {
57        self.max_undecimated_points_per_page.as_ref().map(|o| *o)
58    }
59    /// The maximum range (in nanoseconds) for unbounded queries
60    #[inline]
61    pub fn max_unbounded_range(&self) -> Option<conjure_object::SafeLong> {
62        self.max_unbounded_range.as_ref().map(|o| *o)
63    }
64    /// The maximum number of page reads per second for undecimated queries
65    #[inline]
66    pub fn max_undecimated_page_reads_per_second(&self) -> Option<f64> {
67        self.max_undecimated_page_reads_per_second.as_ref().map(|o| *o)
68    }
69    /// The maximum number of permits per second for queries
70    #[inline]
71    pub fn max_permits_per_second(&self) -> Option<f64> {
72        self.max_permits_per_second.as_ref().map(|o| *o)
73    }
74    /// The maximum number of connections to the database
75    #[inline]
76    pub fn max_connections(&self) -> Option<i32> {
77        self.max_connections.as_ref().map(|o| *o)
78    }
79}