Skip to main content

nominal_api/conjure/objects/scout/compute/resolved/api/
literal_range.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 LiteralRange {
16    #[builder(
17        default,
18        custom(
19            type = impl
20            Into<Option<super::super::super::super::super::api::Timestamp>>,
21            convert = |v|v.into().map(Box::new)
22        )
23    )]
24    #[serde(rename = "startTimestamp", skip_serializing_if = "Option::is_none", default)]
25    start_timestamp: Option<Box<super::super::super::super::super::api::Timestamp>>,
26    #[builder(
27        default,
28        custom(
29            type = impl
30            Into<Option<super::super::super::super::super::api::Timestamp>>,
31            convert = |v|v.into().map(Box::new)
32        )
33    )]
34    #[serde(rename = "endTimestamp", skip_serializing_if = "Option::is_none", default)]
35    end_timestamp: Option<Box<super::super::super::super::super::api::Timestamp>>,
36    #[builder(default, into)]
37    #[serde(rename = "tags", skip_serializing_if = "Option::is_none", default)]
38    tags: Option<std::collections::BTreeMap<String, String>>,
39}
40impl LiteralRange {
41    /// Constructs a new instance of the type.
42    #[inline]
43    pub fn new() -> Self {
44        Self::builder().build()
45    }
46    #[inline]
47    pub fn start_timestamp(
48        &self,
49    ) -> Option<&super::super::super::super::super::api::Timestamp> {
50        self.start_timestamp.as_ref().map(|o| &**o)
51    }
52    #[inline]
53    pub fn end_timestamp(
54        &self,
55    ) -> Option<&super::super::super::super::super::api::Timestamp> {
56        self.end_timestamp.as_ref().map(|o| &**o)
57    }
58    #[inline]
59    pub fn tags(&self) -> Option<&std::collections::BTreeMap<String, String>> {
60        self.tags.as_ref().map(|o| &*o)
61    }
62}