#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Timestamp {
#[prost(int64, tag = "1")]
pub seconds: i64,
#[prost(int64, tag = "2")]
pub nanos: i64,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Range {
#[prost(message, optional, tag = "1")]
pub start_time_inclusive: ::core::option::Option<Timestamp>,
#[prost(message, optional, tag = "2")]
pub end_time_exclusive: ::core::option::Option<Timestamp>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TagValues {
#[prost(string, repeated, tag = "1")]
pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChannelMetadata {
#[prost(string, tag = "1")]
pub channel: ::prost::alloc::string::String,
#[prost(enumeration = "DataType", tag = "2")]
pub data_type: i32,
#[prost(map = "string, message", tag = "3")]
pub all_tag_values: ::std::collections::HashMap<
::prost::alloc::string::String,
TagValues,
>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChannelsRequest {
#[prost(int32, tag = "1")]
pub page_size: i32,
#[prost(message, optional, tag = "2")]
pub range: ::core::option::Option<Range>,
#[prost(string, optional, tag = "3")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListChannelsResponse {
#[prost(message, repeated, tag = "1")]
pub channels: ::prost::alloc::vec::Vec<ChannelMetadata>,
#[prost(string, optional, tag = "2")]
pub page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryChannelRequest {
#[prost(string, tag = "1")]
pub channel: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "2")]
pub tags: ::std::collections::HashMap<
::prost::alloc::string::String,
::prost::alloc::string::String,
>,
#[prost(message, optional, tag = "3")]
pub range: ::core::option::Option<Range>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct IntPoints {
#[prost(message, repeated, tag = "1")]
pub timestamps: ::prost::alloc::vec::Vec<Timestamp>,
#[prost(int64, repeated, tag = "2")]
pub values: ::prost::alloc::vec::Vec<i64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DoublePoints {
#[prost(message, repeated, tag = "1")]
pub timestamps: ::prost::alloc::vec::Vec<Timestamp>,
#[prost(double, repeated, tag = "2")]
pub values: ::prost::alloc::vec::Vec<f64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringPoints {
#[prost(message, repeated, tag = "1")]
pub timestamps: ::prost::alloc::vec::Vec<Timestamp>,
#[prost(string, repeated, tag = "2")]
pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryChannelResponse {
#[prost(oneof = "query_channel_response::Values", tags = "1, 2, 3")]
pub values: ::core::option::Option<query_channel_response::Values>,
}
pub mod query_channel_response {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Values {
#[prost(message, tag = "1")]
Ints(super::IntPoints),
#[prost(message, tag = "2")]
Doubles(super::DoublePoints),
#[prost(message, tag = "3")]
Strings(super::StringPoints),
}
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DataType {
Unspecified = 0,
Int = 1,
Double = 2,
String = 3,
}
impl DataType {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "DATA_TYPE_UNSPECIFIED",
Self::Int => "DATA_TYPE_INT",
Self::Double => "DATA_TYPE_DOUBLE",
Self::String => "DATA_TYPE_STRING",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"DATA_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
"DATA_TYPE_INT" => Some(Self::Int),
"DATA_TYPE_DOUBLE" => Some(Self::Double),
"DATA_TYPE_STRING" => Some(Self::String),
_ => None,
}
}
}
pub mod connections_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 ConnectionsServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ConnectionsServiceClient<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> ConnectionsServiceClient<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,
) -> ConnectionsServiceClient<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,
{
ConnectionsServiceClient::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_channels(
&mut self,
request: impl tonic::IntoRequest<super::ListChannelsRequest>,
) -> std::result::Result<
tonic::Response<super::ListChannelsResponse>,
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.connections.v1.ConnectionsService/ListChannels",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.connections.v1.ConnectionsService",
"ListChannels",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn query_channel(
&mut self,
request: impl tonic::IntoRequest<super::QueryChannelRequest>,
) -> std::result::Result<
tonic::Response<tonic::codec::Streaming<super::QueryChannelResponse>>,
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.connections.v1.ConnectionsService/QueryChannel",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.connections.v1.ConnectionsService",
"QueryChannel",
),
);
self.inner.server_streaming(req, path, codec).await
}
}
}