nominal_api/conjure/objects/scout/spatial/api/
spatial.rs1#[derive(
3 Debug,
4 Clone,
5 conjure_object::serde::Serialize,
6 conjure_object::serde::Deserialize,
7 conjure_object::private::DeriveWith
8)]
9#[serde(crate = "conjure_object::serde")]
10#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
11#[conjure_object::private::staged_builder::staged_builder]
12#[builder(crate = conjure_object::private::staged_builder, update, inline)]
13pub struct Spatial {
14 #[serde(rename = "rid")]
15 rid: conjure_object::ResourceIdentifier,
16 #[builder(into)]
17 #[serde(rename = "title")]
18 title: String,
19 #[builder(default, into)]
20 #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
21 description: Option<String>,
22 #[builder(default, set(item(type = String, into)))]
23 #[serde(
24 rename = "labels",
25 skip_serializing_if = "std::collections::BTreeSet::is_empty",
26 default
27 )]
28 labels: std::collections::BTreeSet<String>,
29 #[builder(default, map(key(type = String, into), value(type = String, into)))]
30 #[serde(
31 rename = "properties",
32 skip_serializing_if = "std::collections::BTreeMap::is_empty",
33 default
34 )]
35 properties: std::collections::BTreeMap<String, String>,
36 #[serde(rename = "createdBy")]
37 created_by: conjure_object::ResourceIdentifier,
38 #[serde(rename = "createdAt")]
39 created_at: conjure_object::DateTime<conjure_object::Utc>,
40 #[serde(rename = "updatedAt")]
41 updated_at: conjure_object::DateTime<conjure_object::Utc>,
42 #[serde(rename = "isArchived")]
43 is_archived: bool,
44 #[serde(rename = "daggerUuid")]
45 dagger_uuid: conjure_object::Uuid,
46 #[builder(custom(type = super::SpatialTypeMetadata, convert = Box::new))]
47 #[serde(rename = "typeMetadata")]
48 type_metadata: Box<super::SpatialTypeMetadata>,
49 #[builder(
50 default,
51 custom(
52 type = impl
53 Into<Option<super::super::super::super::api::Timestamp>>,
54 convert = |v|v.into().map(Box::new)
55 )
56 )]
57 #[serde(rename = "startTimestamp", skip_serializing_if = "Option::is_none", default)]
58 start_timestamp: Option<Box<super::super::super::super::api::Timestamp>>,
59 #[builder(
60 default,
61 custom(
62 type = impl
63 Into<Option<super::super::super::super::api::Timestamp>>,
64 convert = |v|v.into().map(Box::new)
65 )
66 )]
67 #[serde(rename = "endTimestamp", skip_serializing_if = "Option::is_none", default)]
68 end_timestamp: Option<Box<super::super::super::super::api::Timestamp>>,
69 #[builder(
70 default,
71 custom(
72 type = impl
73 Into<Option<super::super::super::super::api::Handle>>,
74 convert = |v|v.into().map(Box::new)
75 )
76 )]
77 #[serde(rename = "sourceHandle", skip_serializing_if = "Option::is_none", default)]
78 source_handle: Option<Box<super::super::super::super::api::Handle>>,
79}
80impl Spatial {
81 #[inline]
83 pub fn rid(&self) -> &conjure_object::ResourceIdentifier {
84 &self.rid
85 }
86 #[inline]
88 pub fn title(&self) -> &str {
89 &*self.title
90 }
91 #[inline]
93 pub fn description(&self) -> Option<&str> {
94 self.description.as_ref().map(|o| &**o)
95 }
96 #[inline]
98 pub fn labels(&self) -> &std::collections::BTreeSet<String> {
99 &self.labels
100 }
101 #[inline]
103 pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
104 &self.properties
105 }
106 #[inline]
108 pub fn created_by(&self) -> &conjure_object::ResourceIdentifier {
109 &self.created_by
110 }
111 #[inline]
113 pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
114 self.created_at
115 }
116 #[inline]
118 pub fn updated_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
119 self.updated_at
120 }
121 #[inline]
123 pub fn is_archived(&self) -> bool {
124 self.is_archived
125 }
126 #[inline]
128 pub fn dagger_uuid(&self) -> conjure_object::Uuid {
129 self.dagger_uuid
130 }
131 #[inline]
134 pub fn type_metadata(&self) -> &super::SpatialTypeMetadata {
135 &*self.type_metadata
136 }
137 #[inline]
139 pub fn start_timestamp(
140 &self,
141 ) -> Option<&super::super::super::super::api::Timestamp> {
142 self.start_timestamp.as_ref().map(|o| &**o)
143 }
144 #[inline]
146 pub fn end_timestamp(&self) -> Option<&super::super::super::super::api::Timestamp> {
147 self.end_timestamp.as_ref().map(|o| &**o)
148 }
149 #[inline]
151 pub fn source_handle(&self) -> Option<&super::super::super::super::api::Handle> {
152 self.source_handle.as_ref().map(|o| &**o)
153 }
154}