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