nominal_api/conjure/objects/ingest/api/
new_dataset_ingest_destination.rs1#[derive(
2 Debug,
3 Clone,
4 conjure_object::serde::Serialize,
5 conjure_object::serde::Deserialize,
6 PartialEq,
7 Eq,
8 PartialOrd,
9 Ord,
10 Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct NewDatasetIngestDestination {
16 #[builder(default, into)]
17 #[serde(rename = "datasetName", skip_serializing_if = "Option::is_none", default)]
18 dataset_name: Option<String>,
19 #[builder(default, into)]
20 #[serde(
21 rename = "datasetDescription",
22 skip_serializing_if = "Option::is_none",
23 default
24 )]
25 dataset_description: Option<String>,
26 #[builder(default, map(key(type = String, into), value(type = String, into)))]
27 #[serde(
28 rename = "properties",
29 skip_serializing_if = "std::collections::BTreeMap::is_empty",
30 default
31 )]
32 properties: std::collections::BTreeMap<String, String>,
33 #[builder(default, set(item(type = String, into)))]
34 #[serde(
35 rename = "labels",
36 skip_serializing_if = "std::collections::BTreeSet::is_empty",
37 default
38 )]
39 labels: std::collections::BTreeSet<String>,
40 #[builder(
41 default,
42 custom(
43 type = impl
44 Into<Option<super::ChannelConfig>>,
45 convert = |v|v.into().map(Box::new)
46 )
47 )]
48 #[serde(rename = "channelConfig", skip_serializing_if = "Option::is_none", default)]
49 channel_config: Option<Box<super::ChannelConfig>>,
50 #[builder(default, into)]
51 #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
52 workspace: Option<conjure_object::ResourceIdentifier>,
53 #[builder(
54 default,
55 set(item(type = super::super::super::scout::rids::api::MarkingRid))
56 )]
57 #[serde(
58 rename = "markingRids",
59 skip_serializing_if = "std::collections::BTreeSet::is_empty",
60 default
61 )]
62 marking_rids: std::collections::BTreeSet<
63 super::super::super::scout::rids::api::MarkingRid,
64 >,
65}
66impl NewDatasetIngestDestination {
67 #[inline]
69 pub fn new() -> Self {
70 Self::builder().build()
71 }
72 #[inline]
73 pub fn dataset_name(&self) -> Option<&str> {
74 self.dataset_name.as_ref().map(|o| &**o)
75 }
76 #[inline]
77 pub fn dataset_description(&self) -> Option<&str> {
78 self.dataset_description.as_ref().map(|o| &**o)
79 }
80 #[inline]
81 pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
82 &self.properties
83 }
84 #[inline]
85 pub fn labels(&self) -> &std::collections::BTreeSet<String> {
86 &self.labels
87 }
88 #[inline]
89 pub fn channel_config(&self) -> Option<&super::ChannelConfig> {
90 self.channel_config.as_ref().map(|o| &**o)
91 }
92 #[inline]
95 pub fn workspace(&self) -> Option<&conjure_object::ResourceIdentifier> {
96 self.workspace.as_ref().map(|o| &*o)
97 }
98 #[inline]
101 pub fn marking_rids(
102 &self,
103 ) -> &std::collections::BTreeSet<super::super::super::scout::rids::api::MarkingRid> {
104 &self.marking_rids
105 }
106}