1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct VideoChannelSeries {
4 #[prost(string, tag = "1")]
5 pub dataset_rid: ::prost::alloc::string::String,
6 #[prost(string, tag = "2")]
7 pub channel: ::prost::alloc::string::String,
8 #[prost(map = "string, string", tag = "3")]
9 pub tags: ::std::collections::HashMap<
10 ::prost::alloc::string::String,
11 ::prost::alloc::string::String,
12 >,
13}
14#[derive(Clone, PartialEq, ::prost::Message)]
15pub struct VideoFileSource {
16 #[prost(string, tag = "1")]
17 pub video_file_rid: ::prost::alloc::string::String,
18}
19#[derive(Clone, PartialEq, ::prost::Message)]
20pub struct DatasetFileSource {
21 #[prost(string, tag = "1")]
22 pub dataset_file_id: ::prost::alloc::string::String,
23 #[prost(string, tag = "2")]
24 pub dataset_rid: ::prost::alloc::string::String,
25 #[prost(message, optional, tag = "3")]
26 pub series: ::core::option::Option<VideoChannelSeries>,
27}
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct CreateFileSegmentationRequest {
30 #[prost(string, tag = "3")]
31 pub ingest_job_rid: ::prost::alloc::string::String,
32 #[prost(bool, optional, tag = "4")]
33 pub overwrite_segments: ::core::option::Option<bool>,
34 #[prost(oneof = "create_file_segmentation_request::Source", tags = "1, 2")]
35 pub source: ::core::option::Option<create_file_segmentation_request::Source>,
36}
37pub mod create_file_segmentation_request {
39 #[derive(Clone, PartialEq, ::prost::Oneof)]
40 pub enum Source {
41 #[prost(message, tag = "1")]
42 VideoFile(super::VideoFileSource),
43 #[prost(message, tag = "2")]
44 DatasetFile(super::DatasetFileSource),
45 }
46}
47#[derive(Clone, PartialEq, ::prost::Message)]
48pub struct CreateFileSegmentationResponse {
49 #[prost(string, tag = "1")]
50 pub job_rid: ::prost::alloc::string::String,
51}
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct CreateConcatenatedFileSegmentationRequest {
54 #[prost(string, repeated, tag = "1")]
55 pub dataset_file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
56 #[prost(string, tag = "2")]
57 pub dataset_rid: ::prost::alloc::string::String,
58 #[prost(string, tag = "3")]
59 pub ingest_job_rid: ::prost::alloc::string::String,
60 #[prost(message, optional, tag = "4")]
61 pub series: ::core::option::Option<VideoChannelSeries>,
62 #[prost(bool, optional, tag = "5")]
63 pub overwrite_segments: ::core::option::Option<bool>,
64}
65#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct CreateConcatenatedFileSegmentationResponse {
67 #[prost(string, tag = "1")]
68 pub job_rid: ::prost::alloc::string::String,
69}
70#[derive(Clone, PartialEq, ::prost::Message)]
71pub struct CreateStreamSegmentRequest {
72 #[prost(string, tag = "3")]
73 pub stream_uuid: ::prost::alloc::string::String,
74 #[prost(string, tag = "4")]
75 pub s3_bucket: ::prost::alloc::string::String,
76 #[prost(string, tag = "5")]
77 pub s3_key: ::prost::alloc::string::String,
78 #[prost(message, optional, tag = "6")]
79 pub segment_timestamp: ::core::option::Option<super::super::types::time::Timestamp>,
80 #[prost(double, tag = "7")]
81 pub duration_seconds: f64,
82 #[prost(int64, tag = "8")]
83 pub size_bytes: i64,
84 #[prost(oneof = "create_stream_segment_request::Destination", tags = "1, 2")]
85 pub destination: ::core::option::Option<create_stream_segment_request::Destination>,
86}
87pub mod create_stream_segment_request {
89 #[derive(Clone, PartialEq, ::prost::Oneof)]
90 pub enum Destination {
91 #[prost(string, tag = "1")]
92 VideoRid(::prost::alloc::string::String),
93 #[prost(message, tag = "2")]
94 Series(super::VideoChannelSeries),
95 }
96}
97#[derive(Clone, PartialEq, ::prost::Message)]
98pub struct CreateStreamSegmentResponse {
99 #[prost(string, tag = "1")]
100 pub job_rid: ::prost::alloc::string::String,
101}
102#[derive(Clone, PartialEq, ::prost::Message)]
103pub struct ExportSegment {
104 #[prost(string, tag = "1")]
105 pub s3_path: ::prost::alloc::string::String,
106 #[prost(message, optional, tag = "2")]
107 pub min_timestamp: ::core::option::Option<super::super::types::time::Timestamp>,
108 #[prost(message, optional, tag = "3")]
109 pub max_timestamp: ::core::option::Option<super::super::types::time::Timestamp>,
110 #[prost(double, tag = "4")]
111 pub duration_seconds: f64,
112 #[prost(int32, tag = "5")]
113 pub duration_frames: i32,
114}
115#[derive(Clone, Copy, PartialEq, ::prost::Message)]
116pub struct ExportTimeRange {
117 #[prost(message, optional, tag = "1")]
118 pub start: ::core::option::Option<super::super::types::time::Timestamp>,
119 #[prost(message, optional, tag = "2")]
120 pub end: ::core::option::Option<super::super::types::time::Timestamp>,
121}
122#[derive(Clone, PartialEq, ::prost::Message)]
123pub struct CreateExportRequest {
124 #[prost(string, tag = "1")]
125 pub export_id: ::prost::alloc::string::String,
126 #[prost(message, repeated, tag = "2")]
127 pub segments: ::prost::alloc::vec::Vec<ExportSegment>,
128 #[prost(int64, tag = "3")]
129 pub max_total_input_bytes: i64,
130 #[prost(message, optional, tag = "4")]
131 pub output_range: ::core::option::Option<ExportTimeRange>,
132}
133#[derive(Clone, PartialEq, ::prost::Message)]
134pub struct CreateExportResponse {
135 #[prost(string, tag = "1")]
136 pub workflow_id: ::prost::alloc::string::String,
137}
138#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
139#[repr(i32)]
140pub enum VideoSegmenterError {
141 Unspecified = 0,
142 MalformedIdentifier = 1,
143 TimestampOutOfRange = 2,
144}
145impl VideoSegmenterError {
146 pub fn as_str_name(&self) -> &'static str {
151 match self {
152 Self::Unspecified => "VIDEO_SEGMENTER_ERROR_UNSPECIFIED",
153 Self::MalformedIdentifier => "VIDEO_SEGMENTER_ERROR_MALFORMED_IDENTIFIER",
154 Self::TimestampOutOfRange => "VIDEO_SEGMENTER_ERROR_TIMESTAMP_OUT_OF_RANGE",
155 }
156 }
157 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
159 match value {
160 "VIDEO_SEGMENTER_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
161 "VIDEO_SEGMENTER_ERROR_MALFORMED_IDENTIFIER" => {
162 Some(Self::MalformedIdentifier)
163 }
164 "VIDEO_SEGMENTER_ERROR_TIMESTAMP_OUT_OF_RANGE" => {
165 Some(Self::TimestampOutOfRange)
166 }
167 _ => None,
168 }
169 }
170}
171pub mod internal_video_segmenter_service_client {
173 #![allow(
174 unused_variables,
175 dead_code,
176 missing_docs,
177 clippy::wildcard_imports,
178 clippy::let_unit_value,
179 )]
180 use tonic::codegen::*;
181 use tonic::codegen::http::Uri;
182 #[derive(Debug, Clone)]
183 pub struct InternalVideoSegmenterServiceClient<T> {
184 inner: tonic::client::Grpc<T>,
185 }
186 impl InternalVideoSegmenterServiceClient<tonic::transport::Channel> {
187 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
189 where
190 D: TryInto<tonic::transport::Endpoint>,
191 D::Error: Into<StdError>,
192 {
193 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
194 Ok(Self::new(conn))
195 }
196 }
197 impl<T> InternalVideoSegmenterServiceClient<T>
198 where
199 T: tonic::client::GrpcService<tonic::body::Body>,
200 T::Error: Into<StdError>,
201 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
202 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
203 {
204 pub fn new(inner: T) -> Self {
205 let inner = tonic::client::Grpc::new(inner);
206 Self { inner }
207 }
208 pub fn with_origin(inner: T, origin: Uri) -> Self {
209 let inner = tonic::client::Grpc::with_origin(inner, origin);
210 Self { inner }
211 }
212 pub fn with_interceptor<F>(
213 inner: T,
214 interceptor: F,
215 ) -> InternalVideoSegmenterServiceClient<InterceptedService<T, F>>
216 where
217 F: tonic::service::Interceptor,
218 T::ResponseBody: Default,
219 T: tonic::codegen::Service<
220 http::Request<tonic::body::Body>,
221 Response = http::Response<
222 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
223 >,
224 >,
225 <T as tonic::codegen::Service<
226 http::Request<tonic::body::Body>,
227 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
228 {
229 InternalVideoSegmenterServiceClient::new(
230 InterceptedService::new(inner, interceptor),
231 )
232 }
233 #[must_use]
238 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
239 self.inner = self.inner.send_compressed(encoding);
240 self
241 }
242 #[must_use]
244 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
245 self.inner = self.inner.accept_compressed(encoding);
246 self
247 }
248 #[must_use]
252 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
253 self.inner = self.inner.max_decoding_message_size(limit);
254 self
255 }
256 #[must_use]
260 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
261 self.inner = self.inner.max_encoding_message_size(limit);
262 self
263 }
264 pub async fn create_file_segmentation(
265 &mut self,
266 request: impl tonic::IntoRequest<super::CreateFileSegmentationRequest>,
267 ) -> std::result::Result<
268 tonic::Response<super::CreateFileSegmentationResponse>,
269 tonic::Status,
270 > {
271 self.inner
272 .ready()
273 .await
274 .map_err(|e| {
275 tonic::Status::unknown(
276 format!("Service was not ready: {}", e.into()),
277 )
278 })?;
279 let codec = tonic::codec::ProstCodec::default();
280 let path = http::uri::PathAndQuery::from_static(
281 "/nominal.internalvideosegmenters.v1.InternalVideoSegmenterService/CreateFileSegmentation",
282 );
283 let mut req = request.into_request();
284 req.extensions_mut()
285 .insert(
286 GrpcMethod::new(
287 "nominal.internalvideosegmenters.v1.InternalVideoSegmenterService",
288 "CreateFileSegmentation",
289 ),
290 );
291 self.inner.unary(req, path, codec).await
292 }
293 pub async fn create_concatenated_file_segmentation(
294 &mut self,
295 request: impl tonic::IntoRequest<
296 super::CreateConcatenatedFileSegmentationRequest,
297 >,
298 ) -> std::result::Result<
299 tonic::Response<super::CreateConcatenatedFileSegmentationResponse>,
300 tonic::Status,
301 > {
302 self.inner
303 .ready()
304 .await
305 .map_err(|e| {
306 tonic::Status::unknown(
307 format!("Service was not ready: {}", e.into()),
308 )
309 })?;
310 let codec = tonic::codec::ProstCodec::default();
311 let path = http::uri::PathAndQuery::from_static(
312 "/nominal.internalvideosegmenters.v1.InternalVideoSegmenterService/CreateConcatenatedFileSegmentation",
313 );
314 let mut req = request.into_request();
315 req.extensions_mut()
316 .insert(
317 GrpcMethod::new(
318 "nominal.internalvideosegmenters.v1.InternalVideoSegmenterService",
319 "CreateConcatenatedFileSegmentation",
320 ),
321 );
322 self.inner.unary(req, path, codec).await
323 }
324 pub async fn create_stream_segment(
325 &mut self,
326 request: impl tonic::IntoRequest<super::CreateStreamSegmentRequest>,
327 ) -> std::result::Result<
328 tonic::Response<super::CreateStreamSegmentResponse>,
329 tonic::Status,
330 > {
331 self.inner
332 .ready()
333 .await
334 .map_err(|e| {
335 tonic::Status::unknown(
336 format!("Service was not ready: {}", e.into()),
337 )
338 })?;
339 let codec = tonic::codec::ProstCodec::default();
340 let path = http::uri::PathAndQuery::from_static(
341 "/nominal.internalvideosegmenters.v1.InternalVideoSegmenterService/CreateStreamSegment",
342 );
343 let mut req = request.into_request();
344 req.extensions_mut()
345 .insert(
346 GrpcMethod::new(
347 "nominal.internalvideosegmenters.v1.InternalVideoSegmenterService",
348 "CreateStreamSegment",
349 ),
350 );
351 self.inner.unary(req, path, codec).await
352 }
353 pub async fn create_export(
354 &mut self,
355 request: impl tonic::IntoRequest<super::CreateExportRequest>,
356 ) -> std::result::Result<
357 tonic::Response<super::CreateExportResponse>,
358 tonic::Status,
359 > {
360 self.inner
361 .ready()
362 .await
363 .map_err(|e| {
364 tonic::Status::unknown(
365 format!("Service was not ready: {}", e.into()),
366 )
367 })?;
368 let codec = tonic::codec::ProstCodec::default();
369 let path = http::uri::PathAndQuery::from_static(
370 "/nominal.internalvideosegmenters.v1.InternalVideoSegmenterService/CreateExport",
371 );
372 let mut req = request.into_request();
373 req.extensions_mut()
374 .insert(
375 GrpcMethod::new(
376 "nominal.internalvideosegmenters.v1.InternalVideoSegmenterService",
377 "CreateExport",
378 ),
379 );
380 self.inner.unary(req, path, codec).await
381 }
382 }
383}