#[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 Segment {
    #[serde(rename = "rid")]
    rid: conjure_object::ResourceIdentifier,
    #[serde(rename = "videoRid")]
    video_rid: conjure_object::ResourceIdentifier,
    #[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 Segment {
    #[inline]
    pub fn rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.rid
    }
    #[inline]
    pub fn video_rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.video_rid
    }
    #[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
    }
}
