#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoChannelSeries {
#[prost(string, tag = "1")]
pub dataset_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub channel: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "3")]
pub tags: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoFileSource {
#[prost(string, tag = "1")]
pub video_file_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DatasetFileSource {
#[prost(string, tag = "1")]
pub dataset_file_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub dataset_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub series: ::core::option::Option<VideoChannelSeries>,
#[prost(message, optional, tag = "4")]
pub normalization_options: ::core::option::Option<VideoNormalizationOptions>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct VideoNormalizationOptions {
#[prost(bool, optional, tag = "1")]
pub force_normalization: ::core::option::Option<bool>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateFileSegmentationRequest {
#[prost(string, tag = "3")]
pub ingest_job_rid: ::prost::alloc::string::String,
#[prost(bool, optional, tag = "4")]
pub overwrite_segments: ::core::option::Option<bool>,
#[prost(oneof = "create_file_segmentation_request::Source", tags = "1, 2")]
pub source: ::core::option::Option<create_file_segmentation_request::Source>,
}
pub mod create_file_segmentation_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Source {
#[prost(message, tag = "1")]
VideoFile(super::VideoFileSource),
#[prost(message, tag = "2")]
DatasetFile(super::DatasetFileSource),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateFileSegmentationResponse {
#[prost(string, tag = "1")]
pub job_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateConcatenatedFileSegmentationRequest {
#[prost(string, repeated, tag = "1")]
pub dataset_file_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "2")]
pub dataset_rid: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub ingest_job_rid: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub series: ::core::option::Option<VideoChannelSeries>,
#[prost(bool, optional, tag = "5")]
pub overwrite_segments: ::core::option::Option<bool>,
#[prost(message, optional, tag = "6")]
pub normalization_options: ::core::option::Option<VideoNormalizationOptions>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateConcatenatedFileSegmentationResponse {
#[prost(string, tag = "1")]
pub job_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateStreamSegmentRequest {
#[prost(string, tag = "3")]
pub stream_uuid: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub s3_bucket: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub s3_key: ::prost::alloc::string::String,
#[prost(message, optional, tag = "6")]
pub segment_timestamp: ::core::option::Option<super::super::types::time::Timestamp>,
#[prost(double, tag = "7")]
pub duration_seconds: f64,
#[prost(int64, tag = "8")]
pub size_bytes: i64,
#[prost(oneof = "create_stream_segment_request::Destination", tags = "1, 2")]
pub destination: ::core::option::Option<create_stream_segment_request::Destination>,
}
pub mod create_stream_segment_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Destination {
#[prost(string, tag = "1")]
VideoRid(::prost::alloc::string::String),
#[prost(message, tag = "2")]
Series(super::VideoChannelSeries),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateStreamSegmentResponse {
#[prost(string, tag = "1")]
pub job_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ExportSegment {
#[prost(string, tag = "1")]
pub s3_path: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub min_timestamp: ::core::option::Option<super::super::types::time::Timestamp>,
#[prost(message, optional, tag = "3")]
pub max_timestamp: ::core::option::Option<super::super::types::time::Timestamp>,
#[prost(double, tag = "4")]
pub duration_seconds: f64,
#[prost(int32, tag = "5")]
pub duration_frames: i32,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct ExportTimeRange {
#[prost(message, optional, tag = "1")]
pub start: ::core::option::Option<super::super::types::time::Timestamp>,
#[prost(message, optional, tag = "2")]
pub end: ::core::option::Option<super::super::types::time::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateExportRequest {
#[prost(string, tag = "1")]
pub export_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub segments: ::prost::alloc::vec::Vec<ExportSegment>,
#[prost(int64, tag = "3")]
pub max_total_input_bytes: i64,
#[prost(message, optional, tag = "4")]
pub output_range: ::core::option::Option<ExportTimeRange>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateExportResponse {
#[prost(string, tag = "1")]
pub workflow_id: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VideoSegmenterError {
Unspecified = 0,
MalformedIdentifier = 1,
TimestampOutOfRange = 2,
}
impl VideoSegmenterError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "VIDEO_SEGMENTER_ERROR_UNSPECIFIED",
Self::MalformedIdentifier => "VIDEO_SEGMENTER_ERROR_MALFORMED_IDENTIFIER",
Self::TimestampOutOfRange => "VIDEO_SEGMENTER_ERROR_TIMESTAMP_OUT_OF_RANGE",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VIDEO_SEGMENTER_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
"VIDEO_SEGMENTER_ERROR_MALFORMED_IDENTIFIER" => {
Some(Self::MalformedIdentifier)
}
"VIDEO_SEGMENTER_ERROR_TIMESTAMP_OUT_OF_RANGE" => {
Some(Self::TimestampOutOfRange)
}
_ => None,
}
}
}
pub mod internal_video_segmenter_service_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct InternalVideoSegmenterServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl InternalVideoSegmenterServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> InternalVideoSegmenterServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InternalVideoSegmenterServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
InternalVideoSegmenterServiceClient::new(
InterceptedService::new(inner, interceptor),
)
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn create_file_segmentation(
&mut self,
request: impl tonic::IntoRequest<super::CreateFileSegmentationRequest>,
) -> std::result::Result<
tonic::Response<super::CreateFileSegmentationResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalvideosegmenters.v1.InternalVideoSegmenterService/CreateFileSegmentation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalvideosegmenters.v1.InternalVideoSegmenterService",
"CreateFileSegmentation",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn create_concatenated_file_segmentation(
&mut self,
request: impl tonic::IntoRequest<
super::CreateConcatenatedFileSegmentationRequest,
>,
) -> std::result::Result<
tonic::Response<super::CreateConcatenatedFileSegmentationResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalvideosegmenters.v1.InternalVideoSegmenterService/CreateConcatenatedFileSegmentation",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalvideosegmenters.v1.InternalVideoSegmenterService",
"CreateConcatenatedFileSegmentation",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn create_stream_segment(
&mut self,
request: impl tonic::IntoRequest<super::CreateStreamSegmentRequest>,
) -> std::result::Result<
tonic::Response<super::CreateStreamSegmentResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalvideosegmenters.v1.InternalVideoSegmenterService/CreateStreamSegment",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalvideosegmenters.v1.InternalVideoSegmenterService",
"CreateStreamSegment",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn create_export(
&mut self,
request: impl tonic::IntoRequest<super::CreateExportRequest>,
) -> std::result::Result<
tonic::Response<super::CreateExportResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/nominal.internalvideosegmenters.v1.InternalVideoSegmenterService/CreateExport",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.internalvideosegmenters.v1.InternalVideoSegmenterService",
"CreateExport",
),
);
self.inner.unary(req, path, codec).await
}
}
}