Skip to main content

nominal_api_proto/proto/
nominal.direct_channel_writer.v2.rs

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