1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct WriteBatchesRequest {
4 #[prost(string, tag = "1")]
5 pub data_source_rid: ::prost::alloc::string::String,
6 #[prost(message, repeated, tag = "2")]
7 pub batches: ::prost::alloc::vec::Vec<RowBatch>,
8 #[prost(string, optional, tag = "3")]
9 pub source_name: ::core::option::Option<::prost::alloc::string::String>,
10}
11#[derive(Clone, Copy, PartialEq, ::prost::Message)]
12pub struct WriteBatchesResponse {}
13#[derive(Clone, PartialEq, ::prost::Message)]
14pub struct RowBatch {
15 #[prost(string, tag = "1")]
16 pub channel: ::prost::alloc::string::String,
17 #[prost(map = "string, string", tag = "2")]
18 pub tags: ::std::collections::HashMap<
19 ::prost::alloc::string::String,
20 ::prost::alloc::string::String,
21 >,
22 #[prost(message, optional, tag = "3")]
23 pub points: ::core::option::Option<Points>,
24 #[prost(string, optional, tag = "4")]
25 pub unit: ::core::option::Option<::prost::alloc::string::String>,
26}
27#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct Points {
29 #[prost(oneof = "points::Points", tags = "1, 2, 3, 4, 5, 6")]
30 pub points: ::core::option::Option<points::Points>,
31}
32pub mod points {
34 #[derive(Clone, PartialEq, ::prost::Oneof)]
35 pub enum Points {
36 #[prost(message, tag = "1")]
37 DoublePoints(super::DoublePoints),
38 #[prost(message, tag = "2")]
39 StringPoints(super::StringPoints),
40 #[prost(message, tag = "3")]
41 Int64Points(super::Int64Points),
42 #[prost(message, tag = "4")]
43 Uint64Points(super::Uint64Points),
44 #[prost(message, tag = "5")]
45 ArrayPoints(super::ArrayPoints),
46 #[prost(message, tag = "6")]
47 StructPoints(super::StructPoints),
48 }
49}
50#[derive(Clone, PartialEq, ::prost::Message)]
51pub struct DoublePoints {
52 #[prost(message, repeated, tag = "1")]
53 pub points: ::prost::alloc::vec::Vec<DoublePoint>,
54}
55#[derive(Clone, Copy, PartialEq, ::prost::Message)]
56pub struct DoublePoint {
57 #[prost(message, optional, tag = "1")]
58 pub timestamp: ::core::option::Option<
59 super::super::super::google::protobuf::Timestamp,
60 >,
61 #[prost(double, tag = "2")]
62 pub value: f64,
63}
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct StringPoints {
66 #[prost(message, repeated, tag = "1")]
67 pub points: ::prost::alloc::vec::Vec<StringPoint>,
68}
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct StringPoint {
71 #[prost(message, optional, tag = "1")]
72 pub timestamp: ::core::option::Option<
73 super::super::super::google::protobuf::Timestamp,
74 >,
75 #[prost(string, tag = "2")]
76 pub value: ::prost::alloc::string::String,
77}
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct Int64Points {
80 #[prost(message, repeated, tag = "1")]
81 pub points: ::prost::alloc::vec::Vec<Int64Point>,
82}
83#[derive(Clone, Copy, PartialEq, ::prost::Message)]
84pub struct Int64Point {
85 #[prost(message, optional, tag = "1")]
86 pub timestamp: ::core::option::Option<
87 super::super::super::google::protobuf::Timestamp,
88 >,
89 #[prost(int64, tag = "2")]
90 pub value: i64,
91}
92#[derive(Clone, PartialEq, ::prost::Message)]
93pub struct Uint64Points {
94 #[prost(message, repeated, tag = "1")]
95 pub points: ::prost::alloc::vec::Vec<Uint64Point>,
96}
97#[derive(Clone, Copy, PartialEq, ::prost::Message)]
98pub struct Uint64Point {
99 #[prost(message, optional, tag = "1")]
100 pub timestamp: ::core::option::Option<
101 super::super::super::google::protobuf::Timestamp,
102 >,
103 #[prost(uint64, tag = "2")]
104 pub value: u64,
105}
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct ArrayPoints {
108 #[prost(oneof = "array_points::ArrayPoints", tags = "1, 2")]
109 pub array_points: ::core::option::Option<array_points::ArrayPoints>,
110}
111pub mod array_points {
113 #[derive(Clone, PartialEq, ::prost::Oneof)]
114 pub enum ArrayPoints {
115 #[prost(message, tag = "1")]
116 DoubleArrayPoints(super::DoubleArrayPoints),
117 #[prost(message, tag = "2")]
118 StringArrayPoints(super::StringArrayPoints),
119 }
120}
121#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct DoubleArrayPoints {
123 #[prost(message, repeated, tag = "1")]
124 pub points: ::prost::alloc::vec::Vec<DoubleArrayPoint>,
125}
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct DoubleArrayPoint {
128 #[prost(message, optional, tag = "1")]
129 pub timestamp: ::core::option::Option<
130 super::super::super::google::protobuf::Timestamp,
131 >,
132 #[prost(double, repeated, tag = "2")]
133 pub values: ::prost::alloc::vec::Vec<f64>,
134}
135#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct StringArrayPoints {
137 #[prost(message, repeated, tag = "1")]
138 pub points: ::prost::alloc::vec::Vec<StringArrayPoint>,
139}
140#[derive(Clone, PartialEq, ::prost::Message)]
141pub struct StringArrayPoint {
142 #[prost(message, optional, tag = "1")]
143 pub timestamp: ::core::option::Option<
144 super::super::super::google::protobuf::Timestamp,
145 >,
146 #[prost(string, repeated, tag = "2")]
147 pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
148}
149#[derive(Clone, PartialEq, ::prost::Message)]
150pub struct StructPoints {
151 #[prost(message, repeated, tag = "1")]
152 pub points: ::prost::alloc::vec::Vec<StructPoint>,
153}
154#[derive(Clone, PartialEq, ::prost::Message)]
155pub struct StructPoint {
156 #[prost(message, optional, tag = "1")]
157 pub timestamp: ::core::option::Option<
158 super::super::super::google::protobuf::Timestamp,
159 >,
160 #[prost(string, tag = "2")]
161 pub json: ::prost::alloc::string::String,
162}
163#[derive(Clone, PartialEq, ::prost::Message)]
164pub struct WriteColumnBatchesRequest {
165 #[prost(string, tag = "1")]
166 pub data_source_rid: ::prost::alloc::string::String,
167 #[prost(message, repeated, tag = "2")]
168 pub batches: ::prost::alloc::vec::Vec<ColumnBatch>,
169 #[prost(string, optional, tag = "3")]
170 pub source_name: ::core::option::Option<::prost::alloc::string::String>,
171}
172#[derive(Clone, Copy, PartialEq, ::prost::Message)]
173pub struct WriteColumnBatchesResponse {}
174#[derive(Clone, PartialEq, ::prost::Message)]
175pub struct ColumnBatch {
176 #[prost(string, tag = "1")]
177 pub channel: ::prost::alloc::string::String,
178 #[prost(map = "string, string", tag = "2")]
179 pub tags: ::std::collections::HashMap<
180 ::prost::alloc::string::String,
181 ::prost::alloc::string::String,
182 >,
183 #[prost(message, repeated, tag = "3")]
184 pub timestamps: ::prost::alloc::vec::Vec<
185 super::super::super::google::protobuf::Timestamp,
186 >,
187 #[prost(message, optional, tag = "4")]
188 pub values: ::core::option::Option<ColumnValues>,
189}
190#[derive(Clone, PartialEq, ::prost::Message)]
191pub struct ColumnValues {
192 #[prost(oneof = "column_values::Values", tags = "1, 2, 3, 4, 5, 6")]
193 pub values: ::core::option::Option<column_values::Values>,
194}
195pub mod column_values {
197 #[derive(Clone, PartialEq, ::prost::Oneof)]
198 pub enum Values {
199 #[prost(message, tag = "1")]
200 Doubles(super::super::super::direct_channel_writer::v2::DoublePoints),
201 #[prost(message, tag = "2")]
202 Strings(super::super::super::direct_channel_writer::v2::StringPoints),
203 #[prost(message, tag = "3")]
204 Int64s(super::super::super::direct_channel_writer::v2::IntPoints),
205 #[prost(message, tag = "4")]
206 Uint64s(super::super::super::direct_channel_writer::v2::Uint64Points),
207 #[prost(message, tag = "5")]
208 Arrays(super::super::super::direct_channel_writer::v2::ArrayPoints),
209 #[prost(message, tag = "6")]
210 Structs(super::super::super::direct_channel_writer::v2::StructPoints),
211 }
212}
213#[derive(Clone, PartialEq, ::prost::Message)]
214pub struct WriteLogsRequest {
215 #[prost(string, tag = "1")]
216 pub data_source_rid: ::prost::alloc::string::String,
217 #[prost(message, repeated, tag = "2")]
218 pub logs: ::prost::alloc::vec::Vec<LogPoint>,
219 #[prost(string, optional, tag = "3")]
220 pub channel: ::core::option::Option<::prost::alloc::string::String>,
221}
222#[derive(Clone, Copy, PartialEq, ::prost::Message)]
223pub struct WriteLogsResponse {}
224#[derive(Clone, PartialEq, ::prost::Message)]
225pub struct LogPoint {
226 #[prost(message, optional, tag = "1")]
227 pub timestamp: ::core::option::Option<
228 super::super::super::google::protobuf::Timestamp,
229 >,
230 #[prost(message, optional, tag = "2")]
231 pub value: ::core::option::Option<super::super::direct_channel_writer::v2::LogValue>,
232}
233#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
234#[repr(i32)]
235pub enum NominalChannelWriterError {
236 Unspecified = 0,
237 InvalidDataSourceRid = 1,
238 ValueTypeNotSet = 2,
239 TimestampNotSet = 3,
240 LogValueNotSet = 4,
241 BatchLimitExceeded = 5,
242}
243impl NominalChannelWriterError {
244 pub fn as_str_name(&self) -> &'static str {
249 match self {
250 Self::Unspecified => "NOMINAL_CHANNEL_WRITER_ERROR_UNSPECIFIED",
251 Self::InvalidDataSourceRid => {
252 "NOMINAL_CHANNEL_WRITER_ERROR_INVALID_DATA_SOURCE_RID"
253 }
254 Self::ValueTypeNotSet => "NOMINAL_CHANNEL_WRITER_ERROR_VALUE_TYPE_NOT_SET",
255 Self::TimestampNotSet => "NOMINAL_CHANNEL_WRITER_ERROR_TIMESTAMP_NOT_SET",
256 Self::LogValueNotSet => "NOMINAL_CHANNEL_WRITER_ERROR_LOG_VALUE_NOT_SET",
257 Self::BatchLimitExceeded => {
258 "NOMINAL_CHANNEL_WRITER_ERROR_BATCH_LIMIT_EXCEEDED"
259 }
260 }
261 }
262 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
264 match value {
265 "NOMINAL_CHANNEL_WRITER_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
266 "NOMINAL_CHANNEL_WRITER_ERROR_INVALID_DATA_SOURCE_RID" => {
267 Some(Self::InvalidDataSourceRid)
268 }
269 "NOMINAL_CHANNEL_WRITER_ERROR_VALUE_TYPE_NOT_SET" => {
270 Some(Self::ValueTypeNotSet)
271 }
272 "NOMINAL_CHANNEL_WRITER_ERROR_TIMESTAMP_NOT_SET" => {
273 Some(Self::TimestampNotSet)
274 }
275 "NOMINAL_CHANNEL_WRITER_ERROR_LOG_VALUE_NOT_SET" => {
276 Some(Self::LogValueNotSet)
277 }
278 "NOMINAL_CHANNEL_WRITER_ERROR_BATCH_LIMIT_EXCEEDED" => {
279 Some(Self::BatchLimitExceeded)
280 }
281 _ => None,
282 }
283 }
284}
285pub mod nominal_channel_writer_service_client {
287 #![allow(
288 unused_variables,
289 dead_code,
290 missing_docs,
291 clippy::wildcard_imports,
292 clippy::let_unit_value,
293 )]
294 use tonic::codegen::*;
295 use tonic::codegen::http::Uri;
296 #[derive(Debug, Clone)]
297 pub struct NominalChannelWriterServiceClient<T> {
298 inner: tonic::client::Grpc<T>,
299 }
300 impl NominalChannelWriterServiceClient<tonic::transport::Channel> {
301 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
303 where
304 D: TryInto<tonic::transport::Endpoint>,
305 D::Error: Into<StdError>,
306 {
307 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
308 Ok(Self::new(conn))
309 }
310 }
311 impl<T> NominalChannelWriterServiceClient<T>
312 where
313 T: tonic::client::GrpcService<tonic::body::Body>,
314 T::Error: Into<StdError>,
315 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
316 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
317 {
318 pub fn new(inner: T) -> Self {
319 let inner = tonic::client::Grpc::new(inner);
320 Self { inner }
321 }
322 pub fn with_origin(inner: T, origin: Uri) -> Self {
323 let inner = tonic::client::Grpc::with_origin(inner, origin);
324 Self { inner }
325 }
326 pub fn with_interceptor<F>(
327 inner: T,
328 interceptor: F,
329 ) -> NominalChannelWriterServiceClient<InterceptedService<T, F>>
330 where
331 F: tonic::service::Interceptor,
332 T::ResponseBody: Default,
333 T: tonic::codegen::Service<
334 http::Request<tonic::body::Body>,
335 Response = http::Response<
336 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
337 >,
338 >,
339 <T as tonic::codegen::Service<
340 http::Request<tonic::body::Body>,
341 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
342 {
343 NominalChannelWriterServiceClient::new(
344 InterceptedService::new(inner, interceptor),
345 )
346 }
347 #[must_use]
352 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
353 self.inner = self.inner.send_compressed(encoding);
354 self
355 }
356 #[must_use]
358 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
359 self.inner = self.inner.accept_compressed(encoding);
360 self
361 }
362 #[must_use]
366 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
367 self.inner = self.inner.max_decoding_message_size(limit);
368 self
369 }
370 #[must_use]
374 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
375 self.inner = self.inner.max_encoding_message_size(limit);
376 self
377 }
378 pub async fn write_batches(
379 &mut self,
380 request: impl tonic::IntoRequest<super::WriteBatchesRequest>,
381 ) -> std::result::Result<
382 tonic::Response<super::WriteBatchesResponse>,
383 tonic::Status,
384 > {
385 self.inner
386 .ready()
387 .await
388 .map_err(|e| {
389 tonic::Status::unknown(
390 format!("Service was not ready: {}", e.into()),
391 )
392 })?;
393 let codec = tonic::codec::ProstCodec::default();
394 let path = http::uri::PathAndQuery::from_static(
395 "/nominal.channel_writer.v1.NominalChannelWriterService/WriteBatches",
396 );
397 let mut req = request.into_request();
398 req.extensions_mut()
399 .insert(
400 GrpcMethod::new(
401 "nominal.channel_writer.v1.NominalChannelWriterService",
402 "WriteBatches",
403 ),
404 );
405 self.inner.unary(req, path, codec).await
406 }
407 pub async fn write_column_batches(
408 &mut self,
409 request: impl tonic::IntoRequest<super::WriteColumnBatchesRequest>,
410 ) -> std::result::Result<
411 tonic::Response<super::WriteColumnBatchesResponse>,
412 tonic::Status,
413 > {
414 self.inner
415 .ready()
416 .await
417 .map_err(|e| {
418 tonic::Status::unknown(
419 format!("Service was not ready: {}", e.into()),
420 )
421 })?;
422 let codec = tonic::codec::ProstCodec::default();
423 let path = http::uri::PathAndQuery::from_static(
424 "/nominal.channel_writer.v1.NominalChannelWriterService/WriteColumnBatches",
425 );
426 let mut req = request.into_request();
427 req.extensions_mut()
428 .insert(
429 GrpcMethod::new(
430 "nominal.channel_writer.v1.NominalChannelWriterService",
431 "WriteColumnBatches",
432 ),
433 );
434 self.inner.unary(req, path, codec).await
435 }
436 pub async fn write_logs(
437 &mut self,
438 request: impl tonic::IntoRequest<super::WriteLogsRequest>,
439 ) -> std::result::Result<
440 tonic::Response<super::WriteLogsResponse>,
441 tonic::Status,
442 > {
443 self.inner
444 .ready()
445 .await
446 .map_err(|e| {
447 tonic::Status::unknown(
448 format!("Service was not ready: {}", e.into()),
449 )
450 })?;
451 let codec = tonic::codec::ProstCodec::default();
452 let path = http::uri::PathAndQuery::from_static(
453 "/nominal.channel_writer.v1.NominalChannelWriterService/WriteLogs",
454 );
455 let mut req = request.into_request();
456 req.extensions_mut()
457 .insert(
458 GrpcMethod::new(
459 "nominal.channel_writer.v1.NominalChannelWriterService",
460 "WriteLogs",
461 ),
462 );
463 self.inner.unary(req, path, codec).await
464 }
465 }
466}