srad_types/generated/
sparkplug_payload.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Payload {
4    /// Timestamp at message sending time
5    #[prost(uint64, optional, tag = "1")]
6    pub timestamp: ::core::option::Option<u64>,
7    /// Repeated forever - no limit in Google Protobufs
8    #[prost(message, repeated, tag = "2")]
9    pub metrics: ::prost::alloc::vec::Vec<payload::Metric>,
10    /// Sequence number
11    #[prost(uint64, optional, tag = "3")]
12    pub seq: ::core::option::Option<u64>,
13    /// UUID to track message type in terms of schema definitions
14    #[prost(string, optional, tag = "4")]
15    pub uuid: ::core::option::Option<::prost::alloc::string::String>,
16    /// To optionally bypass the whole definition above
17    #[prost(bytes = "vec", optional, tag = "5")]
18    pub body: ::core::option::Option<::prost::alloc::vec::Vec<u8>>,
19}
20/// Nested message and enum types in `Payload`.
21pub mod payload {
22    #[derive(Clone, PartialEq, ::prost::Message)]
23    pub struct Template {
24        /// The version of the Template to prevent mismatches
25        #[prost(string, optional, tag = "1")]
26        pub version: ::core::option::Option<::prost::alloc::string::String>,
27        /// Each metric includes a name, datatype, and optionally a value
28        #[prost(message, repeated, tag = "2")]
29        pub metrics: ::prost::alloc::vec::Vec<Metric>,
30        #[prost(message, repeated, tag = "3")]
31        pub parameters: ::prost::alloc::vec::Vec<template::Parameter>,
32        /// MUST be a reference to a template definition if this is an instance (i.e. the name of the template definition) - MUST be omitted for template definitions
33        #[prost(string, optional, tag = "4")]
34        pub template_ref: ::core::option::Option<::prost::alloc::string::String>,
35        #[prost(bool, optional, tag = "5")]
36        pub is_definition: ::core::option::Option<bool>,
37    }
38    /// Nested message and enum types in `Template`.
39    pub mod template {
40        #[derive(Clone, PartialEq, ::prost::Message)]
41        pub struct Parameter {
42            #[prost(string, optional, tag = "1")]
43            pub name: ::core::option::Option<::prost::alloc::string::String>,
44            #[prost(uint32, optional, tag = "2")]
45            pub r#type: ::core::option::Option<u32>,
46            #[prost(oneof = "parameter::Value", tags = "3, 4, 5, 6, 7, 8, 9")]
47            pub value: ::core::option::Option<parameter::Value>,
48        }
49        /// Nested message and enum types in `Parameter`.
50        pub mod parameter {
51            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
52            pub struct ParameterValueExtension {}
53            #[derive(Clone, PartialEq, ::prost::Oneof)]
54            pub enum Value {
55                #[prost(uint32, tag = "3")]
56                IntValue(u32),
57                #[prost(uint64, tag = "4")]
58                LongValue(u64),
59                #[prost(float, tag = "5")]
60                FloatValue(f32),
61                #[prost(double, tag = "6")]
62                DoubleValue(f64),
63                #[prost(bool, tag = "7")]
64                BooleanValue(bool),
65                #[prost(string, tag = "8")]
66                StringValue(::prost::alloc::string::String),
67                #[prost(message, tag = "9")]
68                ExtensionValue(ParameterValueExtension),
69            }
70        }
71    }
72    #[derive(Clone, PartialEq, ::prost::Message)]
73    pub struct DataSet {
74        #[prost(uint64, optional, tag = "1")]
75        pub num_of_columns: ::core::option::Option<u64>,
76        #[prost(string, repeated, tag = "2")]
77        pub columns: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
78        #[prost(uint32, repeated, packed = "false", tag = "3")]
79        pub types: ::prost::alloc::vec::Vec<u32>,
80        #[prost(message, repeated, tag = "4")]
81        pub rows: ::prost::alloc::vec::Vec<data_set::Row>,
82    }
83    /// Nested message and enum types in `DataSet`.
84    pub mod data_set {
85        #[derive(Clone, PartialEq, ::prost::Message)]
86        pub struct DataSetValue {
87            #[prost(oneof = "data_set_value::Value", tags = "1, 2, 3, 4, 5, 6, 7")]
88            pub value: ::core::option::Option<data_set_value::Value>,
89        }
90        /// Nested message and enum types in `DataSetValue`.
91        pub mod data_set_value {
92            #[derive(Clone, Copy, PartialEq, ::prost::Message)]
93            pub struct DataSetValueExtension {}
94            #[derive(Clone, PartialEq, ::prost::Oneof)]
95            pub enum Value {
96                #[prost(uint32, tag = "1")]
97                IntValue(u32),
98                #[prost(uint64, tag = "2")]
99                LongValue(u64),
100                #[prost(float, tag = "3")]
101                FloatValue(f32),
102                #[prost(double, tag = "4")]
103                DoubleValue(f64),
104                #[prost(bool, tag = "5")]
105                BooleanValue(bool),
106                #[prost(string, tag = "6")]
107                StringValue(::prost::alloc::string::String),
108                #[prost(message, tag = "7")]
109                ExtensionValue(DataSetValueExtension),
110            }
111        }
112        #[derive(Clone, PartialEq, ::prost::Message)]
113        pub struct Row {
114            #[prost(message, repeated, tag = "1")]
115            pub elements: ::prost::alloc::vec::Vec<DataSetValue>,
116        }
117    }
118    #[derive(Clone, PartialEq, ::prost::Message)]
119    pub struct PropertyValue {
120        #[prost(uint32, optional, tag = "1")]
121        pub r#type: ::core::option::Option<u32>,
122        #[prost(bool, optional, tag = "2")]
123        pub is_null: ::core::option::Option<bool>,
124        #[prost(oneof = "property_value::Value", tags = "3, 4, 5, 6, 7, 8, 9, 10, 11")]
125        pub value: ::core::option::Option<property_value::Value>,
126    }
127    /// Nested message and enum types in `PropertyValue`.
128    pub mod property_value {
129        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
130        pub struct PropertyValueExtension {}
131        #[derive(Clone, PartialEq, ::prost::Oneof)]
132        pub enum Value {
133            #[prost(uint32, tag = "3")]
134            IntValue(u32),
135            #[prost(uint64, tag = "4")]
136            LongValue(u64),
137            #[prost(float, tag = "5")]
138            FloatValue(f32),
139            #[prost(double, tag = "6")]
140            DoubleValue(f64),
141            #[prost(bool, tag = "7")]
142            BooleanValue(bool),
143            #[prost(string, tag = "8")]
144            StringValue(::prost::alloc::string::String),
145            #[prost(message, tag = "9")]
146            PropertysetValue(super::PropertySet),
147            /// List of Property Values
148            #[prost(message, tag = "10")]
149            PropertysetsValue(super::PropertySetList),
150            #[prost(message, tag = "11")]
151            ExtensionValue(PropertyValueExtension),
152        }
153    }
154    #[derive(Clone, PartialEq, ::prost::Message)]
155    pub struct PropertySet {
156        /// Names of the properties
157        #[prost(string, repeated, tag = "1")]
158        pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
159        #[prost(message, repeated, tag = "2")]
160        pub values: ::prost::alloc::vec::Vec<PropertyValue>,
161    }
162    #[derive(Clone, PartialEq, ::prost::Message)]
163    pub struct PropertySetList {
164        #[prost(message, repeated, tag = "1")]
165        pub propertyset: ::prost::alloc::vec::Vec<PropertySet>,
166    }
167    #[derive(Clone, PartialEq, ::prost::Message)]
168    pub struct MetaData {
169        /// Bytes specific metadata
170        #[prost(bool, optional, tag = "1")]
171        pub is_multi_part: ::core::option::Option<bool>,
172        /// General metadata
173        ///
174        /// Content/Media type
175        #[prost(string, optional, tag = "2")]
176        pub content_type: ::core::option::Option<::prost::alloc::string::String>,
177        /// File size, String size, Multi-part size, etc
178        #[prost(uint64, optional, tag = "3")]
179        pub size: ::core::option::Option<u64>,
180        /// Sequence number for multi-part messages
181        #[prost(uint64, optional, tag = "4")]
182        pub seq: ::core::option::Option<u64>,
183        /// File metadata
184        ///
185        /// File name
186        #[prost(string, optional, tag = "5")]
187        pub file_name: ::core::option::Option<::prost::alloc::string::String>,
188        /// File type (i.e. xml, json, txt, cpp, etc)
189        #[prost(string, optional, tag = "6")]
190        pub file_type: ::core::option::Option<::prost::alloc::string::String>,
191        /// md5 of data
192        #[prost(string, optional, tag = "7")]
193        pub md5: ::core::option::Option<::prost::alloc::string::String>,
194        /// Catchalls and future expansion
195        ///
196        /// Could be anything such as json or xml of custom properties
197        #[prost(string, optional, tag = "8")]
198        pub description: ::core::option::Option<::prost::alloc::string::String>,
199    }
200    #[derive(Clone, PartialEq, ::prost::Message)]
201    pub struct Metric {
202        /// Metric name - should only be included on birth
203        #[prost(string, optional, tag = "1")]
204        pub name: ::core::option::Option<::prost::alloc::string::String>,
205        /// Metric alias - tied to name on birth and included in all later DATA messages
206        #[prost(uint64, optional, tag = "2")]
207        pub alias: ::core::option::Option<u64>,
208        /// Timestamp associated with data acquisition time
209        #[prost(uint64, optional, tag = "3")]
210        pub timestamp: ::core::option::Option<u64>,
211        /// DataType of the metric/tag value
212        #[prost(uint32, optional, tag = "4")]
213        pub datatype: ::core::option::Option<u32>,
214        /// If this is historical data and should not update real time tag
215        #[prost(bool, optional, tag = "5")]
216        pub is_historical: ::core::option::Option<bool>,
217        /// Tells consuming clients such as MQTT Engine to not store this as a tag
218        #[prost(bool, optional, tag = "6")]
219        pub is_transient: ::core::option::Option<bool>,
220        /// If this is null - explicitly say so rather than using -1, false, etc for some datatypes.
221        #[prost(bool, optional, tag = "7")]
222        pub is_null: ::core::option::Option<bool>,
223        /// Metadata for the payload
224        #[prost(message, optional, tag = "8")]
225        pub metadata: ::core::option::Option<MetaData>,
226        #[prost(message, optional, tag = "9")]
227        pub properties: ::core::option::Option<PropertySet>,
228        #[prost(
229            oneof = "metric::Value",
230            tags = "10, 11, 12, 13, 14, 15, 16, 17, 18, 19"
231        )]
232        pub value: ::core::option::Option<metric::Value>,
233    }
234    /// Nested message and enum types in `Metric`.
235    pub mod metric {
236        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
237        pub struct MetricValueExtension {}
238        #[derive(Clone, PartialEq, ::prost::Oneof)]
239        pub enum Value {
240            #[prost(uint32, tag = "10")]
241            IntValue(u32),
242            #[prost(uint64, tag = "11")]
243            LongValue(u64),
244            #[prost(float, tag = "12")]
245            FloatValue(f32),
246            #[prost(double, tag = "13")]
247            DoubleValue(f64),
248            #[prost(bool, tag = "14")]
249            BooleanValue(bool),
250            #[prost(string, tag = "15")]
251            StringValue(::prost::alloc::string::String),
252            /// Bytes, File
253            #[prost(bytes, tag = "16")]
254            BytesValue(::prost::alloc::vec::Vec<u8>),
255            #[prost(message, tag = "17")]
256            DatasetValue(super::DataSet),
257            #[prost(message, tag = "18")]
258            TemplateValue(super::Template),
259            #[prost(message, tag = "19")]
260            ExtensionValue(MetricValueExtension),
261        }
262    }
263}
264/// Indexes of Data Types
265#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
266#[repr(i32)]
267pub enum DataType {
268    /// Unknown placeholder for future expansion.
269    Unknown = 0,
270    /// Basic Types
271    Int8 = 1,
272    Int16 = 2,
273    Int32 = 3,
274    Int64 = 4,
275    UInt8 = 5,
276    UInt16 = 6,
277    UInt32 = 7,
278    UInt64 = 8,
279    Float = 9,
280    Double = 10,
281    Boolean = 11,
282    String = 12,
283    DateTime = 13,
284    Text = 14,
285    /// Additional Metric Types
286    Uuid = 15,
287    DataSet = 16,
288    Bytes = 17,
289    File = 18,
290    Template = 19,
291    /// Additional PropertyValue Types
292    PropertySet = 20,
293    PropertySetList = 21,
294    /// Array Types
295    Int8Array = 22,
296    Int16Array = 23,
297    Int32Array = 24,
298    Int64Array = 25,
299    UInt8Array = 26,
300    UInt16Array = 27,
301    UInt32Array = 28,
302    UInt64Array = 29,
303    FloatArray = 30,
304    DoubleArray = 31,
305    BooleanArray = 32,
306    StringArray = 33,
307    DateTimeArray = 34,
308}
309impl DataType {
310    /// String value of the enum field names used in the ProtoBuf definition.
311    ///
312    /// The values are not transformed in any way and thus are considered stable
313    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
314    pub fn as_str_name(&self) -> &'static str {
315        match self {
316            Self::Unknown => "Unknown",
317            Self::Int8 => "Int8",
318            Self::Int16 => "Int16",
319            Self::Int32 => "Int32",
320            Self::Int64 => "Int64",
321            Self::UInt8 => "UInt8",
322            Self::UInt16 => "UInt16",
323            Self::UInt32 => "UInt32",
324            Self::UInt64 => "UInt64",
325            Self::Float => "Float",
326            Self::Double => "Double",
327            Self::Boolean => "Boolean",
328            Self::String => "String",
329            Self::DateTime => "DateTime",
330            Self::Text => "Text",
331            Self::Uuid => "UUID",
332            Self::DataSet => "DataSet",
333            Self::Bytes => "Bytes",
334            Self::File => "File",
335            Self::Template => "Template",
336            Self::PropertySet => "PropertySet",
337            Self::PropertySetList => "PropertySetList",
338            Self::Int8Array => "Int8Array",
339            Self::Int16Array => "Int16Array",
340            Self::Int32Array => "Int32Array",
341            Self::Int64Array => "Int64Array",
342            Self::UInt8Array => "UInt8Array",
343            Self::UInt16Array => "UInt16Array",
344            Self::UInt32Array => "UInt32Array",
345            Self::UInt64Array => "UInt64Array",
346            Self::FloatArray => "FloatArray",
347            Self::DoubleArray => "DoubleArray",
348            Self::BooleanArray => "BooleanArray",
349            Self::StringArray => "StringArray",
350            Self::DateTimeArray => "DateTimeArray",
351        }
352    }
353    /// Creates an enum from field names used in the ProtoBuf definition.
354    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
355        match value {
356            "Unknown" => Some(Self::Unknown),
357            "Int8" => Some(Self::Int8),
358            "Int16" => Some(Self::Int16),
359            "Int32" => Some(Self::Int32),
360            "Int64" => Some(Self::Int64),
361            "UInt8" => Some(Self::UInt8),
362            "UInt16" => Some(Self::UInt16),
363            "UInt32" => Some(Self::UInt32),
364            "UInt64" => Some(Self::UInt64),
365            "Float" => Some(Self::Float),
366            "Double" => Some(Self::Double),
367            "Boolean" => Some(Self::Boolean),
368            "String" => Some(Self::String),
369            "DateTime" => Some(Self::DateTime),
370            "Text" => Some(Self::Text),
371            "UUID" => Some(Self::Uuid),
372            "DataSet" => Some(Self::DataSet),
373            "Bytes" => Some(Self::Bytes),
374            "File" => Some(Self::File),
375            "Template" => Some(Self::Template),
376            "PropertySet" => Some(Self::PropertySet),
377            "PropertySetList" => Some(Self::PropertySetList),
378            "Int8Array" => Some(Self::Int8Array),
379            "Int16Array" => Some(Self::Int16Array),
380            "Int32Array" => Some(Self::Int32Array),
381            "Int64Array" => Some(Self::Int64Array),
382            "UInt8Array" => Some(Self::UInt8Array),
383            "UInt16Array" => Some(Self::UInt16Array),
384            "UInt32Array" => Some(Self::UInt32Array),
385            "UInt64Array" => Some(Self::UInt64Array),
386            "FloatArray" => Some(Self::FloatArray),
387            "DoubleArray" => Some(Self::DoubleArray),
388            "BooleanArray" => Some(Self::BooleanArray),
389            "StringArray" => Some(Self::StringArray),
390            "DateTimeArray" => Some(Self::DateTimeArray),
391            _ => None,
392        }
393    }
394}