nominal_api/conjure/objects/ingest/api/
ingest_mcap_request.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 IngestMcapRequest {
16 #[builder(default, list(item(type = super::IngestSource)))]
17 #[serde(rename = "sources", skip_serializing_if = "Vec::is_empty", default)]
18 sources: Vec<super::IngestSource>,
19 #[builder(default, list(item(type = super::McapChannelConfig)))]
20 #[serde(rename = "channelConfig", skip_serializing_if = "Vec::is_empty", default)]
21 channel_config: Vec<super::McapChannelConfig>,
22 #[builder(
23 default,
24 custom(
25 type = impl
26 Into<Option<super::McapChannels>>,
27 convert = |v|v.into().map(Box::new)
28 )
29 )]
30 #[serde(rename = "channels", skip_serializing_if = "Option::is_none", default)]
31 channels: Option<Box<super::McapChannels>>,
32 #[builder(default, map(key(type = String, into), value(type = String, into)))]
33 #[serde(
34 rename = "properties",
35 skip_serializing_if = "std::collections::BTreeMap::is_empty",
36 default
37 )]
38 properties: std::collections::BTreeMap<String, String>,
39 #[builder(default, set(item(type = String, into)))]
40 #[serde(
41 rename = "labels",
42 skip_serializing_if = "std::collections::BTreeSet::is_empty",
43 default
44 )]
45 labels: std::collections::BTreeSet<String>,
46 #[builder(default, into)]
47 #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
48 title: Option<String>,
49 #[builder(default, into)]
50 #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
51 description: Option<String>,
52 #[builder(default, into)]
53 #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
54 workspace: Option<conjure_object::ResourceIdentifier>,
55}
56impl IngestMcapRequest {
57 #[inline]
59 pub fn new() -> Self {
60 Self::builder().build()
61 }
62 #[inline]
66 pub fn sources(&self) -> &[super::IngestSource] {
67 &*self.sources
68 }
69 #[inline]
70 pub fn channel_config(&self) -> &[super::McapChannelConfig] {
71 &*self.channel_config
72 }
73 #[inline]
76 pub fn channels(&self) -> Option<&super::McapChannels> {
77 self.channels.as_ref().map(|o| &**o)
78 }
79 #[inline]
80 pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
81 &self.properties
82 }
83 #[inline]
84 pub fn labels(&self) -> &std::collections::BTreeSet<String> {
85 &self.labels
86 }
87 #[inline]
88 pub fn title(&self) -> Option<&str> {
89 self.title.as_ref().map(|o| &**o)
90 }
91 #[inline]
92 pub fn description(&self) -> Option<&str> {
93 self.description.as_ref().map(|o| &**o)
94 }
95 #[inline]
99 pub fn workspace(&self) -> Option<&conjure_object::ResourceIdentifier> {
100 self.workspace.as_ref().map(|o| &*o)
101 }
102}