/// Representation of a single user-provided video file.
#[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 VideoFile {
    #[serde(rename = "rid")]
    rid: conjure_object::ResourceIdentifier,
    #[serde(rename = "videoRid")]
    video_rid: conjure_object::ResourceIdentifier,
    #[builder(into)]
    #[serde(rename = "title")]
    title: String,
    #[builder(default, into)]
    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
    description: Option<String>,
    #[serde(rename = "createdBy")]
    created_by: conjure_object::ResourceIdentifier,
    #[serde(rename = "createdAt")]
    created_at: conjure_object::DateTime<conjure_object::Utc>,
    #[builder(custom(type = super::VideoFileOriginMetadata, convert = Box::new))]
    #[serde(rename = "originMetadata")]
    origin_metadata: Box<super::VideoFileOriginMetadata>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::VideoFileSegmentsMetadata>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "segmentMetadata",
        skip_serializing_if = "Option::is_none",
        default
    )]
    segment_metadata: Option<Box<super::VideoFileSegmentsMetadata>>,
}
impl VideoFile {
    #[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 title(&self) -> &str {
        &*self.title
    }
    #[inline]
    pub fn description(&self) -> Option<&str> {
        self.description.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn created_by(&self) -> &conjure_object::ResourceIdentifier {
        &self.created_by
    }
    #[inline]
    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
        self.created_at
    }
    #[inline]
    pub fn origin_metadata(&self) -> &super::VideoFileOriginMetadata {
        &*self.origin_metadata
    }
    #[inline]
    pub fn segment_metadata(&self) -> Option<&super::VideoFileSegmentsMetadata> {
        self.segment_metadata.as_ref().map(|o| &**o)
    }
}
