Skip to main content

nominal_api/conjure/objects/scout/video/api/
create_video_request.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 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 = String, into)))]
20    #[serde(
21        rename = "labels",
22        skip_serializing_if = "std::collections::BTreeSet::is_empty",
23        default
24    )]
25    labels: std::collections::BTreeSet<String>,
26    #[builder(default, map(key(type = String, into), value(type = String, into)))]
27    #[serde(
28        rename = "properties",
29        skip_serializing_if = "std::collections::BTreeMap::is_empty",
30        default
31    )]
32    properties: std::collections::BTreeMap<String, String>,
33    #[builder(
34        default,
35        custom(
36            type = impl
37            Into<Option<super::VideoOriginMetadata>>,
38            convert = |v|v.into().map(Box::new)
39        )
40    )]
41    #[serde(rename = "originMetadata", skip_serializing_if = "Option::is_none", default)]
42    origin_metadata: Option<Box<super::VideoOriginMetadata>>,
43    #[builder(default, into)]
44    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
45    workspace: Option<conjure_object::ResourceIdentifier>,
46    #[builder(default, set(item(type = super::super::super::rids::api::MarkingRid)))]
47    #[serde(
48        rename = "markingRids",
49        skip_serializing_if = "std::collections::BTreeSet::is_empty",
50        default
51    )]
52    marking_rids: std::collections::BTreeSet<super::super::super::rids::api::MarkingRid>,
53}
54impl CreateVideoRequest {
55    /// Constructs a new instance of the type.
56    #[inline]
57    pub fn new(title: impl Into<String>) -> Self {
58        Self::builder().title(title).build()
59    }
60    #[inline]
61    pub fn title(&self) -> &str {
62        &*self.title
63    }
64    #[inline]
65    pub fn description(&self) -> Option<&str> {
66        self.description.as_ref().map(|o| &**o)
67    }
68    #[inline]
69    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
70        &self.labels
71    }
72    #[inline]
73    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
74        &self.properties
75    }
76    #[deprecated(
77        note = "deprecated in favor of per-file VideoFileOriginMetadata. Will be removed after April 15th."
78    )]
79    #[inline]
80    pub fn origin_metadata(&self) -> Option<&super::VideoOriginMetadata> {
81        self.origin_metadata.as_ref().map(|o| &**o)
82    }
83    /// The workspace in which to create the video. If not provided, the video will be created in
84    /// the default workspace for the user's organization, if the default workspace for the
85    /// organization is configured.
86    #[inline]
87    pub fn workspace(&self) -> Option<&conjure_object::ResourceIdentifier> {
88        self.workspace.as_ref().map(|o| &*o)
89    }
90    /// The markings to apply to the created video.
91    /// If not provided, the video will be visible to all users in the same workspace.
92    #[inline]
93    pub fn marking_rids(
94        &self,
95    ) -> &std::collections::BTreeSet<super::super::super::rids::api::MarkingRid> {
96        &self.marking_rids
97    }
98}