Skip to main content

nominal_api/conjure/errors/persistent/compute/api/
too_many_points.rs

1/// The subscription is operating on too many points.
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash,
12    Copy
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 TooManyPoints {
18    #[serde(rename = "limit")]
19    limit: conjure_object::SafeLong,
20    #[builder(default, into)]
21    #[serde(rename = "totalNumSeries", skip_serializing_if = "Option::is_none", default)]
22    total_num_series: Option<conjure_object::SafeLong>,
23}
24impl TooManyPoints {
25    /// Constructs a new instance of the type.
26    #[inline]
27    pub fn new(limit: conjure_object::SafeLong) -> Self {
28        Self::builder().limit(limit).build()
29    }
30    #[inline]
31    pub fn limit(&self) -> conjure_object::SafeLong {
32        self.limit
33    }
34    #[inline]
35    pub fn total_num_series(&self) -> Option<conjure_object::SafeLong> {
36        self.total_num_series.as_ref().map(|o| *o)
37    }
38}
39impl conjure_error::ErrorType for TooManyPoints {
40    #[inline]
41    fn code() -> conjure_error::ErrorCode {
42        conjure_error::ErrorCode::InvalidArgument
43    }
44    #[inline]
45    fn name() -> &'static str {
46        "PersistentCompute:TooManyPoints"
47    }
48    #[inline]
49    fn safe_args() -> &'static [&'static str] {
50        &["limit", "totalNumSeries"]
51    }
52}