Skip to main content

nominal_api/conjure/errors/scout/api/
invalid_range.rs

1/// The start time of the provided Range is greater than its end time.
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)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct InvalidRange {
17    #[builder(
18        custom(
19            type = super::super::super::super::objects::api::Range,
20            convert = Box::new
21        )
22    )]
23    #[serde(rename = "range")]
24    range: Box<super::super::super::super::objects::api::Range>,
25}
26impl InvalidRange {
27    /// Constructs a new instance of the type.
28    #[inline]
29    pub fn new(range: super::super::super::super::objects::api::Range) -> Self {
30        Self::builder().range(range).build()
31    }
32    #[inline]
33    pub fn range(&self) -> &super::super::super::super::objects::api::Range {
34        &*self.range
35    }
36}
37impl conjure_error::ErrorType for InvalidRange {
38    #[inline]
39    fn code() -> conjure_error::ErrorCode {
40        conjure_error::ErrorCode::InvalidArgument
41    }
42    #[inline]
43    fn name() -> &'static str {
44        "Scout:InvalidRange"
45    }
46    #[inline]
47    fn safe_args() -> &'static [&'static str] {
48        &["range"]
49    }
50}