nominal_api/conjure/errors/scout/compute/api/
invalid_literal_range.rs1#[derive(
5 Debug,
6 Clone,
7 conjure_object::serde::Serialize,
8 conjure_object::serde::Deserialize,
9 PartialEq,
10 Eq,
11 PartialOrd,
12 Ord,
13 Hash
14)]
15#[serde(crate = "conjure_object::serde")]
16#[conjure_object::private::staged_builder::staged_builder]
17#[builder(crate = conjure_object::private::staged_builder, update, inline)]
18pub struct InvalidLiteralRange {
19 #[builder(
20 default,
21 custom(
22 type = impl
23 Into<Option<super::super::super::super::super::objects::api::Timestamp>>,
24 convert = |v|v.into().map(Box::new)
25 )
26 )]
27 #[serde(rename = "start", skip_serializing_if = "Option::is_none", default)]
28 start: Option<Box<super::super::super::super::super::objects::api::Timestamp>>,
29 #[builder(
30 default,
31 custom(
32 type = impl
33 Into<Option<super::super::super::super::super::objects::api::Timestamp>>,
34 convert = |v|v.into().map(Box::new)
35 )
36 )]
37 #[serde(rename = "end", skip_serializing_if = "Option::is_none", default)]
38 end: Option<Box<super::super::super::super::super::objects::api::Timestamp>>,
39}
40impl InvalidLiteralRange {
41 #[inline]
43 pub fn new() -> Self {
44 Self::builder().build()
45 }
46 #[inline]
47 pub fn start(
48 &self,
49 ) -> Option<&super::super::super::super::super::objects::api::Timestamp> {
50 self.start.as_ref().map(|o| &**o)
51 }
52 #[inline]
53 pub fn end(
54 &self,
55 ) -> Option<&super::super::super::super::super::objects::api::Timestamp> {
56 self.end.as_ref().map(|o| &**o)
57 }
58}
59impl conjure_error::ErrorType for InvalidLiteralRange {
60 #[inline]
61 fn code() -> conjure_error::ErrorCode {
62 conjure_error::ErrorCode::InvalidArgument
63 }
64 #[inline]
65 fn name() -> &'static str {
66 "Compute:InvalidLiteralRange"
67 }
68 #[inline]
69 fn safe_args() -> &'static [&'static str] {
70 &["end", "start"]
71 }
72}