Skip to main content

nominal_api/conjure/objects/ingest/api/
video_opts.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 VideoOpts {
13    #[builder(custom(type = super::IngestSource, convert = Box::new))]
14    #[serde(rename = "source")]
15    source: Box<super::IngestSource>,
16    #[builder(custom(type = super::VideoIngestTarget, convert = Box::new))]
17    #[serde(rename = "target")]
18    target: Box<super::VideoIngestTarget>,
19    #[builder(
20        custom(
21            type = super::super::super::scout::video::api::VideoFileTimestampManifest,
22            convert = Box::new
23        )
24    )]
25    #[serde(rename = "timestampManifest")]
26    timestamp_manifest: Box<
27        super::super::super::scout::video::api::VideoFileTimestampManifest,
28    >,
29    #[builder(default, into)]
30    #[serde(
31        rename = "overWriteSegments",
32        skip_serializing_if = "Option::is_none",
33        default
34    )]
35    over_write_segments: Option<bool>,
36}
37impl VideoOpts {
38    /// Constructs a new instance of the type.
39    #[inline]
40    pub fn new(
41        source: super::IngestSource,
42        target: super::VideoIngestTarget,
43        timestamp_manifest: super::super::super::scout::video::api::VideoFileTimestampManifest,
44    ) -> Self {
45        Self::builder()
46            .source(source)
47            .target(target)
48            .timestamp_manifest(timestamp_manifest)
49            .build()
50    }
51    #[inline]
52    pub fn source(&self) -> &super::IngestSource {
53        &*self.source
54    }
55    #[inline]
56    pub fn target(&self) -> &super::VideoIngestTarget {
57        &*self.target
58    }
59    #[inline]
60    pub fn timestamp_manifest(
61        &self,
62    ) -> &super::super::super::scout::video::api::VideoFileTimestampManifest {
63        &*self.timestamp_manifest
64    }
65    /// If true, overlapping segments from other video files within the same video will be deleted
66    /// before inserting new segments. The cached segment metadata for affected files will be recomputed.
67    #[inline]
68    pub fn over_write_segments(&self) -> Option<bool> {
69        self.over_write_segments.as_ref().map(|o| *o)
70    }
71}