#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoExportSource {
#[prost(oneof = "video_export_source::Source", tags = "1, 2")]
pub source: ::core::option::Option<video_export_source::Source>,
}
pub mod video_export_source {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Source {
#[prost(string, tag = "1")]
VideoRid(::prost::alloc::string::String),
#[prost(message, tag = "2")]
VideoChannel(super::VideoDataSourceChannel),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoDataSourceChannel {
#[prost(string, tag = "1")]
pub data_source_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, Copy, PartialEq, ::prost::Message)]
pub struct VideoExportTimeRange {
#[prost(message, optional, tag = "1")]
pub start: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
#[prost(message, optional, tag = "2")]
pub end: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoExportFailure {
#[prost(enumeration = "VideoExportError", tag = "1")]
pub reason: i32,
#[prost(string, tag = "2")]
pub message: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoExport {
#[prost(string, tag = "1")]
pub export_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub source: ::core::option::Option<VideoExportSource>,
#[prost(message, optional, tag = "3")]
pub requested_range: ::core::option::Option<VideoExportTimeRange>,
#[prost(enumeration = "VideoExportState", tag = "4")]
pub state: i32,
#[prost(message, optional, tag = "5")]
pub actual_range: ::core::option::Option<VideoExportTimeRange>,
#[prost(string, tag = "6")]
pub download_url: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub url_expires_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(int64, tag = "8")]
pub file_size_bytes: i64,
#[prost(int32, tag = "9")]
pub segment_count: i32,
#[prost(message, optional, tag = "10")]
pub failure: ::core::option::Option<VideoExportFailure>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateVideoExportRequest {
#[prost(message, optional, tag = "1")]
pub video_export: ::core::option::Option<VideoExport>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateVideoExportResponse {
#[prost(message, optional, tag = "1")]
pub video_export: ::core::option::Option<VideoExport>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVideoExportRequest {
#[prost(string, tag = "1")]
pub export_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVideoExportResponse {
#[prost(message, optional, tag = "1")]
pub video_export: ::core::option::Option<VideoExport>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VideoExportState {
Unspecified = 0,
Completed = 1,
Pending = 2,
Running = 3,
Failed = 4,
}
impl VideoExportState {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "VIDEO_EXPORT_STATE_UNSPECIFIED",
Self::Completed => "VIDEO_EXPORT_STATE_COMPLETED",
Self::Pending => "VIDEO_EXPORT_STATE_PENDING",
Self::Running => "VIDEO_EXPORT_STATE_RUNNING",
Self::Failed => "VIDEO_EXPORT_STATE_FAILED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VIDEO_EXPORT_STATE_UNSPECIFIED" => Some(Self::Unspecified),
"VIDEO_EXPORT_STATE_COMPLETED" => Some(Self::Completed),
"VIDEO_EXPORT_STATE_PENDING" => Some(Self::Pending),
"VIDEO_EXPORT_STATE_RUNNING" => Some(Self::Running),
"VIDEO_EXPORT_STATE_FAILED" => Some(Self::Failed),
_ => None,
}
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VideoExportError {
InvalidSource = 0,
InvalidRange = 1,
RangeTooLarge = 2,
VideoNotFound = 3,
NoSegmentsInRange = 4,
VideoIngestNotComplete = 5,
SegmentDiscontinuity = 6,
SegmentConflict = 7,
InconsistentStreamParameters = 8,
NotAvailable = 9,
TranscodeFailed = 10,
Internal = 11,
ExportNotFound = 12,
}
impl VideoExportError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::InvalidSource => "VIDEO_EXPORT_ERROR_INVALID_SOURCE",
Self::InvalidRange => "VIDEO_EXPORT_ERROR_INVALID_RANGE",
Self::RangeTooLarge => "VIDEO_EXPORT_ERROR_RANGE_TOO_LARGE",
Self::VideoNotFound => "VIDEO_EXPORT_ERROR_VIDEO_NOT_FOUND",
Self::NoSegmentsInRange => "VIDEO_EXPORT_ERROR_NO_SEGMENTS_IN_RANGE",
Self::VideoIngestNotComplete => {
"VIDEO_EXPORT_ERROR_VIDEO_INGEST_NOT_COMPLETE"
}
Self::SegmentDiscontinuity => "VIDEO_EXPORT_ERROR_SEGMENT_DISCONTINUITY",
Self::SegmentConflict => "VIDEO_EXPORT_ERROR_SEGMENT_CONFLICT",
Self::InconsistentStreamParameters => {
"VIDEO_EXPORT_ERROR_INCONSISTENT_STREAM_PARAMETERS"
}
Self::NotAvailable => "VIDEO_EXPORT_ERROR_NOT_AVAILABLE",
Self::TranscodeFailed => "VIDEO_EXPORT_ERROR_TRANSCODE_FAILED",
Self::Internal => "VIDEO_EXPORT_ERROR_INTERNAL",
Self::ExportNotFound => "VIDEO_EXPORT_ERROR_EXPORT_NOT_FOUND",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VIDEO_EXPORT_ERROR_INVALID_SOURCE" => Some(Self::InvalidSource),
"VIDEO_EXPORT_ERROR_INVALID_RANGE" => Some(Self::InvalidRange),
"VIDEO_EXPORT_ERROR_RANGE_TOO_LARGE" => Some(Self::RangeTooLarge),
"VIDEO_EXPORT_ERROR_VIDEO_NOT_FOUND" => Some(Self::VideoNotFound),
"VIDEO_EXPORT_ERROR_NO_SEGMENTS_IN_RANGE" => Some(Self::NoSegmentsInRange),
"VIDEO_EXPORT_ERROR_VIDEO_INGEST_NOT_COMPLETE" => {
Some(Self::VideoIngestNotComplete)
}
"VIDEO_EXPORT_ERROR_SEGMENT_DISCONTINUITY" => {
Some(Self::SegmentDiscontinuity)
}
"VIDEO_EXPORT_ERROR_SEGMENT_CONFLICT" => Some(Self::SegmentConflict),
"VIDEO_EXPORT_ERROR_INCONSISTENT_STREAM_PARAMETERS" => {
Some(Self::InconsistentStreamParameters)
}
"VIDEO_EXPORT_ERROR_NOT_AVAILABLE" => Some(Self::NotAvailable),
"VIDEO_EXPORT_ERROR_TRANSCODE_FAILED" => Some(Self::TranscodeFailed),
"VIDEO_EXPORT_ERROR_INTERNAL" => Some(Self::Internal),
"VIDEO_EXPORT_ERROR_EXPORT_NOT_FOUND" => Some(Self::ExportNotFound),
_ => None,
}
}
}
pub mod video_export_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 VideoExportServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl VideoExportServiceClient<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> VideoExportServiceClient<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,
) -> VideoExportServiceClient<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,
{
VideoExportServiceClient::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_video_export(
&mut self,
request: impl tonic::IntoRequest<super::CreateVideoExportRequest>,
) -> std::result::Result<
tonic::Response<super::CreateVideoExportResponse>,
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.videoexports.v1.VideoExportService/CreateVideoExport",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videoexports.v1.VideoExportService",
"CreateVideoExport",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_video_export(
&mut self,
request: impl tonic::IntoRequest<super::GetVideoExportRequest>,
) -> std::result::Result<
tonic::Response<super::GetVideoExportResponse>,
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.videoexports.v1.VideoExportService/GetVideoExport",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videoexports.v1.VideoExportService",
"GetVideoExport",
),
);
self.inner.unary(req, path, codec).await
}
}
}