Skip to main content

nominal_api/conjure/errors/scout/video/api/
segment_conflict_v2.rs

1/// Attempting to create multiple segments with overlapping timestamps for a given series
2#[derive(
3    Debug,
4    Clone,
5    conjure_object::serde::Serialize,
6    conjure_object::serde::Deserialize,
7    PartialEq,
8    Eq,
9    PartialOrd,
10    Ord,
11    Hash
12)]
13#[serde(crate = "conjure_object::serde")]
14#[conjure_object::private::staged_builder::staged_builder]
15#[builder(crate = conjure_object::private::staged_builder, update, inline)]
16pub struct SegmentConflictV2 {
17    #[serde(rename = "seriesUuid")]
18    series_uuid: conjure_object::Uuid,
19    #[builder(
20        custom(
21            type = super::super::super::super::super::objects::scout::video::api::Bounds,
22            convert = Box::new
23        )
24    )]
25    #[serde(rename = "segment1Bounds")]
26    segment1_bounds: Box<
27        super::super::super::super::super::objects::scout::video::api::Bounds,
28    >,
29    #[builder(
30        custom(
31            type = super::super::super::super::super::objects::scout::video::api::Bounds,
32            convert = Box::new
33        )
34    )]
35    #[serde(rename = "segment2Bounds")]
36    segment2_bounds: Box<
37        super::super::super::super::super::objects::scout::video::api::Bounds,
38    >,
39}
40impl SegmentConflictV2 {
41    /// Constructs a new instance of the type.
42    #[inline]
43    pub fn new(
44        series_uuid: conjure_object::Uuid,
45        segment1_bounds: super::super::super::super::super::objects::scout::video::api::Bounds,
46        segment2_bounds: super::super::super::super::super::objects::scout::video::api::Bounds,
47    ) -> Self {
48        Self::builder()
49            .series_uuid(series_uuid)
50            .segment1_bounds(segment1_bounds)
51            .segment2_bounds(segment2_bounds)
52            .build()
53    }
54    #[inline]
55    pub fn series_uuid(&self) -> conjure_object::Uuid {
56        self.series_uuid
57    }
58    #[inline]
59    pub fn segment1_bounds(
60        &self,
61    ) -> &super::super::super::super::super::objects::scout::video::api::Bounds {
62        &*self.segment1_bounds
63    }
64    #[inline]
65    pub fn segment2_bounds(
66        &self,
67    ) -> &super::super::super::super::super::objects::scout::video::api::Bounds {
68        &*self.segment2_bounds
69    }
70}
71impl conjure_error::ErrorType for SegmentConflictV2 {
72    #[inline]
73    fn code() -> conjure_error::ErrorCode {
74        conjure_error::ErrorCode::Conflict
75    }
76    #[inline]
77    fn name() -> &'static str {
78        "Video:SegmentConflictV2"
79    }
80    #[inline]
81    fn safe_args() -> &'static [&'static str] {
82        &["segment1Bounds", "segment2Bounds", "seriesUuid"]
83    }
84}