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