nominal-api-proto 0.1496.0

Protobuf/gRPC API bindings for the Nominal platform
Documentation
// This file is @generated by prost-build.
#[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, Copy, 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,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum VideoError {
    InvalidRequest = 0,
}
impl VideoError {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::InvalidRequest => "VIDEO_ERROR_INVALID_REQUEST",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    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 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,
}
/// Generated client implementations.
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> {
        /// Attempt to create a new client by connecting to a given endpoint.
        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))
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[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
        }
    }
}