Skip to main content

nominal_api/conjure/objects/ingest/api/
point_cloud_opts.rs

1/// Options for ingesting point cloud data into Dagger via Scout.
2#[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 PointCloudOpts {
14    #[builder(custom(type = super::IngestSource, convert = Box::new))]
15    #[serde(rename = "source")]
16    source: Box<super::IngestSource>,
17    #[builder(custom(type = super::PointCloudIngestTarget, convert = Box::new))]
18    #[serde(rename = "target")]
19    target: Box<super::PointCloudIngestTarget>,
20    #[builder(
21        default,
22        custom(
23            type = impl
24            Into<Option<super::super::super::scout::spatial::api::PointCloudMetadata>>,
25            convert = |v|v.into().map(Box::new)
26        )
27    )]
28    #[serde(rename = "sensorMetadata", skip_serializing_if = "Option::is_none", default)]
29    sensor_metadata: Option<
30        Box<super::super::super::scout::spatial::api::PointCloudMetadata>,
31    >,
32    #[builder(into)]
33    #[serde(rename = "channel")]
34    channel: String,
35    #[builder(default, map(key(type = String, into), value(type = String, into)))]
36    #[serde(
37        rename = "tags",
38        skip_serializing_if = "std::collections::BTreeMap::is_empty",
39        default
40    )]
41    tags: std::collections::BTreeMap<String, String>,
42}
43impl PointCloudOpts {
44    /// Constructs a new instance of the type.
45    #[inline]
46    pub fn new(
47        source: super::IngestSource,
48        target: super::PointCloudIngestTarget,
49        channel: impl Into<String>,
50    ) -> Self {
51        Self::builder().source(source).target(target).channel(channel).build()
52    }
53    #[inline]
54    pub fn source(&self) -> &super::IngestSource {
55        &*self.source
56    }
57    #[inline]
58    pub fn target(&self) -> &super::PointCloudIngestTarget {
59        &*self.target
60    }
61    /// Sensor metadata to associate with the point cloud.
62    #[inline]
63    pub fn sensor_metadata(
64        &self,
65    ) -> Option<&super::super::super::scout::spatial::api::PointCloudMetadata> {
66        self.sensor_metadata.as_ref().map(|o| &**o)
67    }
68    /// Channel name for workbook integration.
69    #[inline]
70    pub fn channel(&self) -> &str {
71        &*self.channel
72    }
73    /// Tags to apply to the point cloud series.
74    #[inline]
75    pub fn tags(&self) -> &std::collections::BTreeMap<String, String> {
76        &self.tags
77    }
78}