Skip to main content

nominal_api/conjure/objects/scout/spatial/api/
update_spatial_metadata_request.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct UpdateSpatialMetadataRequest {
13    #[builder(default, into)]
14    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
15    title: Option<String>,
16    #[builder(default, into)]
17    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
18    description: Option<String>,
19    #[builder(default, into)]
20    #[serde(rename = "labels", skip_serializing_if = "Option::is_none", default)]
21    labels: Option<std::collections::BTreeSet<String>>,
22    #[builder(default, into)]
23    #[serde(rename = "properties", skip_serializing_if = "Option::is_none", default)]
24    properties: Option<std::collections::BTreeMap<String, String>>,
25    #[builder(
26        default,
27        custom(
28            type = impl
29            Into<Option<super::SpatialTypeMetadata>>,
30            convert = |v|v.into().map(Box::new)
31        )
32    )]
33    #[serde(rename = "typeMetadata", skip_serializing_if = "Option::is_none", default)]
34    type_metadata: Option<Box<super::SpatialTypeMetadata>>,
35    #[builder(
36        default,
37        custom(
38            type = impl
39            Into<Option<super::super::super::super::api::Timestamp>>,
40            convert = |v|v.into().map(Box::new)
41        )
42    )]
43    #[serde(rename = "startTimestamp", skip_serializing_if = "Option::is_none", default)]
44    start_timestamp: Option<Box<super::super::super::super::api::Timestamp>>,
45    #[builder(
46        default,
47        custom(
48            type = impl
49            Into<Option<super::super::super::super::api::Timestamp>>,
50            convert = |v|v.into().map(Box::new)
51        )
52    )]
53    #[serde(rename = "endTimestamp", skip_serializing_if = "Option::is_none", default)]
54    end_timestamp: Option<Box<super::super::super::super::api::Timestamp>>,
55    #[builder(
56        default,
57        custom(
58            type = impl
59            Into<Option<super::super::super::super::api::Handle>>,
60            convert = |v|v.into().map(Box::new)
61        )
62    )]
63    #[serde(rename = "sourceHandle", skip_serializing_if = "Option::is_none", default)]
64    source_handle: Option<Box<super::super::super::super::api::Handle>>,
65}
66impl UpdateSpatialMetadataRequest {
67    /// Constructs a new instance of the type.
68    #[inline]
69    pub fn new() -> Self {
70        Self::builder().build()
71    }
72    #[inline]
73    pub fn title(&self) -> Option<&str> {
74        self.title.as_ref().map(|o| &**o)
75    }
76    #[inline]
77    pub fn description(&self) -> Option<&str> {
78        self.description.as_ref().map(|o| &**o)
79    }
80    #[inline]
81    pub fn labels(&self) -> Option<&std::collections::BTreeSet<String>> {
82        self.labels.as_ref().map(|o| &*o)
83    }
84    #[inline]
85    pub fn properties(&self) -> Option<&std::collections::BTreeMap<String, String>> {
86        self.properties.as_ref().map(|o| &*o)
87    }
88    #[inline]
89    pub fn type_metadata(&self) -> Option<&super::SpatialTypeMetadata> {
90        self.type_metadata.as_ref().map(|o| &**o)
91    }
92    #[inline]
93    pub fn start_timestamp(
94        &self,
95    ) -> Option<&super::super::super::super::api::Timestamp> {
96        self.start_timestamp.as_ref().map(|o| &**o)
97    }
98    #[inline]
99    pub fn end_timestamp(&self) -> Option<&super::super::super::super::api::Timestamp> {
100        self.end_timestamp.as_ref().map(|o| &**o)
101    }
102    #[inline]
103    pub fn source_handle(&self) -> Option<&super::super::super::super::api::Handle> {
104        self.source_handle.as_ref().map(|o| &**o)
105    }
106}