nominal_api/conjure/objects/scout/video/api/
create_video_request.rs1#[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 CreateVideoRequest {
13 #[builder(into)]
14 #[serde(rename = "title")]
15 title: String,
16 #[builder(default, into)]
17 #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
18 description: Option<String>,
19 #[builder(default, set(item(type = super::super::super::super::api::Label)))]
20 #[serde(
21 rename = "labels",
22 skip_serializing_if = "std::collections::BTreeSet::is_empty",
23 default
24 )]
25 labels: std::collections::BTreeSet<super::super::super::super::api::Label>,
26 #[builder(
27 default,
28 map(
29 key(type = super::super::super::super::api::PropertyName),
30 value(type = super::super::super::super::api::PropertyValue)
31 )
32 )]
33 #[serde(
34 rename = "properties",
35 skip_serializing_if = "std::collections::BTreeMap::is_empty",
36 default
37 )]
38 properties: std::collections::BTreeMap<
39 super::super::super::super::api::PropertyName,
40 super::super::super::super::api::PropertyValue,
41 >,
42 #[builder(
43 default,
44 custom(
45 type = impl
46 Into<Option<super::VideoOriginMetadata>>,
47 convert = |v|v.into().map(Box::new)
48 )
49 )]
50 #[serde(rename = "originMetadata", skip_serializing_if = "Option::is_none", default)]
51 origin_metadata: Option<Box<super::VideoOriginMetadata>>,
52 #[builder(default, into)]
53 #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
54 workspace: Option<super::super::super::super::api::rids::WorkspaceRid>,
55 #[builder(default, set(item(type = super::super::super::rids::api::MarkingRid)))]
56 #[serde(
57 rename = "markingRids",
58 skip_serializing_if = "std::collections::BTreeSet::is_empty",
59 default
60 )]
61 marking_rids: std::collections::BTreeSet<super::super::super::rids::api::MarkingRid>,
62}
63impl CreateVideoRequest {
64 #[inline]
66 pub fn new(title: impl Into<String>) -> Self {
67 Self::builder().title(title).build()
68 }
69 #[inline]
70 pub fn title(&self) -> &str {
71 &*self.title
72 }
73 #[inline]
74 pub fn description(&self) -> Option<&str> {
75 self.description.as_ref().map(|o| &**o)
76 }
77 #[inline]
78 pub fn labels(
79 &self,
80 ) -> &std::collections::BTreeSet<super::super::super::super::api::Label> {
81 &self.labels
82 }
83 #[inline]
84 pub fn properties(
85 &self,
86 ) -> &std::collections::BTreeMap<
87 super::super::super::super::api::PropertyName,
88 super::super::super::super::api::PropertyValue,
89 > {
90 &self.properties
91 }
92 #[deprecated(
93 note = "deprecated in favor of per-file VideoFileOriginMetadata. Will be removed after April 15th."
94 )]
95 #[inline]
96 pub fn origin_metadata(&self) -> Option<&super::VideoOriginMetadata> {
97 self.origin_metadata.as_ref().map(|o| &**o)
98 }
99 #[inline]
103 pub fn workspace(
104 &self,
105 ) -> Option<&super::super::super::super::api::rids::WorkspaceRid> {
106 self.workspace.as_ref().map(|o| &*o)
107 }
108 #[inline]
111 pub fn marking_rids(
112 &self,
113 ) -> &std::collections::BTreeSet<super::super::super::rids::api::MarkingRid> {
114 &self.marking_rids
115 }
116}