#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Segment {
#[prost(string, tag = "1")]
pub rid: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub video_rid: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub dataset_file_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub data_handle: ::core::option::Option<super::super::types::Handle>,
#[prost(double, tag = "5")]
pub frame_rate: f64,
#[prost(double, tag = "6")]
pub duration_seconds: f64,
#[prost(message, optional, tag = "7")]
pub frame_timestamps: ::core::option::Option<FrameTimestamps>,
#[prost(message, optional, tag = "8")]
pub end_timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FrameTimestamps {
#[prost(double, repeated, packed = "false", tag = "1")]
pub media_timestamps_seconds: ::prost::alloc::vec::Vec<f64>,
#[prost(message, repeated, tag = "2")]
pub absolute_timestamps: ::prost::alloc::vec::Vec<
super::super::super::google::protobuf::Timestamp,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SegmentTimeRange {
#[prost(message, optional, tag = "1")]
pub absolute_start_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "2")]
pub absolute_end_time: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(double, tag = "3")]
pub media_start_seconds: f64,
#[prost(double, tag = "4")]
pub media_end_seconds: f64,
#[prost(string, optional, tag = "5")]
pub dataset_file_id: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct TimeBounds {
#[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, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VideoError {
InvalidRequest = 0,
}
impl VideoError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::InvalidRequest => "VIDEO_ERROR_INVALID_REQUEST",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VIDEO_ERROR_INVALID_REQUEST" => Some(Self::InvalidRequest),
_ => None,
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListVideoFileSegmentTimeRangesRequest {
#[prost(string, tag = "1")]
pub video_file_rid: ::prost::alloc::string::String,
#[prost(int32, optional, tag = "2")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, tag = "3")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVideoFileDownloadUriRequest {
#[prost(string, tag = "1")]
pub video_file_rid: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVideoFileDownloadUriResponse {
#[prost(string, tag = "1")]
pub uri: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListVideoFileSegmentTimeRangesResponse {
#[prost(message, repeated, tag = "1")]
pub segment_time_ranges: ::prost::alloc::vec::Vec<SegmentTimeRange>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVideoFilePlaylistRequest {
#[prost(string, tag = "1")]
pub video_file_rid: ::prost::alloc::string::String,
}
pub mod video_file_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 VideoFileServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl VideoFileServiceClient<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> VideoFileServiceClient<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,
) -> VideoFileServiceClient<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,
{
VideoFileServiceClient::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 list_video_file_segment_time_ranges(
&mut self,
request: impl tonic::IntoRequest<
super::ListVideoFileSegmentTimeRangesRequest,
>,
) -> std::result::Result<
tonic::Response<super::ListVideoFileSegmentTimeRangesResponse>,
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.videos.v1.VideoFileService/ListVideoFileSegmentTimeRanges",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoFileService",
"ListVideoFileSegmentTimeRanges",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_video_file_download_uri(
&mut self,
request: impl tonic::IntoRequest<super::GetVideoFileDownloadUriRequest>,
) -> std::result::Result<
tonic::Response<super::GetVideoFileDownloadUriResponse>,
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.videos.v1.VideoFileService/GetVideoFileDownloadUri",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoFileService",
"GetVideoFileDownloadUri",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_video_file_playlist(
&mut self,
request: impl tonic::IntoRequest<super::GetVideoFilePlaylistRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<
super::super::super::super::google::api::HttpBody,
>,
>,
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.videos.v1.VideoFileService/GetVideoFilePlaylist",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoFileService",
"GetVideoFilePlaylist",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoChannelSeries {
#[prost(oneof = "video_channel_series::Series", tags = "1, 2")]
pub series: ::core::option::Option<video_channel_series::Series>,
}
pub mod video_channel_series {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Series {
#[prost(message, tag = "1")]
DataSourceChannel(super::VideoDataSourceChannel),
#[prost(message, tag = "2")]
AssetChannel(super::VideoAssetChannel),
}
}
#[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, PartialEq, ::prost::Message)]
pub struct VideoAssetChannel {
#[prost(string, tag = "1")]
pub asset_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub data_scope_name: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub channel: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "4")]
pub tags: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct VideoChannelSegmentsMetadata {
#[prost(int32, tag = "1")]
pub frame_count: i32,
#[prost(int32, tag = "2")]
pub segment_count: i32,
#[prost(message, optional, tag = "3")]
pub min_absolute_timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "4")]
pub max_absolute_timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(double, tag = "5")]
pub media_duration_seconds: f64,
#[prost(double, tag = "6")]
pub media_frame_rate: f64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoChannelDatasetFile {
#[prost(string, tag = "1")]
pub dataset_file_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub start: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
#[prost(message, optional, tag = "3")]
pub end: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoChannelDatasetFileUpdate {
#[prost(string, tag = "1")]
pub dataset_file_id: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub start: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
#[prost(string, optional, tag = "3")]
pub name: ::core::option::Option<::prost::alloc::string::String>,
#[prost(message, optional, tag = "4")]
pub scale_parameter: ::core::option::Option<
super::super::ingest::v2::ScaleParameter,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IceServer {
#[prost(string, repeated, tag = "1")]
pub urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, optional, tag = "2")]
pub username: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "3")]
pub credential: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WhipPublishEndpoint {
#[prost(string, tag = "1")]
pub stream_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub whip_url: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "3")]
pub ice_servers: ::prost::alloc::vec::Vec<IceServer>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WhepPlaybackEndpoint {
#[prost(string, tag = "1")]
pub whep_url: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub ice_servers: ::prost::alloc::vec::Vec<IceServer>,
#[prost(string, tag = "3")]
pub playback_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VideoStream {
#[prost(string, tag = "1")]
pub stream_id: ::prost::alloc::string::String,
#[prost(string, optional, tag = "2")]
pub video_rid: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "VideoStreamStatus", tag = "3")]
pub status: i32,
#[prost(message, optional, tag = "4")]
pub start: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
#[prost(message, optional, tag = "5")]
pub end: ::core::option::Option<super::super::super::google::protobuf::Timestamp>,
#[prost(message, optional, tag = "6")]
pub created_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "7")]
pub updated_at: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChannelSegmentTimeRangesRequest {
#[prost(message, optional, tag = "1")]
pub channel_series: ::core::option::Option<VideoChannelSeries>,
#[prost(message, optional, tag = "2")]
pub bounds: ::core::option::Option<TimeBounds>,
#[prost(int32, optional, tag = "3")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChannelSegmentTimeRangesResponse {
#[prost(message, repeated, tag = "1")]
pub segment_time_ranges: ::prost::alloc::vec::Vec<SegmentTimeRange>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetChannelSegmentsMetadataRequest {
#[prost(message, optional, tag = "1")]
pub channel_series: ::core::option::Option<VideoChannelSeries>,
#[prost(message, optional, tag = "2")]
pub bounds: ::core::option::Option<TimeBounds>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetChannelSegmentsMetadataResponse {
#[prost(message, optional, tag = "1")]
pub segments_metadata: ::core::option::Option<VideoChannelSegmentsMetadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetChannelSegmentByTimestampRequest {
#[prost(message, optional, tag = "1")]
pub channel_series: ::core::option::Option<VideoChannelSeries>,
#[prost(message, optional, tag = "2")]
pub timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "3")]
pub view_range_start: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetChannelSegmentByTimestampResponse {
#[prost(message, optional, tag = "1")]
pub segment: ::core::option::Option<Segment>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetChannelSegmentAtOrAfterTimestampRequest {
#[prost(message, optional, tag = "1")]
pub channel_series: ::core::option::Option<VideoChannelSeries>,
#[prost(message, optional, tag = "2")]
pub timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetChannelSegmentAtOrAfterTimestampResponse {
#[prost(message, optional, tag = "1")]
pub segment: ::core::option::Option<Segment>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartChannelStreamRequest {
#[prost(message, optional, tag = "1")]
pub channel_series: ::core::option::Option<VideoChannelSeries>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StartChannelStreamResponse {
#[prost(message, optional, tag = "1")]
pub stream: ::core::option::Option<VideoStream>,
#[prost(message, optional, tag = "2")]
pub publish_endpoint: ::core::option::Option<WhipPublishEndpoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetChannelStreamPlaybackRequest {
#[prost(message, optional, tag = "1")]
pub channel_series: ::core::option::Option<VideoChannelSeries>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetChannelStreamPlaybackResponse {
#[prost(message, optional, tag = "1")]
pub playback_endpoint: ::core::option::Option<WhepPlaybackEndpoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVideoStreamRequest {
#[prost(string, tag = "1")]
pub video_rid: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub stream_id: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetVideoStreamResponse {
#[prost(message, optional, tag = "1")]
pub stream: ::core::option::Option<VideoStream>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChannelStreamsRequest {
#[prost(message, optional, tag = "1")]
pub channel_series: ::core::option::Option<VideoChannelSeries>,
#[prost(message, optional, tag = "2")]
pub bounds: ::core::option::Option<TimeBounds>,
#[prost(int32, optional, tag = "3")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChannelStreamsResponse {
#[prost(message, repeated, tag = "1")]
pub streams: ::prost::alloc::vec::Vec<VideoStream>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChannelDatasetFilesRequest {
#[prost(message, optional, tag = "1")]
pub channel_series: ::core::option::Option<VideoChannelSeries>,
#[prost(message, optional, tag = "2")]
pub bounds: ::core::option::Option<TimeBounds>,
#[prost(int32, optional, tag = "3")]
pub page_size: ::core::option::Option<i32>,
#[prost(string, tag = "4")]
pub page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChannelDatasetFilesResponse {
#[prost(message, repeated, tag = "1")]
pub dataset_files: ::prost::alloc::vec::Vec<VideoChannelDatasetFile>,
#[prost(string, tag = "2")]
pub next_page_token: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateChannelDatasetFilesRequest {
#[prost(message, repeated, tag = "3")]
pub updates: ::prost::alloc::vec::Vec<VideoChannelDatasetFileUpdate>,
#[prost(
oneof = "batch_update_channel_dataset_files_request::FileScope",
tags = "1, 2"
)]
pub file_scope: ::core::option::Option<
batch_update_channel_dataset_files_request::FileScope,
>,
}
pub mod batch_update_channel_dataset_files_request {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum FileScope {
#[prost(string, tag = "1")]
DatasetRid(::prost::alloc::string::String),
#[prost(message, tag = "2")]
ChannelSeries(super::VideoChannelSeries),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchUpdateChannelDatasetFilesResponse {
#[prost(message, repeated, tag = "1")]
pub dataset_files: ::prost::alloc::vec::Vec<VideoChannelDatasetFile>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndChannelStreamRequest {
#[prost(message, optional, tag = "1")]
pub channel_series: ::core::option::Option<VideoChannelSeries>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EndChannelStreamResponse {
#[prost(message, optional, tag = "1")]
pub stream: ::core::option::Option<VideoStream>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetChannelPlaylistRequest {
#[prost(message, optional, tag = "1")]
pub channel_series: ::core::option::Option<VideoChannelSeries>,
#[prost(message, optional, tag = "2")]
pub bounds: ::core::option::Option<TimeBounds>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UploadStreamSegmentRequest {
#[prost(string, tag = "1")]
pub stream_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub file_name: ::prost::alloc::string::String,
#[prost(double, tag = "3")]
pub duration_seconds: f64,
#[prost(int64, tag = "4")]
pub start_time_seconds: i64,
#[prost(int32, tag = "5")]
pub start_time_nanos: i32,
#[prost(int64, tag = "6")]
pub size_bytes: i64,
#[prost(message, optional, tag = "7")]
pub body: ::core::option::Option<super::super::super::google::api::HttpBody>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct UploadStreamSegmentResponse {}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VideoStreamStatus {
Unspecified = 0,
Active = 1,
Ended = 2,
}
impl VideoStreamStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "VIDEO_STREAM_STATUS_UNSPECIFIED",
Self::Active => "VIDEO_STREAM_STATUS_ACTIVE",
Self::Ended => "VIDEO_STREAM_STATUS_ENDED",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"VIDEO_STREAM_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
"VIDEO_STREAM_STATUS_ACTIVE" => Some(Self::Active),
"VIDEO_STREAM_STATUS_ENDED" => Some(Self::Ended),
_ => None,
}
}
}
pub mod video_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 VideoServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl VideoServiceClient<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> VideoServiceClient<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,
) -> VideoServiceClient<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,
{
VideoServiceClient::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 list_channel_segment_time_ranges(
&mut self,
request: impl tonic::IntoRequest<super::ListChannelSegmentTimeRangesRequest>,
) -> std::result::Result<
tonic::Response<super::ListChannelSegmentTimeRangesResponse>,
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.videos.v1.VideoService/ListChannelSegmentTimeRanges",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoService",
"ListChannelSegmentTimeRanges",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_channel_segments_metadata(
&mut self,
request: impl tonic::IntoRequest<super::GetChannelSegmentsMetadataRequest>,
) -> std::result::Result<
tonic::Response<super::GetChannelSegmentsMetadataResponse>,
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.videos.v1.VideoService/GetChannelSegmentsMetadata",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoService",
"GetChannelSegmentsMetadata",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_channel_segment_by_timestamp(
&mut self,
request: impl tonic::IntoRequest<super::GetChannelSegmentByTimestampRequest>,
) -> std::result::Result<
tonic::Response<super::GetChannelSegmentByTimestampResponse>,
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.videos.v1.VideoService/GetChannelSegmentByTimestamp",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoService",
"GetChannelSegmentByTimestamp",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_channel_segment_at_or_after_timestamp(
&mut self,
request: impl tonic::IntoRequest<
super::GetChannelSegmentAtOrAfterTimestampRequest,
>,
) -> std::result::Result<
tonic::Response<super::GetChannelSegmentAtOrAfterTimestampResponse>,
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.videos.v1.VideoService/GetChannelSegmentAtOrAfterTimestamp",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoService",
"GetChannelSegmentAtOrAfterTimestamp",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn start_channel_stream(
&mut self,
request: impl tonic::IntoRequest<super::StartChannelStreamRequest>,
) -> std::result::Result<
tonic::Response<super::StartChannelStreamResponse>,
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.videos.v1.VideoService/StartChannelStream",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoService",
"StartChannelStream",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_channel_stream_playback(
&mut self,
request: impl tonic::IntoRequest<super::GetChannelStreamPlaybackRequest>,
) -> std::result::Result<
tonic::Response<super::GetChannelStreamPlaybackResponse>,
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.videos.v1.VideoService/GetChannelStreamPlayback",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoService",
"GetChannelStreamPlayback",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_video_stream(
&mut self,
request: impl tonic::IntoRequest<super::GetVideoStreamRequest>,
) -> std::result::Result<
tonic::Response<super::GetVideoStreamResponse>,
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.videos.v1.VideoService/GetVideoStream",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.videos.v1.VideoService", "GetVideoStream"),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_channel_streams(
&mut self,
request: impl tonic::IntoRequest<super::ListChannelStreamsRequest>,
) -> std::result::Result<
tonic::Response<super::ListChannelStreamsResponse>,
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.videos.v1.VideoService/ListChannelStreams",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoService",
"ListChannelStreams",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn list_channel_dataset_files(
&mut self,
request: impl tonic::IntoRequest<super::ListChannelDatasetFilesRequest>,
) -> std::result::Result<
tonic::Response<super::ListChannelDatasetFilesResponse>,
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.videos.v1.VideoService/ListChannelDatasetFiles",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoService",
"ListChannelDatasetFiles",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn batch_update_channel_dataset_files(
&mut self,
request: impl tonic::IntoRequest<
super::BatchUpdateChannelDatasetFilesRequest,
>,
) -> std::result::Result<
tonic::Response<super::BatchUpdateChannelDatasetFilesResponse>,
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.videos.v1.VideoService/BatchUpdateChannelDatasetFiles",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoService",
"BatchUpdateChannelDatasetFiles",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn end_channel_stream(
&mut self,
request: impl tonic::IntoRequest<super::EndChannelStreamRequest>,
) -> std::result::Result<
tonic::Response<super::EndChannelStreamResponse>,
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.videos.v1.VideoService/EndChannelStream",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("nominal.videos.v1.VideoService", "EndChannelStream"),
);
self.inner.unary(req, path, codec).await
}
pub async fn get_channel_playlist(
&mut self,
request: impl tonic::IntoRequest<super::GetChannelPlaylistRequest>,
) -> std::result::Result<
tonic::Response<
tonic::codec::Streaming<
super::super::super::super::google::api::HttpBody,
>,
>,
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.videos.v1.VideoService/GetChannelPlaylist",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoService",
"GetChannelPlaylist",
),
);
self.inner.server_streaming(req, path, codec).await
}
pub async fn upload_stream_segment(
&mut self,
request: impl tonic::IntoStreamingRequest<
Message = super::UploadStreamSegmentRequest,
>,
) -> std::result::Result<
tonic::Response<super::UploadStreamSegmentResponse>,
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.videos.v1.VideoService/UploadStreamSegment",
);
let mut req = request.into_streaming_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.videos.v1.VideoService",
"UploadStreamSegment",
),
);
self.inner.client_streaming(req, path, codec).await
}
}
}