Skip to main content

nominal_api/conjure/objects/ingest/api/
ingest_mcap_request.rs

1#[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(
33        default,
34        map(
35            key(type = super::super::super::api::PropertyName),
36            value(type = 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::api::PropertyName,
46        super::super::super::api::PropertyValue,
47    >,
48    #[builder(default, set(item(type = super::super::super::api::Label)))]
49    #[serde(
50        rename = "labels",
51        skip_serializing_if = "std::collections::BTreeSet::is_empty",
52        default
53    )]
54    labels: std::collections::BTreeSet<super::super::super::api::Label>,
55    #[builder(default, into)]
56    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
57    title: Option<String>,
58    #[builder(default, into)]
59    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
60    description: Option<String>,
61    #[builder(default, into)]
62    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
63    workspace: Option<super::super::super::api::rids::WorkspaceRid>,
64}
65impl IngestMcapRequest {
66    /// Constructs a new instance of the type.
67    #[inline]
68    pub fn new() -> Self {
69        Self::builder().build()
70    }
71    /// List of files in S3 to be ingested. These should be ordered by time, as data will be ingested and
72    /// concatenated across all the files.
73    /// Note: only a single files are currently supported, this field is mostly for forward compatibility.
74    #[inline]
75    pub fn sources(&self) -> &[super::IngestSource] {
76        &*self.sources
77    }
78    #[inline]
79    pub fn channel_config(&self) -> &[super::McapChannelConfig] {
80        &*self.channel_config
81    }
82    /// Config to define which channels in the mcap should be ingested. The default is to ingest only
83    /// channels with config, otherwise the mcap may not be supported.
84    #[inline]
85    pub fn channels(&self) -> Option<&super::McapChannels> {
86        self.channels.as_ref().map(|o| &**o)
87    }
88    #[inline]
89    pub fn properties(
90        &self,
91    ) -> &std::collections::BTreeMap<
92        super::super::super::api::PropertyName,
93        super::super::super::api::PropertyValue,
94    > {
95        &self.properties
96    }
97    #[inline]
98    pub fn labels(
99        &self,
100    ) -> &std::collections::BTreeSet<super::super::super::api::Label> {
101        &self.labels
102    }
103    #[inline]
104    pub fn title(&self) -> Option<&str> {
105        self.title.as_ref().map(|o| &**o)
106    }
107    #[inline]
108    pub fn description(&self) -> Option<&str> {
109        self.description.as_ref().map(|o| &**o)
110    }
111    /// The workspace in which to create the dataset or video. If not provided, the dataset or video
112    /// will be created in the default workspace for the user's organization, if the default
113    /// workspace for the organization is configured.
114    #[inline]
115    pub fn workspace(&self) -> Option<&super::super::super::api::rids::WorkspaceRid> {
116        self.workspace.as_ref().map(|o| &*o)
117    }
118}