/// Metadata specific to video files.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    conjure_object::private::DeriveWith
)]
#[serde(crate = "conjure_object::serde")]
#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct VideoFileMetadata {
    #[builder(
        custom(
            type = super::super::scout::video::api::VideoFileTimestampManifest,
            convert = Box::new
        )
    )]
    #[serde(rename = "timestampManifest")]
    timestamp_manifest: Box<super::super::scout::video::api::VideoFileTimestampManifest>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::VideoSegmentsMetadata>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "segmentMetadata",
        skip_serializing_if = "Option::is_none",
        default
    )]
    segment_metadata: Option<Box<super::VideoSegmentsMetadata>>,
}
impl VideoFileMetadata {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(
        timestamp_manifest: super::super::scout::video::api::VideoFileTimestampManifest,
    ) -> Self {
        Self::builder().timestamp_manifest(timestamp_manifest).build()
    }
    /// Specifies how to determine absolute timestamps for each frame in the video.
    /// Can be an embedded MCAP manifest, an external sidecar file, or calculated
    /// from a starting offset applied to presentation timestamps.
    #[inline]
    pub fn timestamp_manifest(
        &self,
    ) -> &super::super::scout::video::api::VideoFileTimestampManifest {
        &*self.timestamp_manifest
    }
    /// Cached aggregate metadata about the segments comprising this video file
    /// after segmentation has completed. Includes frame counts, duration, and
    /// frame rate. Empty until segmentation is complete.
    /// Note: Min/max timestamps are stored in DatasetFile.bounds field.
    /// Raw file size is stored in DatasetFile.fileSizeBytes.
    #[inline]
    pub fn segment_metadata(&self) -> Option<&super::VideoSegmentsMetadata> {
        self.segment_metadata.as_ref().map(|o| &**o)
    }
}
