nominal_api/conjure/objects/ingest/api/
ingest_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 IngestVideoRequest {
13 #[builder(default, list(item(type = super::IngestSource)))]
14 #[serde(rename = "sources", skip_serializing_if = "Vec::is_empty", default)]
15 sources: Vec<super::IngestSource>,
16 #[builder(default, map(key(type = String, into), value(type = String, into)))]
17 #[serde(
18 rename = "properties",
19 skip_serializing_if = "std::collections::BTreeMap::is_empty",
20 default
21 )]
22 properties: std::collections::BTreeMap<String, String>,
23 #[builder(default, set(item(type = String, into)))]
24 #[serde(
25 rename = "labels",
26 skip_serializing_if = "std::collections::BTreeSet::is_empty",
27 default
28 )]
29 labels: std::collections::BTreeSet<String>,
30 #[builder(default, into)]
31 #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
32 title: Option<String>,
33 #[builder(default, into)]
34 #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
35 description: Option<String>,
36 #[builder(custom(type = super::VideoTimestampManifest, convert = Box::new))]
37 #[serde(rename = "timestamps")]
38 timestamps: Box<super::VideoTimestampManifest>,
39 #[builder(default, into)]
40 #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
41 workspace: Option<conjure_object::ResourceIdentifier>,
42}
43impl IngestVideoRequest {
44 #[inline]
46 pub fn new(timestamps: super::VideoTimestampManifest) -> Self {
47 Self::builder().timestamps(timestamps).build()
48 }
49 #[inline]
50 pub fn sources(&self) -> &[super::IngestSource] {
51 &*self.sources
52 }
53 #[inline]
54 pub fn properties(&self) -> &std::collections::BTreeMap<String, String> {
55 &self.properties
56 }
57 #[inline]
58 pub fn labels(&self) -> &std::collections::BTreeSet<String> {
59 &self.labels
60 }
61 #[inline]
62 pub fn title(&self) -> Option<&str> {
63 self.title.as_ref().map(|o| &**o)
64 }
65 #[inline]
66 pub fn description(&self) -> Option<&str> {
67 self.description.as_ref().map(|o| &**o)
68 }
69 #[inline]
70 pub fn timestamps(&self) -> &super::VideoTimestampManifest {
71 &*self.timestamps
72 }
73 #[inline]
76 pub fn workspace(&self) -> Option<&conjure_object::ResourceIdentifier> {
77 self.workspace.as_ref().map(|o| &*o)
78 }
79}