Skip to main content

nominal_api/conjure/objects/scout/video/api/
video.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    conjure_object::private::DeriveWith
7)]
8#[serde(crate = "conjure_object::serde")]
9#[derive_with(PartialEq, Eq, PartialOrd, Ord, Hash)]
10#[conjure_object::private::staged_builder::staged_builder]
11#[builder(crate = conjure_object::private::staged_builder, update, inline)]
12pub struct Video {
13    #[serde(rename = "rid")]
14    rid: conjure_object::ResourceIdentifier,
15    #[builder(into)]
16    #[serde(rename = "title")]
17    title: String,
18    #[builder(default, into)]
19    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
20    description: Option<String>,
21    #[builder(default, set(item(type = String, into)))]
22    #[serde(
23        rename = "labels",
24        skip_serializing_if = "std::collections::BTreeSet::is_empty",
25        default
26    )]
27    labels: std::collections::BTreeSet<String>,
28    #[builder(default, map(key(type = String, into), value(type = String, into)))]
29    #[serde(
30        rename = "properties",
31        skip_serializing_if = "std::collections::BTreeMap::is_empty",
32        default
33    )]
34    properties: std::collections::BTreeMap<String, String>,
35    #[serde(rename = "createdBy")]
36    created_by: conjure_object::ResourceIdentifier,
37    #[serde(rename = "createdAt")]
38    created_at: conjure_object::DateTime<conjure_object::Utc>,
39    #[serde(rename = "isArchived")]
40    is_archived: bool,
41    #[builder(
42        default,
43        custom(
44            type = impl
45            Into<Option<super::VideoOriginMetadata>>,
46            convert = |v|v.into().map(Box::new)
47        )
48    )]
49    #[serde(rename = "originMetadata", skip_serializing_if = "Option::is_none", default)]
50    origin_metadata: Option<Box<super::VideoOriginMetadata>>,
51    #[builder(
52        default,
53        custom(
54            type = impl
55            Into<Option<super::VideoAllSegmentsMetadata>>,
56            convert = |v|v.into().map(Box::new)
57        )
58    )]
59    #[serde(
60        rename = "allSegmentsMetadata",
61        skip_serializing_if = "Option::is_none",
62        default
63    )]
64    all_segments_metadata: Option<Box<super::VideoAllSegmentsMetadata>>,
65}
66impl Video {
67    #[inline]
68    pub fn rid(&self) -> &conjure_object::ResourceIdentifier {
69        &self.rid
70    }
71    #[inline]
72    pub fn title(&self) -> &str {
73        &*self.title
74    }
75    #[inline]
76    pub fn description(&self) -> Option<&str> {
77        self.description.as_ref().map(|o| &**o)
78    }
79    #[inline]
80    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
81        &self.labels
82    }
83    #[inline]
84    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
85        &self.properties
86    }
87    #[inline]
88    pub fn created_by(&self) -> &conjure_object::ResourceIdentifier {
89        &self.created_by
90    }
91    #[inline]
92    pub fn created_at(&self) -> conjure_object::DateTime<conjure_object::Utc> {
93        self.created_at
94    }
95    #[inline]
96    pub fn is_archived(&self) -> bool {
97        self.is_archived
98    }
99    #[deprecated(
100        note = "deprecated in favor of per-file VideoFileOriginMetadata. Will be removed after April 15th."
101    )]
102    #[inline]
103    pub fn origin_metadata(&self) -> Option<&super::VideoOriginMetadata> {
104        self.origin_metadata.as_ref().map(|o| &**o)
105    }
106    #[inline]
107    pub fn all_segments_metadata(&self) -> Option<&super::VideoAllSegmentsMetadata> {
108        self.all_segments_metadata.as_ref().map(|o| &**o)
109    }
110}