Skip to main content

nominal_api/conjure/objects/ingest/api/
ingest_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 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(
17        default,
18        map(
19            key(type = super::super::super::api::PropertyName),
20            value(type = super::super::super::api::PropertyValue)
21        )
22    )]
23    #[serde(
24        rename = "properties",
25        skip_serializing_if = "std::collections::BTreeMap::is_empty",
26        default
27    )]
28    properties: std::collections::BTreeMap<
29        super::super::super::api::PropertyName,
30        super::super::super::api::PropertyValue,
31    >,
32    #[builder(default, set(item(type = super::super::super::api::Label)))]
33    #[serde(
34        rename = "labels",
35        skip_serializing_if = "std::collections::BTreeSet::is_empty",
36        default
37    )]
38    labels: std::collections::BTreeSet<super::super::super::api::Label>,
39    #[builder(default, into)]
40    #[serde(rename = "title", skip_serializing_if = "Option::is_none", default)]
41    title: Option<String>,
42    #[builder(default, into)]
43    #[serde(rename = "description", skip_serializing_if = "Option::is_none", default)]
44    description: Option<String>,
45    #[builder(custom(type = super::VideoTimestampManifest, convert = Box::new))]
46    #[serde(rename = "timestamps")]
47    timestamps: Box<super::VideoTimestampManifest>,
48    #[builder(default, into)]
49    #[serde(rename = "workspace", skip_serializing_if = "Option::is_none", default)]
50    workspace: Option<super::super::super::api::rids::WorkspaceRid>,
51}
52impl IngestVideoRequest {
53    /// Constructs a new instance of the type.
54    #[inline]
55    pub fn new(timestamps: super::VideoTimestampManifest) -> Self {
56        Self::builder().timestamps(timestamps).build()
57    }
58    #[inline]
59    pub fn sources(&self) -> &[super::IngestSource] {
60        &*self.sources
61    }
62    #[inline]
63    pub fn properties(
64        &self,
65    ) -> &std::collections::BTreeMap<
66        super::super::super::api::PropertyName,
67        super::super::super::api::PropertyValue,
68    > {
69        &self.properties
70    }
71    #[inline]
72    pub fn labels(
73        &self,
74    ) -> &std::collections::BTreeSet<super::super::super::api::Label> {
75        &self.labels
76    }
77    #[inline]
78    pub fn title(&self) -> Option<&str> {
79        self.title.as_ref().map(|o| &**o)
80    }
81    #[inline]
82    pub fn description(&self) -> Option<&str> {
83        self.description.as_ref().map(|o| &**o)
84    }
85    #[inline]
86    pub fn timestamps(&self) -> &super::VideoTimestampManifest {
87        &*self.timestamps
88    }
89    /// The workspace in which to create the video. If not provided, the video will be created in the default workspace for
90    /// the user's organization, if the default workspace for the organization is configured.
91    #[inline]
92    pub fn workspace(&self) -> Option<&super::super::super::api::rids::WorkspaceRid> {
93        self.workspace.as_ref().map(|o| &*o)
94    }
95}