/// Describes a single output file from a containerized extractor.
/// This is written by the container in manifest.json.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct ManifestOutput {
    #[serde(rename = "ingestType")]
    ingest_type: super::ManifestIngestType,
    #[builder(into)]
    #[serde(rename = "relativePath")]
    relative_path: String,
    #[builder(default, map(key(type = String, into), value(type = String, into)))]
    #[serde(
        rename = "tagColumns",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    tag_columns: std::collections::BTreeMap<String, String>,
    #[builder(default, into)]
    #[serde(rename = "channelPrefix", skip_serializing_if = "Option::is_none", default)]
    channel_prefix: Option<String>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::ManifestTimestampMetadata>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "timestampMetadata",
        skip_serializing_if = "Option::is_none",
        default
    )]
    timestamp_metadata: Option<Box<super::ManifestTimestampMetadata>>,
}
impl ManifestOutput {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        ingest_type: super::ManifestIngestType,
        relative_path: impl Into<String>,
    ) -> Self {
        Self::builder().ingest_type(ingest_type).relative_path(relative_path).build()
    }
    /// The type of ingestion for this output file
    #[inline]
    pub fn ingest_type(&self) -> &super::ManifestIngestType {
        &self.ingest_type
    }
    /// Relative path to the output file within OUTPUT_DIR.
    /// Example: "telemetry.csv" or "data/sensor_readings.parquet"
    #[inline]
    pub fn relative_path(&self) -> &str {
        &*self.relative_path
    }
    /// Optional mapping of tag names to column names for CSV/Parquet ingestion.
    /// Example: {"vehicle_id": "veh_id", "mission_id": "msn_id"}
    #[inline]
    pub fn tag_columns(&self) -> &std::collections::BTreeMap<String, String> {
        &self.tag_columns
    }
    /// Optional prefix to prepend to channel names during ingestion.
    /// Example: "telemetry/" would create channels like "telemetry/speed", "telemetry/altitude"
    #[inline]
    pub fn channel_prefix(&self) -> Option<&str> {
        self.channel_prefix.as_ref().map(|o| &**o)
    }
    /// Optional per-output timestamp metadata. When present it overrides the job-level
    /// timestamp metadata for this output, letting outputs of different formats (e.g. a CSV
    /// and a JSON_L file in the same job) use different timestamp fields. When absent the
    /// job-level timestamp metadata is used, preserving existing behavior.
    #[inline]
    pub fn timestamp_metadata(&self) -> Option<&super::ManifestTimestampMetadata> {
        self.timestamp_metadata.as_ref().map(|o| &**o)
    }
}
