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(
27 default,
28 map(
29 key(type = super::super::super::api::PropertyName),
30 value(type = super::super::super::api::PropertyValue)
31 )
32 )]
33 #[serde(
34 rename = "properties",
35 skip_serializing_if = "std::collections::BTreeMap::is_empty",
36 default
37 )]
38 properties: std::collections::BTreeMap<
39 super::super::super::api::PropertyName,
40 super::super::super::api::PropertyValue,
41 >,
42 #[builder(default, set(item(type = super::super::super::api::Label)))]
43 #[serde(
44 rename = "labels",
45 skip_serializing_if = "std::collections::BTreeSet::is_empty",
46 default
47 )]
48 labels: std::collections::BTreeSet<super::super::super::api::Label>,
49 #[builder(
50 default,
51 custom(
52 type = impl
53 Into<Option<super::ChannelConfig>>,
54 convert = |v|v.into().map(Box::new)
55 )
56 )]
57 #[serde(rename = "channelConfig", skip_serializing_if = "Option::is_none", default)]
58 channel_config: Option<Box<super::ChannelConfig>>,
59 #[builder(default, into)]
60 #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
61 workspace: Option<super::super::super::api::rids::WorkspaceRid>,
62 #[builder(
63 default,
64 set(item(type = super::super::super::scout::rids::api::MarkingRid))
65 )]
66 #[serde(
67 rename = "markingRids",
68 skip_serializing_if = "std::collections::BTreeSet::is_empty",
69 default
70 )]
71 marking_rids: std::collections::BTreeSet<
72 super::super::super::scout::rids::api::MarkingRid,
73 >,
74}
75impl NewDatasetIngestDestination {
76 #[inline]
78 pub fn new() -> Self {
79 Self::builder().build()
80 }
81 #[inline]
82 pub fn dataset_name(&self) -> Option<&str> {
83 self.dataset_name.as_ref().map(|o| &**o)
84 }
85 #[inline]
86 pub fn dataset_description(&self) -> Option<&str> {
87 self.dataset_description.as_ref().map(|o| &**o)
88 }
89 #[inline]
90 pub fn properties(
91 &self,
92 ) -> &std::collections::BTreeMap<
93 super::super::super::api::PropertyName,
94 super::super::super::api::PropertyValue,
95 > {
96 &self.properties
97 }
98 #[inline]
99 pub fn labels(
100 &self,
101 ) -> &std::collections::BTreeSet<super::super::super::api::Label> {
102 &self.labels
103 }
104 #[inline]
105 pub fn channel_config(&self) -> Option<&super::ChannelConfig> {
106 self.channel_config.as_ref().map(|o| &**o)
107 }
108 #[inline]
111 pub fn workspace(&self) -> Option<&super::super::super::api::rids::WorkspaceRid> {
112 self.workspace.as_ref().map(|o| &*o)
113 }
114 #[inline]
117 pub fn marking_rids(
118 &self,
119 ) -> &std::collections::BTreeSet<super::super::super::scout::rids::api::MarkingRid> {
120 &self.marking_rids
121 }
122}