Skip to main content

nominal_api/conjure/objects/ingest/manifest/
manifest_output.rs

1/// Describes a single output file from a containerized extractor.
2/// This is written by the container in manifest.json.
3#[derive(
4    Debug,
5    Clone,
6    conjure_object::serde::Serialize,
7    conjure_object::serde::Deserialize,
8    PartialEq,
9    Eq,
10    PartialOrd,
11    Ord,
12    Hash
13)]
14#[serde(crate = "conjure_object::serde")]
15#[conjure_object::private::staged_builder::staged_builder]
16#[builder(crate = conjure_object::private::staged_builder, update, inline)]
17pub struct ManifestOutput {
18    #[serde(rename = "ingestType")]
19    ingest_type: super::ManifestIngestType,
20    #[builder(into)]
21    #[serde(rename = "relativePath")]
22    relative_path: String,
23    #[builder(default, map(key(type = String, into), value(type = String, into)))]
24    #[serde(
25        rename = "tagColumns",
26        skip_serializing_if = "std::collections::BTreeMap::is_empty",
27        default
28    )]
29    tag_columns: std::collections::BTreeMap<String, String>,
30    #[builder(default, into)]
31    #[serde(rename = "channelPrefix", skip_serializing_if = "Option::is_none", default)]
32    channel_prefix: Option<String>,
33}
34impl ManifestOutput {
35    /// Constructs a new instance of the type.
36    #[inline]
37    pub fn new(
38        ingest_type: super::ManifestIngestType,
39        relative_path: impl Into<String>,
40    ) -> Self {
41        Self::builder().ingest_type(ingest_type).relative_path(relative_path).build()
42    }
43    /// The type of ingestion for this output file
44    #[inline]
45    pub fn ingest_type(&self) -> &super::ManifestIngestType {
46        &self.ingest_type
47    }
48    /// Relative path to the output file within OUTPUT_DIR.
49    /// Example: "telemetry.csv" or "data/sensor_readings.parquet"
50    #[inline]
51    pub fn relative_path(&self) -> &str {
52        &*self.relative_path
53    }
54    /// Optional mapping of tag names to column names for CSV/Parquet ingestion.
55    /// Example: {"vehicle_id": "veh_id", "mission_id": "msn_id"}
56    #[inline]
57    pub fn tag_columns(&self) -> &std::collections::BTreeMap<String, String> {
58        &self.tag_columns
59    }
60    /// Optional prefix to prepend to channel names during ingestion.
61    /// Example: "telemetry/" would create channels like "telemetry/speed", "telemetry/altitude"
62    #[inline]
63    pub fn channel_prefix(&self) -> Option<&str> {
64        self.channel_prefix.as_ref().map(|o| &**o)
65    }
66}