Skip to main content

nominal_api/conjure/objects/ingest/api/
new_video_ingest_destination.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct NewVideoIngestDestination {
16    #[builder(default, into)]
17    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
18    title: Option<String>,
19    #[builder(default, into)]
20    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
21    description: Option<String>,
22    #[builder(default, map(key(type = String, into), value(type = String, into)))]
23    #[serde(
24        rename = "properties",
25        skip_serializing_if = "std::collections::BTreeMap::is_empty",
26        default
27    )]
28    properties: std::collections::BTreeMap<String, String>,
29    #[builder(default, set(item(type = String, into)))]
30    #[serde(
31        rename = "labels",
32        skip_serializing_if = "std::collections::BTreeSet::is_empty",
33        default
34    )]
35    labels: std::collections::BTreeSet<String>,
36    #[builder(
37        default,
38        custom(
39            type = impl
40            Into<Option<super::VideoFileIngestDetails>>,
41            convert = |v|v.into().map(Box::new)
42        )
43    )]
44    #[serde(
45        rename = "videoFileDetails",
46        skip_serializing_if = "Option::is_none",
47        default
48    )]
49    video_file_details: Option<Box<super::VideoFileIngestDetails>>,
50    #[builder(default, into)]
51    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
52    workspace: Option<conjure_object::ResourceIdentifier>,
53    #[builder(
54        default,
55        set(item(type = super::super::super::scout::rids::api::MarkingRid))
56    )]
57    #[serde(
58        rename = "markingRids",
59        skip_serializing_if = "std::collections::BTreeSet::is_empty",
60        default
61    )]
62    marking_rids: std::collections::BTreeSet<
63        super::super::super::scout::rids::api::MarkingRid,
64    >,
65}
66impl NewVideoIngestDestination {
67    /// Constructs a new instance of the type.
68    #[inline]
69    pub fn new() -> Self {
70        Self::builder().build()
71    }
72    /// Title of the Video that will get created.
73    /// If not provided, a name is deduced from the ingested file.
74    #[inline]
75    pub fn title(&self) -> Option<&str> {
76        self.title.as_ref().map(|o| &**o)
77    }
78    /// Description that is applied to the newly created video
79    #[inline]
80    pub fn description(&self) -> Option<&str> {
81        self.description.as_ref().map(|o| &**o)
82    }
83    /// Key-Value properties that are applied to the newly created video
84    #[inline]
85    pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
86        &self.properties
87    }
88    /// Labels that are applied to the newly created video
89    #[inline]
90    pub fn labels(&self) -> &std::collections::BTreeSet<String> {
91        &self.labels
92    }
93    /// Metadata to associate with any created video file
94    #[inline]
95    pub fn video_file_details(&self) -> Option<&super::VideoFileIngestDetails> {
96        self.video_file_details.as_ref().map(|o| &**o)
97    }
98    /// The workspace in which to create the video. If not provided, the video will be created in the default workspace for
99    /// the user's organization, if the default workspace for the organization is configured.
100    #[inline]
101    pub fn workspace(&self) -> Option<&conjure_object::ResourceIdentifier> {
102        self.workspace.as_ref().map(|o| &*o)
103    }
104    /// The markings to apply to the created video.
105    /// If not provided, the video will be visible to all users in the same workspace.
106    #[inline]
107    pub fn marking_rids(
108        &self,
109    ) -> &std::collections::BTreeSet<super::super::super::scout::rids::api::MarkingRid> {
110        &self.marking_rids
111    }
112}