nominal-api 0.1239.0

API bindings for the Nominal platform
Documentation
/// Segment for V2 channel-based video API (without videoRid).
#[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 SegmentV2 {
    #[serde(rename = "rid")]
    rid: super::super::super::super::api::rids::SegmentRid,
    #[builder(default, into)]
    #[serde(rename = "datasetFileId", skip_serializing_if = "Option::is_none", default)]
    dataset_file_id: Option<conjure_object::Uuid>,
    #[builder(
        custom(type = super::super::super::super::api::Handle, convert = Box::new)
    )]
    #[serde(rename = "dataHandle")]
    data_handle: Box<super::super::super::super::api::Handle>,
    #[serde(rename = "frameRate")]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    frame_rate: f64,
    #[serde(rename = "durationSeconds")]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    duration_seconds: f64,
    #[builder(custom(type = super::SegmentTimestamps, convert = Box::new))]
    #[serde(rename = "timestamps")]
    timestamps: Box<super::SegmentTimestamps>,
}
impl SegmentV2 {
    #[inline]
    pub fn rid(&self) -> &super::super::super::super::api::rids::SegmentRid {
        &self.rid
    }
    /// The dataset file ID that this segment belongs to.
    #[inline]
    pub fn dataset_file_id(&self) -> Option<conjure_object::Uuid> {
        self.dataset_file_id.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn data_handle(&self) -> &super::super::super::super::api::Handle {
        &*self.data_handle
    }
    /// The average frame rate (FPS) of the segment calculated as total frames / duration in seconds.
    #[inline]
    pub fn frame_rate(&self) -> f64 {
        self.frame_rate
    }
    /// The duration of a segment in media time.
    #[inline]
    pub fn duration_seconds(&self) -> f64 {
        self.duration_seconds
    }
    /// for videos with frame-level timestamps, we provide mappings, otherwise we just include a single list
    /// of timestamps.
    #[inline]
    pub fn timestamps(&self) -> &super::SegmentTimestamps {
        &*self.timestamps
    }
}