1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct WriteBatchesRequest {
4 #[prost(message, repeated, tag = "1")]
5 pub batches: ::prost::alloc::vec::Vec<RecordsBatch>,
6 #[prost(string, tag = "2")]
7 pub data_source_rid: ::prost::alloc::string::String,
8}
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct StreamingSessionSourceInfo {
11 #[prost(oneof = "streaming_session_source_info::Source", tags = "1, 2, 3")]
12 pub source: ::core::option::Option<streaming_session_source_info::Source>,
13}
14pub mod streaming_session_source_info {
16 #[derive(Clone, PartialEq, ::prost::Oneof)]
17 pub enum Source {
18 #[prost(message, tag = "1")]
19 Mesh(super::MeshStreamingSessionSourceInfo),
20 #[prost(message, tag = "2")]
21 DataConnector(super::DataConnectorStreamingSessionSourceInfo),
22 #[prost(message, tag = "3")]
23 Custom(super::CustomStreamingSessionSourceInfo),
24 }
25}
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct MeshStreamingSessionSourceInfo {
28 #[prost(string, tag = "1")]
29 pub source_dataset_rid: ::prost::alloc::string::String,
30 #[prost(string, tag = "2")]
31 pub source_org_rid: ::prost::alloc::string::String,
32 #[prost(string, tag = "3")]
33 pub origin_streaming_session_source: ::prost::alloc::string::String,
34}
35#[derive(Clone, PartialEq, ::prost::Message)]
36pub struct DataConnectorStreamingSessionSourceInfo {
37 #[prost(string, tag = "1")]
38 pub data_connector_rid: ::prost::alloc::string::String,
39}
40#[derive(Clone, PartialEq, ::prost::Message)]
41pub struct CustomStreamingSessionSourceInfo {
42 #[prost(string, tag = "1")]
43 pub source_name: ::prost::alloc::string::String,
44}
45#[derive(Clone, PartialEq, ::prost::Message)]
46pub struct InternalWriteBatchesRequest {
47 #[prost(message, repeated, tag = "1")]
48 pub batches: ::prost::alloc::vec::Vec<RecordsBatch>,
49 #[prost(string, tag = "2")]
50 pub data_source_rid: ::prost::alloc::string::String,
51 #[prost(message, optional, tag = "3")]
52 pub source: ::core::option::Option<StreamingSessionSourceInfo>,
53 #[prost(string, tag = "4")]
54 pub streaming_session_rid: ::prost::alloc::string::String,
55}
56#[derive(Clone, PartialEq, ::prost::Message)]
57pub struct ArrayPoints {
58 #[prost(oneof = "array_points::ArrayType", tags = "1, 2")]
59 pub array_type: ::core::option::Option<array_points::ArrayType>,
60}
61pub mod array_points {
63 #[derive(Clone, PartialEq, ::prost::Oneof)]
64 pub enum ArrayType {
65 #[prost(message, tag = "1")]
66 DoubleArrayPoints(super::DoubleArrayPoints),
67 #[prost(message, tag = "2")]
68 StringArrayPoints(super::StringArrayPoints),
69 }
70}
71#[derive(Clone, PartialEq, ::prost::Message)]
72pub struct StringArrayPoints {
73 #[prost(message, repeated, tag = "1")]
74 pub points: ::prost::alloc::vec::Vec<StringArrayPoint>,
75}
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct StringArrayPoint {
78 #[prost(string, repeated, tag = "2")]
79 pub value: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
80}
81#[derive(Clone, PartialEq, ::prost::Message)]
82pub struct DoubleArrayPoints {
83 #[prost(message, repeated, tag = "1")]
84 pub points: ::prost::alloc::vec::Vec<DoubleArrayPoint>,
85}
86#[derive(Clone, PartialEq, ::prost::Message)]
87pub struct DoubleArrayPoint {
88 #[prost(double, repeated, tag = "2")]
89 pub value: ::prost::alloc::vec::Vec<f64>,
90}
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct LogPoints {
93 #[prost(message, repeated, tag = "1")]
94 pub points: ::prost::alloc::vec::Vec<LogPoint>,
95}
96#[derive(Clone, PartialEq, ::prost::Message)]
97pub struct LogPoint {
98 #[prost(message, optional, tag = "2")]
99 pub value: ::core::option::Option<LogValue>,
100}
101#[derive(Clone, PartialEq, ::prost::Message)]
102pub struct StructPoints {
103 #[prost(string, repeated, tag = "1")]
104 pub points: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
105}
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct LogValue {
108 #[prost(string, tag = "1")]
109 pub message: ::prost::alloc::string::String,
110 #[prost(map = "string, string", tag = "2")]
111 pub args: ::std::collections::HashMap<
112 ::prost::alloc::string::String,
113 ::prost::alloc::string::String,
114 >,
115}
116#[derive(Clone, PartialEq, ::prost::Message)]
117pub struct StringPoints {
118 #[prost(string, repeated, tag = "1")]
119 pub points: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
120}
121#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct DoublePoints {
123 #[prost(double, repeated, tag = "1")]
124 pub points: ::prost::alloc::vec::Vec<f64>,
125}
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct IntPoints {
128 #[prost(int64, repeated, tag = "1")]
129 pub points: ::prost::alloc::vec::Vec<i64>,
130}
131#[derive(Clone, PartialEq, ::prost::Message)]
132pub struct Uint64Points {
133 #[prost(uint64, repeated, tag = "1")]
134 pub points: ::prost::alloc::vec::Vec<u64>,
135}
136#[derive(Clone, PartialEq, ::prost::Message)]
137pub struct Points {
138 #[prost(message, repeated, tag = "1")]
139 pub timestamps: ::prost::alloc::vec::Vec<super::super::types::time::Timestamp>,
140 #[prost(oneof = "points::Points", tags = "2, 3, 4, 5, 6, 7, 8")]
141 pub points: ::core::option::Option<points::Points>,
142}
143pub mod points {
145 #[derive(Clone, PartialEq, ::prost::Oneof)]
146 pub enum Points {
147 #[prost(message, tag = "2")]
148 DoublePoints(super::DoublePoints),
149 #[prost(message, tag = "3")]
150 StringPoints(super::StringPoints),
151 #[prost(message, tag = "4")]
152 LogPoints(super::LogPoints),
153 #[prost(message, tag = "5")]
154 IntPoints(super::IntPoints),
155 #[prost(message, tag = "6")]
156 ArrayPoints(super::ArrayPoints),
157 #[prost(message, tag = "7")]
158 StructPoints(super::StructPoints),
159 #[prost(message, tag = "8")]
160 Uint64Points(super::Uint64Points),
161 }
162}
163#[derive(Clone, PartialEq, ::prost::Message)]
164pub struct RecordsBatch {
165 #[prost(string, tag = "1")]
166 pub channel: ::prost::alloc::string::String,
167 #[prost(map = "string, string", tag = "2")]
168 pub tags: ::std::collections::HashMap<
169 ::prost::alloc::string::String,
170 ::prost::alloc::string::String,
171 >,
172 #[prost(message, optional, tag = "3")]
173 pub points: ::core::option::Option<Points>,
174}
175#[derive(Clone, PartialEq, ::prost::Message)]
176pub struct ChannelSeriesMetadata {
177 #[prost(string, tag = "1")]
178 pub series_id: ::prost::alloc::string::String,
179 #[prost(map = "string, string", tag = "2")]
180 pub tags: ::std::collections::HashMap<
181 ::prost::alloc::string::String,
182 ::prost::alloc::string::String,
183 >,
184}
185#[derive(Clone, PartialEq, ::prost::Message)]
186pub struct ChannelSeriesMetadataBatch {
187 #[prost(message, repeated, tag = "1")]
188 pub series_metadata: ::prost::alloc::vec::Vec<ChannelSeriesMetadata>,
189}
190#[derive(Clone, Copy, PartialEq, ::prost::Message)]
191pub struct WriteBatchesResponse {}
192#[derive(Clone, Copy, PartialEq, ::prost::Message)]
193pub struct WriteRetryBatchesResponse {}
194#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
195#[repr(i32)]
196pub enum NominalDirectChannelWriterError {
197 DataSourceNotFound = 0,
198 DataSourcesNotFound = 1,
199 InvalidNominalDataSource = 2,
200 NominalDataSourceConflict = 3,
201 ArrayTooLarge = 4,
202 ConflictingDataTypes = 5,
203 InvalidDataSource = 6,
204 InvalidTelegrafTimestamp = 7,
205 InvalidTimestamp = 8,
206 MismatchedTimestampsAndValues = 9,
207 StreamingDisabledOnDataset = 10,
208 InvalidRange = 11,
209 PointsTypeNotSet = 12,
210 ArrayPointsTypeNotSet = 13,
211 NotAuthorized = 14,
212}
213impl NominalDirectChannelWriterError {
214 pub fn as_str_name(&self) -> &'static str {
219 match self {
220 Self::DataSourceNotFound => {
221 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_DATA_SOURCE_NOT_FOUND"
222 }
223 Self::DataSourcesNotFound => {
224 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_DATA_SOURCES_NOT_FOUND"
225 }
226 Self::InvalidNominalDataSource => {
227 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_INVALID_NOMINAL_DATA_SOURCE"
228 }
229 Self::NominalDataSourceConflict => {
230 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_NOMINAL_DATA_SOURCE_CONFLICT"
231 }
232 Self::ArrayTooLarge => "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_ARRAY_TOO_LARGE",
233 Self::ConflictingDataTypes => {
234 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_CONFLICTING_DATA_TYPES"
235 }
236 Self::InvalidDataSource => {
237 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_INVALID_DATA_SOURCE"
238 }
239 Self::InvalidTelegrafTimestamp => {
240 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_INVALID_TELEGRAF_TIMESTAMP"
241 }
242 Self::InvalidTimestamp => {
243 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_INVALID_TIMESTAMP"
244 }
245 Self::MismatchedTimestampsAndValues => {
246 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_MISMATCHED_TIMESTAMPS_AND_VALUES"
247 }
248 Self::StreamingDisabledOnDataset => {
249 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_STREAMING_DISABLED_ON_DATASET"
250 }
251 Self::InvalidRange => "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_INVALID_RANGE",
252 Self::PointsTypeNotSet => {
253 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_POINTS_TYPE_NOT_SET"
254 }
255 Self::ArrayPointsTypeNotSet => {
256 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_ARRAY_POINTS_TYPE_NOT_SET"
257 }
258 Self::NotAuthorized => "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_NOT_AUTHORIZED",
259 }
260 }
261 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
263 match value {
264 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_DATA_SOURCE_NOT_FOUND" => {
265 Some(Self::DataSourceNotFound)
266 }
267 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_DATA_SOURCES_NOT_FOUND" => {
268 Some(Self::DataSourcesNotFound)
269 }
270 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_INVALID_NOMINAL_DATA_SOURCE" => {
271 Some(Self::InvalidNominalDataSource)
272 }
273 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_NOMINAL_DATA_SOURCE_CONFLICT" => {
274 Some(Self::NominalDataSourceConflict)
275 }
276 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_ARRAY_TOO_LARGE" => {
277 Some(Self::ArrayTooLarge)
278 }
279 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_CONFLICTING_DATA_TYPES" => {
280 Some(Self::ConflictingDataTypes)
281 }
282 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_INVALID_DATA_SOURCE" => {
283 Some(Self::InvalidDataSource)
284 }
285 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_INVALID_TELEGRAF_TIMESTAMP" => {
286 Some(Self::InvalidTelegrafTimestamp)
287 }
288 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_INVALID_TIMESTAMP" => {
289 Some(Self::InvalidTimestamp)
290 }
291 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_MISMATCHED_TIMESTAMPS_AND_VALUES" => {
292 Some(Self::MismatchedTimestampsAndValues)
293 }
294 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_STREAMING_DISABLED_ON_DATASET" => {
295 Some(Self::StreamingDisabledOnDataset)
296 }
297 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_INVALID_RANGE" => {
298 Some(Self::InvalidRange)
299 }
300 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_POINTS_TYPE_NOT_SET" => {
301 Some(Self::PointsTypeNotSet)
302 }
303 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_ARRAY_POINTS_TYPE_NOT_SET" => {
304 Some(Self::ArrayPointsTypeNotSet)
305 }
306 "NOMINAL_DIRECT_CHANNEL_WRITER_ERROR_NOT_AUTHORIZED" => {
307 Some(Self::NotAuthorized)
308 }
309 _ => None,
310 }
311 }
312}
313pub mod direct_nominal_channel_writer_service_client {
315 #![allow(
316 unused_variables,
317 dead_code,
318 missing_docs,
319 clippy::wildcard_imports,
320 clippy::let_unit_value,
321 )]
322 use tonic::codegen::*;
323 use tonic::codegen::http::Uri;
324 #[derive(Debug, Clone)]
325 pub struct DirectNominalChannelWriterServiceClient<T> {
326 inner: tonic::client::Grpc<T>,
327 }
328 impl DirectNominalChannelWriterServiceClient<tonic::transport::Channel> {
329 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
331 where
332 D: TryInto<tonic::transport::Endpoint>,
333 D::Error: Into<StdError>,
334 {
335 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
336 Ok(Self::new(conn))
337 }
338 }
339 impl<T> DirectNominalChannelWriterServiceClient<T>
340 where
341 T: tonic::client::GrpcService<tonic::body::Body>,
342 T::Error: Into<StdError>,
343 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
344 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
345 {
346 pub fn new(inner: T) -> Self {
347 let inner = tonic::client::Grpc::new(inner);
348 Self { inner }
349 }
350 pub fn with_origin(inner: T, origin: Uri) -> Self {
351 let inner = tonic::client::Grpc::with_origin(inner, origin);
352 Self { inner }
353 }
354 pub fn with_interceptor<F>(
355 inner: T,
356 interceptor: F,
357 ) -> DirectNominalChannelWriterServiceClient<InterceptedService<T, F>>
358 where
359 F: tonic::service::Interceptor,
360 T::ResponseBody: Default,
361 T: tonic::codegen::Service<
362 http::Request<tonic::body::Body>,
363 Response = http::Response<
364 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
365 >,
366 >,
367 <T as tonic::codegen::Service<
368 http::Request<tonic::body::Body>,
369 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
370 {
371 DirectNominalChannelWriterServiceClient::new(
372 InterceptedService::new(inner, interceptor),
373 )
374 }
375 #[must_use]
380 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
381 self.inner = self.inner.send_compressed(encoding);
382 self
383 }
384 #[must_use]
386 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
387 self.inner = self.inner.accept_compressed(encoding);
388 self
389 }
390 #[must_use]
394 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
395 self.inner = self.inner.max_decoding_message_size(limit);
396 self
397 }
398 #[must_use]
402 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
403 self.inner = self.inner.max_encoding_message_size(limit);
404 self
405 }
406 pub async fn write_batches(
407 &mut self,
408 request: impl tonic::IntoRequest<super::InternalWriteBatchesRequest>,
409 ) -> std::result::Result<
410 tonic::Response<super::WriteBatchesResponse>,
411 tonic::Status,
412 > {
413 self.inner
414 .ready()
415 .await
416 .map_err(|e| {
417 tonic::Status::unknown(
418 format!("Service was not ready: {}", e.into()),
419 )
420 })?;
421 let codec = tonic::codec::ProstCodec::default();
422 let path = http::uri::PathAndQuery::from_static(
423 "/nominal.direct_channel_writer.v2.DirectNominalChannelWriterService/WriteBatches",
424 );
425 let mut req = request.into_request();
426 req.extensions_mut()
427 .insert(
428 GrpcMethod::new(
429 "nominal.direct_channel_writer.v2.DirectNominalChannelWriterService",
430 "WriteBatches",
431 ),
432 );
433 self.inner.unary(req, path, codec).await
434 }
435 }
436}
437#[derive(Clone, PartialEq, ::prost::Message)]
438pub struct WriteFileDataRequest {
439 #[prost(message, optional, tag = "1")]
440 pub batch_handle: ::core::option::Option<
441 super::super::types::object_storage::Handle,
442 >,
443 #[prost(string, tag = "2")]
444 pub ingest_job_rid: ::prost::alloc::string::String,
445 #[prost(string, tag = "3")]
446 pub dataset_file_id: ::prost::alloc::string::String,
447 #[prost(string, tag = "4")]
448 pub org_rid: ::prost::alloc::string::String,
449 #[prost(int32, tag = "5")]
450 pub batch_id: i32,
451 #[prost(enumeration = "BatchFormat", tag = "7")]
452 pub batch_format: i32,
453}
454#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
455#[repr(i32)]
456pub enum BatchFormat {
457 Unspecified = 0,
458 WriteBatchesRequestProto = 1,
459}
460impl BatchFormat {
461 pub fn as_str_name(&self) -> &'static str {
466 match self {
467 Self::Unspecified => "BATCH_FORMAT_UNSPECIFIED",
468 Self::WriteBatchesRequestProto => "BATCH_FORMAT_WRITE_BATCHES_REQUEST_PROTO",
469 }
470 }
471 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
473 match value {
474 "BATCH_FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
475 "BATCH_FORMAT_WRITE_BATCHES_REQUEST_PROTO" => {
476 Some(Self::WriteBatchesRequestProto)
477 }
478 _ => None,
479 }
480 }
481}