Skip to main content

nominal_api/conjure/endpoints/scout/video/
video_segment_service.rs

1use conjure_http::endpoint;
2/// Upon ingestion, every video is split into smaller segments. The Video Segment Service manages operations on videos
3/// at the segment-level.
4#[conjure_http::conjure_endpoints(
5    name = "VideoSegmentService",
6    use_legacy_error_serialization
7)]
8pub trait VideoSegmentService {
9    #[endpoint(
10        method = POST,
11        path = "/video/v1/videos/{videoRid}/create-segments",
12        name = "createSegments"
13    )]
14    fn create_segments(
15        &self,
16        #[auth]
17        auth_: conjure_object::BearerToken,
18        #[path(
19            name = "videoRid",
20            decoder = conjure_http::server::conjure::FromPlainDecoder,
21            log_as = "videoRid"
22        )]
23        video_rid: conjure_object::ResourceIdentifier,
24        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
25        request: super::super::super::super::objects::scout::video::api::CreateSegmentsRequest,
26    ) -> Result<(), conjure_http::private::Error>;
27    #[endpoint(
28        method = POST,
29        path = "/video/v1/videos/{videoRid}/{videoFileRid}/create-segments",
30        name = "createVideoFileSegments",
31        produces = conjure_http::server::StdResponseSerializer
32    )]
33    fn create_video_file_segments(
34        &self,
35        #[auth]
36        auth_: conjure_object::BearerToken,
37        #[path(
38            name = "videoRid",
39            decoder = conjure_http::server::conjure::FromPlainDecoder,
40            log_as = "videoRid"
41        )]
42        video_rid: conjure_object::ResourceIdentifier,
43        #[path(
44            name = "videoFileRid",
45            decoder = conjure_http::server::conjure::FromPlainDecoder,
46            log_as = "videoFileRid"
47        )]
48        video_file_rid: conjure_object::ResourceIdentifier,
49        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
50        request: super::super::super::super::objects::scout::video::api::CreateSegmentsRequest,
51    ) -> Result<
52        super::super::super::super::objects::scout::video::api::CreateSegmentsResponse,
53        conjure_http::private::Error,
54    >;
55    /// Creates segments for a video stream. Similar to createVideoFileSegments but for streaming video.
56    #[endpoint(
57        method = POST,
58        path = "/video/v1/videos/{videoRid}/streams/{streamUuid}/create-segments",
59        name = "createVideoStreamSegments",
60        produces = conjure_http::server::StdResponseSerializer
61    )]
62    fn create_video_stream_segments(
63        &self,
64        #[auth]
65        auth_: conjure_object::BearerToken,
66        #[path(
67            name = "videoRid",
68            decoder = conjure_http::server::conjure::FromPlainDecoder,
69            log_as = "videoRid"
70        )]
71        video_rid: conjure_object::ResourceIdentifier,
72        #[path(
73            name = "streamUuid",
74            decoder = conjure_http::server::conjure::FromPlainDecoder,
75            log_as = "streamUuid"
76        )]
77        stream_uuid: conjure_object::Uuid,
78        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
79        request: super::super::super::super::objects::scout::video::api::CreateSegmentsRequest,
80    ) -> Result<
81        super::super::super::super::objects::scout::video::api::CreateSegmentsResponse,
82        conjure_http::private::Error,
83    >;
84    /// Creates segments for a dataset file video. Used for channel-based video ingestion.
85    /// Internal use only.
86    #[endpoint(
87        method = POST,
88        path = "/video/v2/videos/create-segments",
89        name = "createSegmentsV2",
90        produces = conjure_http::server::StdResponseSerializer
91    )]
92    fn create_segments_v2(
93        &self,
94        #[auth]
95        auth_: conjure_object::BearerToken,
96        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
97        request: super::super::super::super::objects::scout::video::api::CreateSegmentsV2Request,
98    ) -> Result<
99        super::super::super::super::objects::scout::video::api::CreateSegmentsV2Response,
100        conjure_http::private::Error,
101    >;
102    /// Creates segments for a channel-backed live video stream. Internal use only.
103    #[endpoint(
104        method = POST,
105        path = "/video/v2/videos/streams/{streamUuid}/create-segments",
106        name = "createStreamSegmentsV2",
107        produces = conjure_http::server::StdResponseSerializer
108    )]
109    fn create_stream_segments_v2(
110        &self,
111        #[auth]
112        auth_: conjure_object::BearerToken,
113        #[path(
114            name = "streamUuid",
115            decoder = conjure_http::server::conjure::FromPlainDecoder,
116            log_as = "streamUuid"
117        )]
118        stream_uuid: conjure_object::Uuid,
119        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
120        request: super::super::super::super::objects::scout::video::api::CreateStreamSegmentsV2Request,
121    ) -> Result<
122        super::super::super::super::objects::scout::video::api::CreateSegmentsV2Response,
123        conjure_http::private::Error,
124    >;
125    /// Returns metadata for the segment within a video containing the requested absolute timestamp.
126    #[endpoint(
127        method = POST,
128        path = "/video/v1/videos/{videoRid}/get-segment-by-timestamp",
129        name = "getSegmentByTimestamp",
130        produces = conjure_http::server::conjure::CollectionResponseSerializer
131    )]
132    fn get_segment_by_timestamp(
133        &self,
134        #[auth]
135        auth_: conjure_object::BearerToken,
136        #[path(
137            name = "videoRid",
138            decoder = conjure_http::server::conjure::FromPlainDecoder,
139            log_as = "videoRid"
140        )]
141        video_rid: conjure_object::ResourceIdentifier,
142        #[body(deserializer = conjure_http::server::StdRequestDeserializer, safe)]
143        request: super::super::super::super::objects::scout::video::api::GetSegmentByTimestampRequest,
144    ) -> Result<
145        Option<super::super::super::super::objects::scout::video::api::Segment>,
146        conjure_http::private::Error,
147    >;
148}
149/// Upon ingestion, every video is split into smaller segments. The Video Segment Service manages operations on videos
150/// at the segment-level.
151#[conjure_http::conjure_endpoints(
152    name = "VideoSegmentService",
153    use_legacy_error_serialization
154)]
155pub trait AsyncVideoSegmentService {
156    #[endpoint(
157        method = POST,
158        path = "/video/v1/videos/{videoRid}/create-segments",
159        name = "createSegments"
160    )]
161    async fn create_segments(
162        &self,
163        #[auth]
164        auth_: conjure_object::BearerToken,
165        #[path(
166            name = "videoRid",
167            decoder = conjure_http::server::conjure::FromPlainDecoder,
168            log_as = "videoRid"
169        )]
170        video_rid: conjure_object::ResourceIdentifier,
171        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
172        request: super::super::super::super::objects::scout::video::api::CreateSegmentsRequest,
173    ) -> Result<(), conjure_http::private::Error>;
174    #[endpoint(
175        method = POST,
176        path = "/video/v1/videos/{videoRid}/{videoFileRid}/create-segments",
177        name = "createVideoFileSegments",
178        produces = conjure_http::server::StdResponseSerializer
179    )]
180    async fn create_video_file_segments(
181        &self,
182        #[auth]
183        auth_: conjure_object::BearerToken,
184        #[path(
185            name = "videoRid",
186            decoder = conjure_http::server::conjure::FromPlainDecoder,
187            log_as = "videoRid"
188        )]
189        video_rid: conjure_object::ResourceIdentifier,
190        #[path(
191            name = "videoFileRid",
192            decoder = conjure_http::server::conjure::FromPlainDecoder,
193            log_as = "videoFileRid"
194        )]
195        video_file_rid: conjure_object::ResourceIdentifier,
196        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
197        request: super::super::super::super::objects::scout::video::api::CreateSegmentsRequest,
198    ) -> Result<
199        super::super::super::super::objects::scout::video::api::CreateSegmentsResponse,
200        conjure_http::private::Error,
201    >;
202    /// Creates segments for a video stream. Similar to createVideoFileSegments but for streaming video.
203    #[endpoint(
204        method = POST,
205        path = "/video/v1/videos/{videoRid}/streams/{streamUuid}/create-segments",
206        name = "createVideoStreamSegments",
207        produces = conjure_http::server::StdResponseSerializer
208    )]
209    async fn create_video_stream_segments(
210        &self,
211        #[auth]
212        auth_: conjure_object::BearerToken,
213        #[path(
214            name = "videoRid",
215            decoder = conjure_http::server::conjure::FromPlainDecoder,
216            log_as = "videoRid"
217        )]
218        video_rid: conjure_object::ResourceIdentifier,
219        #[path(
220            name = "streamUuid",
221            decoder = conjure_http::server::conjure::FromPlainDecoder,
222            log_as = "streamUuid"
223        )]
224        stream_uuid: conjure_object::Uuid,
225        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
226        request: super::super::super::super::objects::scout::video::api::CreateSegmentsRequest,
227    ) -> Result<
228        super::super::super::super::objects::scout::video::api::CreateSegmentsResponse,
229        conjure_http::private::Error,
230    >;
231    /// Creates segments for a dataset file video. Used for channel-based video ingestion.
232    /// Internal use only.
233    #[endpoint(
234        method = POST,
235        path = "/video/v2/videos/create-segments",
236        name = "createSegmentsV2",
237        produces = conjure_http::server::StdResponseSerializer
238    )]
239    async fn create_segments_v2(
240        &self,
241        #[auth]
242        auth_: conjure_object::BearerToken,
243        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
244        request: super::super::super::super::objects::scout::video::api::CreateSegmentsV2Request,
245    ) -> Result<
246        super::super::super::super::objects::scout::video::api::CreateSegmentsV2Response,
247        conjure_http::private::Error,
248    >;
249    /// Creates segments for a channel-backed live video stream. Internal use only.
250    #[endpoint(
251        method = POST,
252        path = "/video/v2/videos/streams/{streamUuid}/create-segments",
253        name = "createStreamSegmentsV2",
254        produces = conjure_http::server::StdResponseSerializer
255    )]
256    async fn create_stream_segments_v2(
257        &self,
258        #[auth]
259        auth_: conjure_object::BearerToken,
260        #[path(
261            name = "streamUuid",
262            decoder = conjure_http::server::conjure::FromPlainDecoder,
263            log_as = "streamUuid"
264        )]
265        stream_uuid: conjure_object::Uuid,
266        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
267        request: super::super::super::super::objects::scout::video::api::CreateStreamSegmentsV2Request,
268    ) -> Result<
269        super::super::super::super::objects::scout::video::api::CreateSegmentsV2Response,
270        conjure_http::private::Error,
271    >;
272    /// Returns metadata for the segment within a video containing the requested absolute timestamp.
273    #[endpoint(
274        method = POST,
275        path = "/video/v1/videos/{videoRid}/get-segment-by-timestamp",
276        name = "getSegmentByTimestamp",
277        produces = conjure_http::server::conjure::CollectionResponseSerializer
278    )]
279    async fn get_segment_by_timestamp(
280        &self,
281        #[auth]
282        auth_: conjure_object::BearerToken,
283        #[path(
284            name = "videoRid",
285            decoder = conjure_http::server::conjure::FromPlainDecoder,
286            log_as = "videoRid"
287        )]
288        video_rid: conjure_object::ResourceIdentifier,
289        #[body(deserializer = conjure_http::server::StdRequestDeserializer, safe)]
290        request: super::super::super::super::objects::scout::video::api::GetSegmentByTimestampRequest,
291    ) -> Result<
292        Option<super::super::super::super::objects::scout::video::api::Segment>,
293        conjure_http::private::Error,
294    >;
295}
296/// Upon ingestion, every video is split into smaller segments. The Video Segment Service manages operations on videos
297/// at the segment-level.
298#[conjure_http::conjure_endpoints(
299    name = "VideoSegmentService",
300    use_legacy_error_serialization,
301    local
302)]
303pub trait LocalAsyncVideoSegmentService {
304    #[endpoint(
305        method = POST,
306        path = "/video/v1/videos/{videoRid}/create-segments",
307        name = "createSegments"
308    )]
309    async fn create_segments(
310        &self,
311        #[auth]
312        auth_: conjure_object::BearerToken,
313        #[path(
314            name = "videoRid",
315            decoder = conjure_http::server::conjure::FromPlainDecoder,
316            log_as = "videoRid"
317        )]
318        video_rid: conjure_object::ResourceIdentifier,
319        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
320        request: super::super::super::super::objects::scout::video::api::CreateSegmentsRequest,
321    ) -> Result<(), conjure_http::private::Error>;
322    #[endpoint(
323        method = POST,
324        path = "/video/v1/videos/{videoRid}/{videoFileRid}/create-segments",
325        name = "createVideoFileSegments",
326        produces = conjure_http::server::StdResponseSerializer
327    )]
328    async fn create_video_file_segments(
329        &self,
330        #[auth]
331        auth_: conjure_object::BearerToken,
332        #[path(
333            name = "videoRid",
334            decoder = conjure_http::server::conjure::FromPlainDecoder,
335            log_as = "videoRid"
336        )]
337        video_rid: conjure_object::ResourceIdentifier,
338        #[path(
339            name = "videoFileRid",
340            decoder = conjure_http::server::conjure::FromPlainDecoder,
341            log_as = "videoFileRid"
342        )]
343        video_file_rid: conjure_object::ResourceIdentifier,
344        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
345        request: super::super::super::super::objects::scout::video::api::CreateSegmentsRequest,
346    ) -> Result<
347        super::super::super::super::objects::scout::video::api::CreateSegmentsResponse,
348        conjure_http::private::Error,
349    >;
350    /// Creates segments for a video stream. Similar to createVideoFileSegments but for streaming video.
351    #[endpoint(
352        method = POST,
353        path = "/video/v1/videos/{videoRid}/streams/{streamUuid}/create-segments",
354        name = "createVideoStreamSegments",
355        produces = conjure_http::server::StdResponseSerializer
356    )]
357    async fn create_video_stream_segments(
358        &self,
359        #[auth]
360        auth_: conjure_object::BearerToken,
361        #[path(
362            name = "videoRid",
363            decoder = conjure_http::server::conjure::FromPlainDecoder,
364            log_as = "videoRid"
365        )]
366        video_rid: conjure_object::ResourceIdentifier,
367        #[path(
368            name = "streamUuid",
369            decoder = conjure_http::server::conjure::FromPlainDecoder,
370            log_as = "streamUuid"
371        )]
372        stream_uuid: conjure_object::Uuid,
373        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
374        request: super::super::super::super::objects::scout::video::api::CreateSegmentsRequest,
375    ) -> Result<
376        super::super::super::super::objects::scout::video::api::CreateSegmentsResponse,
377        conjure_http::private::Error,
378    >;
379    /// Creates segments for a dataset file video. Used for channel-based video ingestion.
380    /// Internal use only.
381    #[endpoint(
382        method = POST,
383        path = "/video/v2/videos/create-segments",
384        name = "createSegmentsV2",
385        produces = conjure_http::server::StdResponseSerializer
386    )]
387    async fn create_segments_v2(
388        &self,
389        #[auth]
390        auth_: conjure_object::BearerToken,
391        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
392        request: super::super::super::super::objects::scout::video::api::CreateSegmentsV2Request,
393    ) -> Result<
394        super::super::super::super::objects::scout::video::api::CreateSegmentsV2Response,
395        conjure_http::private::Error,
396    >;
397    /// Creates segments for a channel-backed live video stream. Internal use only.
398    #[endpoint(
399        method = POST,
400        path = "/video/v2/videos/streams/{streamUuid}/create-segments",
401        name = "createStreamSegmentsV2",
402        produces = conjure_http::server::StdResponseSerializer
403    )]
404    async fn create_stream_segments_v2(
405        &self,
406        #[auth]
407        auth_: conjure_object::BearerToken,
408        #[path(
409            name = "streamUuid",
410            decoder = conjure_http::server::conjure::FromPlainDecoder,
411            log_as = "streamUuid"
412        )]
413        stream_uuid: conjure_object::Uuid,
414        #[body(deserializer = conjure_http::server::StdRequestDeserializer)]
415        request: super::super::super::super::objects::scout::video::api::CreateStreamSegmentsV2Request,
416    ) -> Result<
417        super::super::super::super::objects::scout::video::api::CreateSegmentsV2Response,
418        conjure_http::private::Error,
419    >;
420    /// Returns metadata for the segment within a video containing the requested absolute timestamp.
421    #[endpoint(
422        method = POST,
423        path = "/video/v1/videos/{videoRid}/get-segment-by-timestamp",
424        name = "getSegmentByTimestamp",
425        produces = conjure_http::server::conjure::CollectionResponseSerializer
426    )]
427    async fn get_segment_by_timestamp(
428        &self,
429        #[auth]
430        auth_: conjure_object::BearerToken,
431        #[path(
432            name = "videoRid",
433            decoder = conjure_http::server::conjure::FromPlainDecoder,
434            log_as = "videoRid"
435        )]
436        video_rid: conjure_object::ResourceIdentifier,
437        #[body(deserializer = conjure_http::server::StdRequestDeserializer, safe)]
438        request: super::super::super::super::objects::scout::video::api::GetSegmentByTimestampRequest,
439    ) -> Result<
440        Option<super::super::super::super::objects::scout::video::api::Segment>,
441        conjure_http::private::Error,
442    >;
443}