#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteBatchesRequest {
#[prost(string, tag = "1")]
pub data_source_rid: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub batches: ::prost::alloc::vec::Vec<RowBatch>,
#[prost(string, optional, tag = "3")]
pub source_name: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct WriteBatchesResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RowBatch {
#[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 points: ::core::option::Option<Points>,
#[prost(string, optional, tag = "4")]
pub unit: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Points {
#[prost(oneof = "points::Points", tags = "1, 2, 3, 4, 5, 6")]
pub points: ::core::option::Option<points::Points>,
}
pub mod points {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Points {
#[prost(message, tag = "1")]
DoublePoints(super::DoublePoints),
#[prost(message, tag = "2")]
StringPoints(super::StringPoints),
#[prost(message, tag = "3")]
Int64Points(super::Int64Points),
#[prost(message, tag = "4")]
Uint64Points(super::Uint64Points),
#[prost(message, tag = "5")]
ArrayPoints(super::ArrayPoints),
#[prost(message, tag = "6")]
StructPoints(super::StructPoints),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DoublePoints {
#[prost(message, repeated, tag = "1")]
pub points: ::prost::alloc::vec::Vec<DoublePoint>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct DoublePoint {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(double, tag = "2")]
pub value: f64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringPoints {
#[prost(message, repeated, tag = "1")]
pub points: ::prost::alloc::vec::Vec<StringPoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringPoint {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(string, tag = "2")]
pub value: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Int64Points {
#[prost(message, repeated, tag = "1")]
pub points: ::prost::alloc::vec::Vec<Int64Point>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Int64Point {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(int64, tag = "2")]
pub value: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Uint64Points {
#[prost(message, repeated, tag = "1")]
pub points: ::prost::alloc::vec::Vec<Uint64Point>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct Uint64Point {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(uint64, tag = "2")]
pub value: u64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ArrayPoints {
#[prost(oneof = "array_points::ArrayPoints", tags = "1, 2")]
pub array_points: ::core::option::Option<array_points::ArrayPoints>,
}
pub mod array_points {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ArrayPoints {
#[prost(message, tag = "1")]
DoubleArrayPoints(super::DoubleArrayPoints),
#[prost(message, tag = "2")]
StringArrayPoints(super::StringArrayPoints),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DoubleArrayPoints {
#[prost(message, repeated, tag = "1")]
pub points: ::prost::alloc::vec::Vec<DoubleArrayPoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DoubleArrayPoint {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(double, repeated, tag = "2")]
pub values: ::prost::alloc::vec::Vec<f64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringArrayPoints {
#[prost(message, repeated, tag = "1")]
pub points: ::prost::alloc::vec::Vec<StringArrayPoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StringArrayPoint {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(string, repeated, tag = "2")]
pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StructPoints {
#[prost(message, repeated, tag = "1")]
pub points: ::prost::alloc::vec::Vec<StructPoint>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StructPoint {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(string, tag = "2")]
pub json: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteColumnBatchesRequest {
#[prost(string, tag = "1")]
pub data_source_rid: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub batches: ::prost::alloc::vec::Vec<ColumnBatch>,
#[prost(string, optional, tag = "3")]
pub source_name: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct WriteColumnBatchesResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ColumnBatch {
#[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, repeated, tag = "3")]
pub timestamps: ::prost::alloc::vec::Vec<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "4")]
pub values: ::core::option::Option<ColumnValues>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ColumnValues {
#[prost(oneof = "column_values::Values", tags = "1, 2, 3, 4, 5, 6")]
pub values: ::core::option::Option<column_values::Values>,
}
pub mod column_values {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Values {
#[prost(message, tag = "1")]
Doubles(super::super::super::direct_channel_writer::v2::DoublePoints),
#[prost(message, tag = "2")]
Strings(super::super::super::direct_channel_writer::v2::StringPoints),
#[prost(message, tag = "3")]
Int64s(super::super::super::direct_channel_writer::v2::IntPoints),
#[prost(message, tag = "4")]
Uint64s(super::super::super::direct_channel_writer::v2::Uint64Points),
#[prost(message, tag = "5")]
Arrays(super::super::super::direct_channel_writer::v2::ArrayPoints),
#[prost(message, tag = "6")]
Structs(super::super::super::direct_channel_writer::v2::StructPoints),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct WriteLogsRequest {
#[prost(string, tag = "1")]
pub data_source_rid: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub logs: ::prost::alloc::vec::Vec<LogPoint>,
#[prost(string, optional, tag = "3")]
pub channel: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct WriteLogsResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LogPoint {
#[prost(message, optional, tag = "1")]
pub timestamp: ::core::option::Option<
super::super::super::google::protobuf::Timestamp,
>,
#[prost(message, optional, tag = "2")]
pub value: ::core::option::Option<super::super::direct_channel_writer::v2::LogValue>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum NominalChannelWriterError {
Unspecified = 0,
InvalidDataSourceRid = 1,
ValueTypeNotSet = 2,
TimestampNotSet = 3,
LogValueNotSet = 4,
BatchLimitExceeded = 5,
}
impl NominalChannelWriterError {
pub fn as_str_name(&self) -> &'static str {
match self {
Self::Unspecified => "NOMINAL_CHANNEL_WRITER_ERROR_UNSPECIFIED",
Self::InvalidDataSourceRid => {
"NOMINAL_CHANNEL_WRITER_ERROR_INVALID_DATA_SOURCE_RID"
}
Self::ValueTypeNotSet => "NOMINAL_CHANNEL_WRITER_ERROR_VALUE_TYPE_NOT_SET",
Self::TimestampNotSet => "NOMINAL_CHANNEL_WRITER_ERROR_TIMESTAMP_NOT_SET",
Self::LogValueNotSet => "NOMINAL_CHANNEL_WRITER_ERROR_LOG_VALUE_NOT_SET",
Self::BatchLimitExceeded => {
"NOMINAL_CHANNEL_WRITER_ERROR_BATCH_LIMIT_EXCEEDED"
}
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"NOMINAL_CHANNEL_WRITER_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
"NOMINAL_CHANNEL_WRITER_ERROR_INVALID_DATA_SOURCE_RID" => {
Some(Self::InvalidDataSourceRid)
}
"NOMINAL_CHANNEL_WRITER_ERROR_VALUE_TYPE_NOT_SET" => {
Some(Self::ValueTypeNotSet)
}
"NOMINAL_CHANNEL_WRITER_ERROR_TIMESTAMP_NOT_SET" => {
Some(Self::TimestampNotSet)
}
"NOMINAL_CHANNEL_WRITER_ERROR_LOG_VALUE_NOT_SET" => {
Some(Self::LogValueNotSet)
}
"NOMINAL_CHANNEL_WRITER_ERROR_BATCH_LIMIT_EXCEEDED" => {
Some(Self::BatchLimitExceeded)
}
_ => None,
}
}
}
pub mod nominal_channel_writer_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 NominalChannelWriterServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl NominalChannelWriterServiceClient<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> NominalChannelWriterServiceClient<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,
) -> NominalChannelWriterServiceClient<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,
{
NominalChannelWriterServiceClient::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 write_batches(
&mut self,
request: impl tonic::IntoRequest<super::WriteBatchesRequest>,
) -> std::result::Result<
tonic::Response<super::WriteBatchesResponse>,
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.channel_writer.v1.NominalChannelWriterService/WriteBatches",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.channel_writer.v1.NominalChannelWriterService",
"WriteBatches",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn write_column_batches(
&mut self,
request: impl tonic::IntoRequest<super::WriteColumnBatchesRequest>,
) -> std::result::Result<
tonic::Response<super::WriteColumnBatchesResponse>,
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.channel_writer.v1.NominalChannelWriterService/WriteColumnBatches",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.channel_writer.v1.NominalChannelWriterService",
"WriteColumnBatches",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn write_logs(
&mut self,
request: impl tonic::IntoRequest<super::WriteLogsRequest>,
) -> std::result::Result<
tonic::Response<super::WriteLogsResponse>,
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.channel_writer.v1.NominalChannelWriterService/WriteLogs",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"nominal.channel_writer.v1.NominalChannelWriterService",
"WriteLogs",
),
);
self.inner.unary(req, path, codec).await
}
}
}