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(
23        default,
24        map(
25            key(type = super::super::super::api::PropertyName),
26            value(type = super::super::super::api::PropertyValue)
27        )
28    )]
29    #[serde(
30        rename = "properties",
31        skip_serializing_if = "std::collections::BTreeMap::is_empty",
32        default
33    )]
34    properties: std::collections::BTreeMap<
35        super::super::super::api::PropertyName,
36        super::super::super::api::PropertyValue,
37    >,
38    #[builder(default, set(item(type = super::super::super::api::Label)))]
39    #[serde(
40        rename = "labels",
41        skip_serializing_if = "std::collections::BTreeSet::is_empty",
42        default
43    )]
44    labels: std::collections::BTreeSet<super::super::super::api::Label>,
45    #[builder(
46        default,
47        custom(
48            type = impl
49            Into<Option<super::VideoFileIngestDetails>>,
50            convert = |v|v.into().map(Box::new)
51        )
52    )]
53    #[serde(
54        rename = "videoFileDetails",
55        skip_serializing_if = "Option::is_none",
56        default
57    )]
58    video_file_details: Option<Box<super::VideoFileIngestDetails>>,
59    #[builder(default, into)]
60    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
61    workspace: Option<super::super::super::api::rids::WorkspaceRid>,
62    #[builder(
63        default,
64        set(item(type = super::super::super::scout::rids::api::MarkingRid))
65    )]
66    #[serde(
67        rename = "markingRids",
68        skip_serializing_if = "std::collections::BTreeSet::is_empty",
69        default
70    )]
71    marking_rids: std::collections::BTreeSet<
72        super::super::super::scout::rids::api::MarkingRid,
73    >,
74}
75impl NewVideoIngestDestination {
76    /// Constructs a new instance of the type.
77    #[inline]
78    pub fn new() -> Self {
79        Self::builder().build()
80    }
81    /// Title of the Video that will get created.
82    /// If not provided, a name is deduced from the ingested file.
83    #[inline]
84    pub fn title(&self) -> Option<&str> {
85        self.title.as_ref().map(|o| &**o)
86    }
87    /// Description that is applied to the newly created video
88    #[inline]
89    pub fn description(&self) -> Option<&str> {
90        self.description.as_ref().map(|o| &**o)
91    }
92    /// Key-Value properties that are applied to the newly created video
93    #[inline]
94    pub fn properties(
95        &self,
96    ) -> &std::collections::BTreeMap<
97        super::super::super::api::PropertyName,
98        super::super::super::api::PropertyValue,
99    > {
100        &self.properties
101    }
102    /// Labels that are applied to the newly created video
103    #[inline]
104    pub fn labels(
105        &self,
106    ) -> &std::collections::BTreeSet<super::super::super::api::Label> {
107        &self.labels
108    }
109    /// Metadata to associate with any created video file
110    #[inline]
111    pub fn video_file_details(&self) -> Option<&super::VideoFileIngestDetails> {
112        self.video_file_details.as_ref().map(|o| &**o)
113    }
114    /// The workspace in which to create the video. If not provided, the video will be created in the default workspace for
115    /// the user's organization, if the default workspace for the organization is configured.
116    #[inline]
117    pub fn workspace(&self) -> Option<&super::super::super::api::rids::WorkspaceRid> {
118        self.workspace.as_ref().map(|o| &*o)
119    }
120    /// The markings to apply to the created video.
121    /// If not provided, the video will be visible to all users in the same workspace.
122    #[inline]
123    pub fn marking_rids(
124        &self,
125    ) -> &std::collections::BTreeSet<super::super::super::scout::rids::api::MarkingRid> {
126        &self.marking_rids
127    }
128}