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    #[serde(rename = "channel")]
33    channel: super::super::super::api::Channel,
34    #[builder(
35        default,
36        map(
37            key(type = super::super::super::api::TagName),
38            value(type = super::super::super::api::TagValue)
39        )
40    )]
41    #[serde(
42        rename = "tags",
43        skip_serializing_if = "std::collections::BTreeMap::is_empty",
44        default
45    )]
46    tags: std::collections::BTreeMap<
47        super::super::super::api::TagName,
48        super::super::super::api::TagValue,
49    >,
50}
51impl PointCloudOpts {
52    /// Constructs a new instance of the type.
53    #[inline]
54    pub fn new(
55        source: super::IngestSource,
56        target: super::PointCloudIngestTarget,
57        channel: super::super::super::api::Channel,
58    ) -> Self {
59        Self::builder().source(source).target(target).channel(channel).build()
60    }
61    #[inline]
62    pub fn source(&self) -> &super::IngestSource {
63        &*self.source
64    }
65    #[inline]
66    pub fn target(&self) -> &super::PointCloudIngestTarget {
67        &*self.target
68    }
69    /// Sensor metadata to associate with the point cloud.
70    #[inline]
71    pub fn sensor_metadata(
72        &self,
73    ) -> Option<&super::super::super::scout::spatial::api::PointCloudMetadata> {
74        self.sensor_metadata.as_ref().map(|o| &**o)
75    }
76    /// Channel name for workbook integration.
77    #[inline]
78    pub fn channel(&self) -> &super::super::super::api::Channel {
79        &self.channel
80    }
81    /// Tags to apply to the point cloud series.
82    #[inline]
83    pub fn tags(
84        &self,
85    ) -> &std::collections::BTreeMap<
86        super::super::super::api::TagName,
87        super::super::super::api::TagValue,
88    > {
89        &self.tags
90    }
91}