Skip to main content

nominal_api/conjure/errors/scout/compute/api/
duplicate_timestamp.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct DuplicateTimestamp {
16    #[builder(
17        custom(
18            type = super::super::super::super::super::objects::api::Timestamp,
19            convert = Box::new
20        )
21    )]
22    #[serde(rename = "timestamp")]
23    timestamp: Box<super::super::super::super::super::objects::api::Timestamp>,
24}
25impl DuplicateTimestamp {
26    /// Constructs a new instance of the type.
27    #[inline]
28    pub fn new(
29        timestamp: super::super::super::super::super::objects::api::Timestamp,
30    ) -> Self {
31        Self::builder().timestamp(timestamp).build()
32    }
33    #[inline]
34    pub fn timestamp(
35        &self,
36    ) -> &super::super::super::super::super::objects::api::Timestamp {
37        &*self.timestamp
38    }
39}
40impl conjure_error::ErrorType for DuplicateTimestamp {
41    #[inline]
42    fn code() -> conjure_error::ErrorCode {
43        conjure_error::ErrorCode::InvalidArgument
44    }
45    #[inline]
46    fn name() -> &'static str {
47        "Compute:DuplicateTimestamp"
48    }
49    #[inline]
50    fn safe_args() -> &'static [&'static str] {
51        &["timestamp"]
52    }
53}