#[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 Video {
    #[serde(rename = "rid")]
    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>,
    #[builder(default, set(item(type = String, into)))]
    #[serde(
        rename = "labels",
        skip_serializing_if = "std::collections::BTreeSet::is_empty",
        default
    )]
    labels: std::collections::BTreeSet<String>,
    #[builder(default, map(key(type = String, into), value(type = String, into)))]
    #[serde(
        rename = "properties",
        skip_serializing_if = "std::collections::BTreeMap::is_empty",
        default
    )]
    properties: std::collections::BTreeMap<String, String>,
    #[serde(rename = "createdBy")]
    created_by: conjure_object::ResourceIdentifier,
    #[serde(rename = "createdAt")]
    created_at: conjure_object::DateTime<conjure_object::Utc>,
    #[serde(rename = "isArchived")]
    is_archived: bool,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::VideoOriginMetadata>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(rename = "originMetadata", skip_serializing_if = "Option::is_none", default)]
    origin_metadata: Option<Box<super::VideoOriginMetadata>>,
    #[builder(
        default,
        custom(
            type = impl
            Into<Option<super::VideoAllSegmentsMetadata>>,
            convert = |v|v.into().map(Box::new)
        )
    )]
    #[serde(
        rename = "allSegmentsMetadata",
        skip_serializing_if = "Option::is_none",
        default
    )]
    all_segments_metadata: Option<Box<super::VideoAllSegmentsMetadata>>,
}
impl Video {
    #[inline]
    pub fn rid(&self) -> &conjure_object::ResourceIdentifier {
        &self.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 labels(&self) -> &std::collections::BTreeSet<String> {
        &self.labels
    }
    #[inline]
    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
        &self.properties
    }
    #[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 is_archived(&self) -> bool {
        self.is_archived
    }
    #[deprecated(
        note = "deprecated in favor of per-file VideoFileOriginMetadata. Will be removed after April 15th."
    )]
    #[inline]
    pub fn origin_metadata(&self) -> Option<&super::VideoOriginMetadata> {
        self.origin_metadata.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn all_segments_metadata(&self) -> Option<&super::VideoAllSegmentsMetadata> {
        self.all_segments_metadata.as_ref().map(|o| &**o)
    }
}
