#[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 VideoAllSegmentsMetadata {
    #[serde(rename = "rid")]
    rid: conjure_object::ResourceIdentifier,
    #[serde(rename = "numFrames")]
    num_frames: i32,
    #[serde(rename = "numSegments")]
    num_segments: i32,
    #[builder(default, into)]
    #[serde(rename = "scaleFactor", skip_serializing_if = "Option::is_none", default)]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    scale_factor: Option<f64>,
    #[builder(
        custom(type = super::super::super::super::api::Timestamp, convert = Box::new)
    )]
    #[serde(rename = "minAbsoluteTimestamp")]
    min_absolute_timestamp: Box<super::super::super::super::api::Timestamp>,
    #[builder(
        custom(type = super::super::super::super::api::Timestamp, convert = Box::new)
    )]
    #[serde(rename = "maxAbsoluteTimestamp")]
    max_absolute_timestamp: Box<super::super::super::super::api::Timestamp>,
    #[serde(rename = "mediaDurationSeconds")]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    media_duration_seconds: f64,
    #[serde(rename = "mediaFrameRate")]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    media_frame_rate: f64,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::super::api::Timestamp>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "minTimestamp", skip_serializing_if = "Option::is_none", default)]
    min_timestamp: Option<Box<super::super::super::super::api::Timestamp>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::super::super::super::api::Timestamp>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "maxTimestamp", skip_serializing_if = "Option::is_none", default)]
    max_timestamp: Option<Box<super::super::super::super::api::Timestamp>>,
    #[builder(default, into)]
    #[serde(
        rename = "durationSeconds",
        skip_serializing_if = "Option::is_none",
        default
    )]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    duration_seconds: Option<f64>,
    #[builder(default, into)]
    #[serde(rename = "frameRate", skip_serializing_if = "Option::is_none", default)]
    #[derive_with(with = conjure_object::private::DoubleWrapper)]
    frame_rate: Option<f64>,
}
impl VideoAllSegmentsMetadata {
    #[inline]
    pub fn rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.rid
    }
    #[inline]
    pub fn num_frames(&self) -> i32 {
        self.num_frames
    }
    #[inline]
    pub fn num_segments(&self) -> i32 {
        self.num_segments
    }
    /// deprecated, in favor of per-file VideoFileSegmentsMetadata scaleFactor. Will be removed after April 15th.
    #[inline]
    pub fn scale_factor(&self) -> Option<f64> {
        self.scale_factor.as_ref().map(|o| *o)
    }
    #[inline]
    pub fn min_absolute_timestamp(&self) -> &super::super::super::super::api::Timestamp {
        &*self.min_absolute_timestamp
    }
    /// the timestamp corresponding to absolute starting timestamp plus absolute duration of the video.
    #[inline]
    pub fn max_absolute_timestamp(&self) -> &super::super::super::super::api::Timestamp {
        &*self.max_absolute_timestamp
    }
    #[inline]
    pub fn media_duration_seconds(&self) -> f64 {
        self.media_duration_seconds
    }
    /// The average media frame rate (FPS) of the video calculated as total frames / duration in seconds.
    #[inline]
    pub fn media_frame_rate(&self) -> f64 {
        self.media_frame_rate
    }
    /// deprecated. Will be removed after April 15th.
    #[inline]
    pub fn min_timestamp(&self) -> Option<&super::super::super::super::api::Timestamp> {
        self.min_timestamp.as_ref().map(|o| &**o)
    }
    /// deprecated. Will be removed after April 15th.
    #[inline]
    pub fn max_timestamp(&self) -> Option<&super::super::super::super::api::Timestamp> {
        self.max_timestamp.as_ref().map(|o| &**o)
    }
    /// deprecated. Will be removed after April 15th.
    #[inline]
    pub fn duration_seconds(&self) -> Option<f64> {
        self.duration_seconds.as_ref().map(|o| *o)
    }
    /// deprecated. Will be removed after April 15th.
    #[inline]
    pub fn frame_rate(&self) -> Option<f64> {
        self.frame_rate.as_ref().map(|o| *o)
    }
}
