node_grove_common_api/
ng_proto.rs

1// @generated
2// This file is @generated by prost-build.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct QueueMsg {
5    #[prost(int64, tag="1")]
6    pub ts: i64,
7    #[prost(map="string, string", tag="2")]
8    pub headers: ::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
9    #[prost(string, tag="3")]
10    pub key: ::prost::alloc::string::String,
11    #[prost(bytes="vec", tag="4")]
12    pub payload: ::prost::alloc::vec::Vec<u8>,
13}
14#[derive(Clone, PartialEq, ::prost::Message)]
15pub struct CommonResponse {
16    #[prost(int32, tag="1")]
17    pub code: i32,
18    #[prost(string, tag="2")]
19    pub msg: ::prost::alloc::string::String,
20}
21#[derive(Clone, PartialEq, ::prost::Message)]
22pub struct DeviceInfoProto {
23    #[prost(int64, tag="1")]
24    pub tenant_id: i64,
25    #[prost(int64, tag="2")]
26    pub product_id: i64,
27    #[prost(int64, tag="4")]
28    pub device_id: i64,
29    #[prost(string, tag="5")]
30    pub device_name: ::prost::alloc::string::String,
31    #[prost(string, tag="6")]
32    pub device_type: ::prost::alloc::string::String,
33    #[prost(string, tag="7")]
34    pub additional_info: ::prost::alloc::string::String,
35}
36#[derive(Clone, Copy, PartialEq, ::prost::Message)]
37pub struct ProductInfoProto {
38}
39#[derive(Clone, PartialEq, ::prost::Message)]
40pub struct SessionInfoProto {
41    #[prost(enumeration="TransportType", tag="1")]
42    pub transport: i32,
43    #[prost(string, tag="2")]
44    pub node_id: ::prost::alloc::string::String,
45    #[prost(string, tag="3")]
46    pub session_id: ::prost::alloc::string::String,
47    #[prost(int64, tag="4")]
48    pub tenant_id: i64,
49    #[prost(int64, tag="5")]
50    pub device_id: i64,
51    #[prost(int64, tag="6")]
52    pub product_id: i64,
53    #[prost(string, tag="7")]
54    pub device_name: ::prost::alloc::string::String,
55    #[prost(string, tag="8")]
56    pub device_type: ::prost::alloc::string::String,
57}
58#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
59#[repr(i32)]
60pub enum SessionEvent {
61    Unspecified = 0,
62    Open = 1,
63    Closed = 2,
64}
65impl SessionEvent {
66    /// String value of the enum field names used in the ProtoBuf definition.
67    ///
68    /// The values are not transformed in any way and thus are considered stable
69    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
70    pub fn as_str_name(&self) -> &'static str {
71        match self {
72            Self::Unspecified => "SESSION_EVENT_UNSPECIFIED",
73            Self::Open => "OPEN",
74            Self::Closed => "CLOSED",
75        }
76    }
77    /// Creates an enum from field names used in the ProtoBuf definition.
78    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
79        match value {
80            "SESSION_EVENT_UNSPECIFIED" => Some(Self::Unspecified),
81            "OPEN" => Some(Self::Open),
82            "CLOSED" => Some(Self::Closed),
83            _ => None,
84        }
85    }
86}
87#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
88#[repr(i32)]
89pub enum SessionType {
90    Unspecified = 0,
91    Sync = 1,
92    Async = 2,
93}
94impl SessionType {
95    /// String value of the enum field names used in the ProtoBuf definition.
96    ///
97    /// The values are not transformed in any way and thus are considered stable
98    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
99    pub fn as_str_name(&self) -> &'static str {
100        match self {
101            Self::Unspecified => "SESSION_TYPE_UNSPECIFIED",
102            Self::Sync => "SYNC",
103            Self::Async => "ASYNC",
104        }
105    }
106    /// Creates an enum from field names used in the ProtoBuf definition.
107    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
108        match value {
109            "SESSION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
110            "SYNC" => Some(Self::Sync),
111            "ASYNC" => Some(Self::Async),
112            _ => None,
113        }
114    }
115}
116#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
117#[repr(i32)]
118pub enum TransportType {
119    Unspecified = 0,
120    Tcp = 1,
121    Mqtt = 2,
122    Http = 3,
123    Coap = 4,
124    Lwm2m = 5,
125    Snmp = 6,
126    Ws = 7,
127}
128impl TransportType {
129    /// String value of the enum field names used in the ProtoBuf definition.
130    ///
131    /// The values are not transformed in any way and thus are considered stable
132    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
133    pub fn as_str_name(&self) -> &'static str {
134        match self {
135            Self::Unspecified => "TRANSPORT_TYPE_UNSPECIFIED",
136            Self::Tcp => "TCP",
137            Self::Mqtt => "MQTT",
138            Self::Http => "HTTP",
139            Self::Coap => "COAP",
140            Self::Lwm2m => "LWM2M",
141            Self::Snmp => "SNMP",
142            Self::Ws => "WS",
143        }
144    }
145    /// Creates an enum from field names used in the ProtoBuf definition.
146    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
147        match value {
148            "TRANSPORT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
149            "TCP" => Some(Self::Tcp),
150            "MQTT" => Some(Self::Mqtt),
151            "HTTP" => Some(Self::Http),
152            "COAP" => Some(Self::Coap),
153            "LWM2M" => Some(Self::Lwm2m),
154            "SNMP" => Some(Self::Snmp),
155            "WS" => Some(Self::Ws),
156            _ => None,
157        }
158    }
159}
160#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
161#[repr(i32)]
162pub enum HousekeeperTaskType {
163    HousekeeperTaskUnset = 0,
164    EntityCleanup = 1,
165}
166impl HousekeeperTaskType {
167    /// String value of the enum field names used in the ProtoBuf definition.
168    ///
169    /// The values are not transformed in any way and thus are considered stable
170    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
171    pub fn as_str_name(&self) -> &'static str {
172        match self {
173            Self::HousekeeperTaskUnset => "HOUSEKEEPER_TASK_UNSET",
174            Self::EntityCleanup => "ENTITY_CLEANUP",
175        }
176    }
177    /// Creates an enum from field names used in the ProtoBuf definition.
178    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
179        match value {
180            "HOUSEKEEPER_TASK_UNSET" => Some(Self::HousekeeperTaskUnset),
181            "ENTITY_CLEANUP" => Some(Self::EntityCleanup),
182            _ => None,
183        }
184    }
185}
186#[derive(Clone, PartialEq, ::prost::Message)]
187pub struct DeviceProvisionConnectRequest {
188    #[prost(string, tag="1")]
189    pub key: ::prost::alloc::string::String,
190    #[prost(string, tag="2")]
191    pub secret: ::prost::alloc::string::String,
192}
193#[derive(Clone, PartialEq, ::prost::Message)]
194pub struct DeviceProvisionConnectResponse {
195    #[prost(message, optional, tag="1")]
196    pub common: ::core::option::Option<CommonResponse>,
197    #[prost(int64, tag="2")]
198    pub product_id: i64,
199    #[prost(int64, tag="3")]
200    pub tenant_id: i64,
201    #[prost(string, tag="4")]
202    pub device_type: ::prost::alloc::string::String,
203}
204#[derive(Clone, PartialEq, ::prost::Message)]
205pub struct DeviceProvisionRequest {
206    #[prost(bool, tag="1")]
207    pub gateway: bool,
208    #[prost(string, tag="2")]
209    pub device_name: ::prost::alloc::string::String,
210    #[prost(message, optional, tag="3")]
211    pub credentials: ::core::option::Option<DeviceCredentialsProto>,
212}
213#[derive(Clone, PartialEq, ::prost::Message)]
214pub struct DeviceCredentialsProto {
215    #[prost(int64, tag="1")]
216    pub mode: i64,
217    #[prost(string, tag="2")]
218    pub client_id: ::prost::alloc::string::String,
219    #[prost(bytes="vec", tag="3")]
220    pub csr: ::prost::alloc::vec::Vec<u8>,
221    #[prost(string, tag="4")]
222    pub username: ::prost::alloc::string::String,
223    #[prost(string, tag="5")]
224    pub password: ::prost::alloc::string::String,
225}
226#[derive(Clone, PartialEq, ::prost::Message)]
227pub struct DeviceProvisionResponse {
228    #[prost(message, optional, tag="1")]
229    pub common: ::core::option::Option<CommonResponse>,
230    #[prost(message, optional, tag="2")]
231    pub device_info: ::core::option::Option<DeviceInfoProto>,
232    #[prost(message, optional, tag="3")]
233    pub credentials: ::core::option::Option<DeviceCredentialsResponse>,
234}
235#[derive(Clone, PartialEq, ::prost::Message)]
236pub struct DeviceCredentialsResponse {
237    #[prost(int64, tag="1")]
238    pub mode: i64,
239    #[prost(string, tag="2")]
240    pub client_id: ::prost::alloc::string::String,
241    #[prost(string, tag="3")]
242    pub ca: ::prost::alloc::string::String,
243    #[prost(string, tag="4")]
244    pub certificate: ::prost::alloc::string::String,
245    #[prost(string, tag="5")]
246    pub username: ::prost::alloc::string::String,
247    #[prost(string, tag="6")]
248    pub password: ::prost::alloc::string::String,
249}
250#[derive(Clone, PartialEq, ::prost::Message)]
251pub struct EnumValue {
252    #[prost(string, tag="1")]
253    pub key: ::prost::alloc::string::String,
254    #[prost(oneof="enum_value::Value", tags="2, 3, 4, 5")]
255    pub value: ::core::option::Option<enum_value::Value>,
256}
257/// Nested message and enum types in `EnumValue`.
258pub mod enum_value {
259    #[derive(Clone, PartialEq, ::prost::Oneof)]
260    pub enum Value {
261        #[prost(string, tag="2")]
262        StringValue(::prost::alloc::string::String),
263        #[prost(int64, tag="3")]
264        IntValue(i64),
265        #[prost(float, tag="4")]
266        FloatValue(f32),
267        #[prost(bool, tag="5")]
268        BoolValue(bool),
269    }
270}
271#[derive(Clone, PartialEq, ::prost::Message)]
272pub struct EnumArrayType {
273    #[prost(message, repeated, tag="1")]
274    pub values: ::prost::alloc::vec::Vec<EnumValue>,
275}
276#[derive(Clone, PartialEq, ::prost::Message)]
277pub struct StringArray {
278    #[prost(string, repeated, tag="1")]
279    pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
280}
281#[derive(Clone, PartialEq, ::prost::Message)]
282pub struct IntArray {
283    #[prost(int64, repeated, tag="1")]
284    pub values: ::prost::alloc::vec::Vec<i64>,
285}
286#[derive(Clone, PartialEq, ::prost::Message)]
287pub struct FloatArray {
288    #[prost(float, repeated, tag="1")]
289    pub values: ::prost::alloc::vec::Vec<f32>,
290}
291#[derive(Clone, PartialEq, ::prost::Message)]
292pub struct BoolArray {
293    #[prost(bool, repeated, tag="1")]
294    pub values: ::prost::alloc::vec::Vec<bool>,
295}
296#[derive(Clone, PartialEq, ::prost::Message)]
297pub struct Condition {
298    #[prost(enumeration="ConditionType", tag="1")]
299    pub r#type: i32,
300    #[prost(enumeration="Operator", tag="2")]
301    pub operator: i32,
302    #[prost(message, repeated, tag="11")]
303    pub sub_conditions: ::prost::alloc::vec::Vec<Condition>,
304    #[prost(oneof="condition::Value", tags="3, 4, 5, 6, 7, 8, 9, 10")]
305    pub value: ::core::option::Option<condition::Value>,
306}
307/// Nested message and enum types in `Condition`.
308pub mod condition {
309    #[derive(Clone, PartialEq, ::prost::Oneof)]
310    pub enum Value {
311        #[prost(string, tag="3")]
312        StringValue(::prost::alloc::string::String),
313        #[prost(int64, tag="4")]
314        IntValue(i64),
315        #[prost(float, tag="5")]
316        FloatValue(f32),
317        #[prost(bool, tag="6")]
318        BoolValue(bool),
319        #[prost(message, tag="7")]
320        StringArray(super::StringArray),
321        #[prost(message, tag="8")]
322        IntArray(super::IntArray),
323        #[prost(message, tag="9")]
324        FloatArray(super::FloatArray),
325        #[prost(message, tag="10")]
326        BoolArray(super::BoolArray),
327    }
328}
329#[derive(Clone, PartialEq, ::prost::Message)]
330pub struct Extension {
331    #[prost(string, tag="1")]
332    pub field: ::prost::alloc::string::String,
333    #[prost(string, tag="2")]
334    pub label: ::prost::alloc::string::String,
335    #[prost(enumeration="ExtensionType", tag="3")]
336    pub r#type: i32,
337    #[prost(message, repeated, tag="4")]
338    pub enum_info: ::prost::alloc::vec::Vec<EnumValue>,
339    #[prost(message, repeated, tag="5")]
340    pub conditions: ::prost::alloc::vec::Vec<Condition>,
341    #[prost(bool, tag="6")]
342    pub required: bool,
343}
344#[derive(Clone, PartialEq, ::prost::Message)]
345pub struct DriverMetadata {
346    #[prost(string, tag="1")]
347    pub name: ::prost::alloc::string::String,
348    #[prost(string, tag="2")]
349    pub code: ::prost::alloc::string::String,
350    #[prost(string, tag="3")]
351    pub description: ::prost::alloc::string::String,
352    #[prost(string, tag="4")]
353    pub version: ::prost::alloc::string::String,
354    #[prost(message, repeated, tag="5")]
355    pub extensions: ::prost::alloc::vec::Vec<Extension>,
356    #[prost(message, repeated, tag="6")]
357    pub data_point_extensions: ::prost::alloc::vec::Vec<Extension>,
358    #[prost(message, repeated, tag="7")]
359    pub action_extensions: ::prost::alloc::vec::Vec<Extension>,
360    #[prost(message, repeated, tag="8")]
361    pub event_extensions: ::prost::alloc::vec::Vec<Extension>,
362}
363#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
364#[repr(i32)]
365pub enum ExtensionType {
366    Unspecified = 0,
367    String = 1,
368    Int = 2,
369    Float = 3,
370    Bool = 4,
371    StringArray = 5,
372    IntegerArray = 6,
373    FloatArray = 7,
374    BooleanArray = 8,
375    Enum = 9,
376    EnumArray = 10,
377}
378impl ExtensionType {
379    /// String value of the enum field names used in the ProtoBuf definition.
380    ///
381    /// The values are not transformed in any way and thus are considered stable
382    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
383    pub fn as_str_name(&self) -> &'static str {
384        match self {
385            Self::Unspecified => "EXTENSION_TYPE_UNSPECIFIED",
386            Self::String => "STRING",
387            Self::Int => "INT",
388            Self::Float => "FLOAT",
389            Self::Bool => "BOOL",
390            Self::StringArray => "STRING_ARRAY",
391            Self::IntegerArray => "INTEGER_ARRAY",
392            Self::FloatArray => "FLOAT_ARRAY",
393            Self::BooleanArray => "BOOLEAN_ARRAY",
394            Self::Enum => "ENUM",
395            Self::EnumArray => "ENUM_ARRAY",
396        }
397    }
398    /// Creates an enum from field names used in the ProtoBuf definition.
399    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
400        match value {
401            "EXTENSION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
402            "STRING" => Some(Self::String),
403            "INT" => Some(Self::Int),
404            "FLOAT" => Some(Self::Float),
405            "BOOL" => Some(Self::Bool),
406            "STRING_ARRAY" => Some(Self::StringArray),
407            "INTEGER_ARRAY" => Some(Self::IntegerArray),
408            "FLOAT_ARRAY" => Some(Self::FloatArray),
409            "BOOLEAN_ARRAY" => Some(Self::BooleanArray),
410            "ENUM" => Some(Self::Enum),
411            "ENUM_ARRAY" => Some(Self::EnumArray),
412            _ => None,
413        }
414    }
415}
416#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
417#[repr(i32)]
418pub enum Operator {
419    Unspecified = 0,
420    Eq = 1,
421    Neq = 2,
422    Gt = 3,
423    Gte = 4,
424    Lt = 5,
425    Lte = 6,
426    Contains = 7,
427    Prefix = 8,
428    Suffix = 9,
429    Regex = 10,
430    In = 11,
431    NotIn = 12,
432    Between = 13,
433    NotBetween = 14,
434    NotNull = 15,
435}
436impl Operator {
437    /// String value of the enum field names used in the ProtoBuf definition.
438    ///
439    /// The values are not transformed in any way and thus are considered stable
440    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
441    pub fn as_str_name(&self) -> &'static str {
442        match self {
443            Self::Unspecified => "OPERATOR_UNSPECIFIED",
444            Self::Eq => "EQ",
445            Self::Neq => "NEQ",
446            Self::Gt => "GT",
447            Self::Gte => "GTE",
448            Self::Lt => "LT",
449            Self::Lte => "LTE",
450            Self::Contains => "CONTAINS",
451            Self::Prefix => "PREFIX",
452            Self::Suffix => "SUFFIX",
453            Self::Regex => "REGEX",
454            Self::In => "IN",
455            Self::NotIn => "NOT_IN",
456            Self::Between => "BETWEEN",
457            Self::NotBetween => "NOT_BETWEEN",
458            Self::NotNull => "NOT_NULL",
459        }
460    }
461    /// Creates an enum from field names used in the ProtoBuf definition.
462    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
463        match value {
464            "OPERATOR_UNSPECIFIED" => Some(Self::Unspecified),
465            "EQ" => Some(Self::Eq),
466            "NEQ" => Some(Self::Neq),
467            "GT" => Some(Self::Gt),
468            "GTE" => Some(Self::Gte),
469            "LT" => Some(Self::Lt),
470            "LTE" => Some(Self::Lte),
471            "CONTAINS" => Some(Self::Contains),
472            "PREFIX" => Some(Self::Prefix),
473            "SUFFIX" => Some(Self::Suffix),
474            "REGEX" => Some(Self::Regex),
475            "IN" => Some(Self::In),
476            "NOT_IN" => Some(Self::NotIn),
477            "BETWEEN" => Some(Self::Between),
478            "NOT_BETWEEN" => Some(Self::NotBetween),
479            "NOT_NULL" => Some(Self::NotNull),
480            _ => None,
481        }
482    }
483}
484#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
485#[repr(i32)]
486pub enum ConditionType {
487    Unspecified = 0,
488    And = 1,
489    Or = 2,
490}
491impl ConditionType {
492    /// String value of the enum field names used in the ProtoBuf definition.
493    ///
494    /// The values are not transformed in any way and thus are considered stable
495    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
496    pub fn as_str_name(&self) -> &'static str {
497        match self {
498            Self::Unspecified => "CONDITION_TYPE_UNSPECIFIED",
499            Self::And => "AND",
500            Self::Or => "OR",
501        }
502    }
503    /// Creates an enum from field names used in the ProtoBuf definition.
504    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
505        match value {
506            "CONDITION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
507            "AND" => Some(Self::And),
508            "OR" => Some(Self::Or),
509            _ => None,
510        }
511    }
512}
513include!("ng_proto.serde.rs");
514// @@protoc_insertion_point(module)