Skip to main content

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

1/// Request to import a spatial data file (e.g. LAS, LAZ, PLY, PCD, E57, PCAP).
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 ImportFileRequest {
14    #[builder(
15        custom(type = super::super::super::super::api::Handle, convert = Box::new)
16    )]
17    #[serde(rename = "source")]
18    source: Box<super::super::super::super::api::Handle>,
19    #[builder(default, into)]
20    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
21    title: Option<String>,
22    #[builder(default, into)]
23    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
24    description: Option<String>,
25    #[builder(default, set(item(type = super::super::super::super::api::Label)))]
26    #[serde(
27        rename = "labels",
28        skip_serializing_if = "std::collections::BTreeSet::is_empty",
29        default
30    )]
31    labels: std::collections::BTreeSet<super::super::super::super::api::Label>,
32    #[builder(
33        default,
34        map(
35            key(type = super::super::super::super::api::PropertyName),
36            value(type = super::super::super::super::api::PropertyValue)
37        )
38    )]
39    #[serde(
40        rename = "properties",
41        skip_serializing_if = "std::collections::BTreeMap::is_empty",
42        default
43    )]
44    properties: std::collections::BTreeMap<
45        super::super::super::super::api::PropertyName,
46        super::super::super::super::api::PropertyValue,
47    >,
48    #[builder(custom(type = super::SpatialTypeMetadata, convert = Box::new))]
49    #[serde(rename = "typeMetadata")]
50    type_metadata: Box<super::SpatialTypeMetadata>,
51    #[builder(default, into)]
52    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
53    workspace: Option<super::super::super::super::api::rids::WorkspaceRid>,
54    #[builder(default, set(item(type = super::super::super::rids::api::MarkingRid)))]
55    #[serde(
56        rename = "markingRids",
57        skip_serializing_if = "std::collections::BTreeSet::is_empty",
58        default
59    )]
60    marking_rids: std::collections::BTreeSet<super::super::super::rids::api::MarkingRid>,
61}
62impl ImportFileRequest {
63    /// Constructs a new instance of the type.
64    #[inline]
65    pub fn new(
66        source: super::super::super::super::api::Handle,
67        type_metadata: super::SpatialTypeMetadata,
68    ) -> Self {
69        Self::builder().source(source).type_metadata(type_metadata).build()
70    }
71    /// The location of the file to import.
72    #[inline]
73    pub fn source(&self) -> &super::super::super::super::api::Handle {
74        &*self.source
75    }
76    #[inline]
77    pub fn title(&self) -> Option<&str> {
78        self.title.as_ref().map(|o| &**o)
79    }
80    #[inline]
81    pub fn description(&self) -> Option<&str> {
82        self.description.as_ref().map(|o| &**o)
83    }
84    #[inline]
85    pub fn labels(
86        &self,
87    ) -> &std::collections::BTreeSet<super::super::super::super::api::Label> {
88        &self.labels
89    }
90    #[inline]
91    pub fn properties(
92        &self,
93    ) -> &std::collections::BTreeMap<
94        super::super::super::super::api::PropertyName,
95        super::super::super::super::api::PropertyValue,
96    > {
97        &self.properties
98    }
99    #[inline]
100    pub fn type_metadata(&self) -> &super::SpatialTypeMetadata {
101        &*self.type_metadata
102    }
103    /// The workspace in which to create the spatial asset. If not provided, the asset will be created in
104    /// the default workspace for the user's organization.
105    #[inline]
106    pub fn workspace(
107        &self,
108    ) -> Option<&super::super::super::super::api::rids::WorkspaceRid> {
109        self.workspace.as_ref().map(|o| &*o)
110    }
111    /// The markings to apply to the created spatial asset.
112    #[inline]
113    pub fn marking_rids(
114        &self,
115    ) -> &std::collections::BTreeSet<super::super::super::rids::api::MarkingRid> {
116        &self.marking_rids
117    }
118}