nominal_api/proto/
nominal.streaming_connection_service.v1.rs

1// This file is @generated by prost-build.
2/// Authentication configuration for OPC-UA server connection
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct OpcAuthenticationConfig {
5    #[prost(
6        oneof = "opc_authentication_config::OpcAuthenticationConfig",
7        tags = "1, 2, 3"
8    )]
9    pub opc_authentication_config: ::core::option::Option<
10        opc_authentication_config::OpcAuthenticationConfig,
11    >,
12}
13/// Nested message and enum types in `OpcAuthenticationConfig`.
14pub mod opc_authentication_config {
15    #[derive(Clone, PartialEq, ::prost::Oneof)]
16    pub enum OpcAuthenticationConfig {
17        #[prost(message, tag = "1")]
18        Anonymous(super::super::super::super::google::protobuf::Empty),
19        #[prost(message, tag = "2")]
20        UsernamePassword(super::OpcUsernamePasswordAuthentication),
21        #[prost(message, tag = "3")]
22        Token(super::OpcTokenAuthentication),
23    }
24}
25/// Authentication configuration for OPC-UA server connection with secrets
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct OpcAuthenticationConfigSecret {
28    #[prost(
29        oneof = "opc_authentication_config_secret::OpcAuthenticationConfig",
30        tags = "1, 2, 3"
31    )]
32    pub opc_authentication_config: ::core::option::Option<
33        opc_authentication_config_secret::OpcAuthenticationConfig,
34    >,
35}
36/// Nested message and enum types in `OpcAuthenticationConfigSecret`.
37pub mod opc_authentication_config_secret {
38    #[derive(Clone, PartialEq, ::prost::Oneof)]
39    pub enum OpcAuthenticationConfig {
40        #[prost(message, tag = "1")]
41        Anonymous(super::super::super::super::google::protobuf::Empty),
42        #[prost(message, tag = "2")]
43        UsernamePassword(super::OpcUsernamePasswordAuthenticationSecret),
44        #[prost(message, tag = "3")]
45        Token(super::OpcTokenAuthenticationSecret),
46    }
47}
48#[derive(Clone, PartialEq, ::prost::Message)]
49pub struct OpcUsernamePasswordAuthentication {
50    #[prost(string, tag = "1")]
51    pub username: ::prost::alloc::string::String,
52    #[prost(string, tag = "2")]
53    pub password: ::prost::alloc::string::String,
54}
55#[derive(Clone, PartialEq, ::prost::Message)]
56pub struct OpcUsernamePasswordAuthenticationSecret {
57    #[prost(string, tag = "1")]
58    pub username: ::prost::alloc::string::String,
59    #[prost(string, tag = "2")]
60    pub password: ::prost::alloc::string::String,
61}
62#[derive(Clone, PartialEq, ::prost::Message)]
63pub struct OpcTokenAuthentication {
64    #[prost(string, tag = "1")]
65    pub token: ::prost::alloc::string::String,
66}
67#[derive(Clone, PartialEq, ::prost::Message)]
68pub struct OpcTokenAuthenticationSecret {
69    #[prost(string, tag = "1")]
70    pub token: ::prost::alloc::string::String,
71}
72/// The identifier field for an OPC-UA node
73#[derive(Clone, PartialEq, ::prost::Message)]
74pub struct OpcIdentifierValue {
75    #[prost(oneof = "opc_identifier_value::OpcIdentifierValue", tags = "1, 2")]
76    pub opc_identifier_value: ::core::option::Option<
77        opc_identifier_value::OpcIdentifierValue,
78    >,
79}
80/// Nested message and enum types in `OpcIdentifierValue`.
81pub mod opc_identifier_value {
82    #[derive(Clone, PartialEq, ::prost::Oneof)]
83    pub enum OpcIdentifierValue {
84        #[prost(int32, tag = "1")]
85        Numeric(i32),
86        #[prost(string, tag = "2")]
87        String(::prost::alloc::string::String),
88    }
89}
90/// An OPC-UA node
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct OpcNode {
93    #[prost(uint32, optional, tag = "1")]
94    pub namespace: ::core::option::Option<u32>,
95    #[prost(message, optional, tag = "2")]
96    pub identifier: ::core::option::Option<OpcIdentifierValue>,
97}
98/// How do you want to map the names of OPC-UA nodes to Nominal channels?
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct OpcUaChannelNamingConvention {
101    #[prost(
102        oneof = "opc_ua_channel_naming_convention::NamingConvention",
103        tags = "1, 2, 3, 4"
104    )]
105    pub naming_convention: ::core::option::Option<
106        opc_ua_channel_naming_convention::NamingConvention,
107    >,
108}
109/// Nested message and enum types in `OpcUaChannelNamingConvention`.
110pub mod opc_ua_channel_naming_convention {
111    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
112    pub struct OpcUaNodeId {}
113    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
114    pub struct OpcUaBrowseName {}
115    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
116    pub struct OpcUaDisplayName {}
117    /// Configuration for full path naming convention
118    #[derive(Clone, PartialEq, ::prost::Message)]
119    pub struct OpcUaFullPath {
120        /// We will build path up to any of these nodes, or the Objects folder.
121        #[prost(message, repeated, tag = "1")]
122        pub root_nodes: ::prost::alloc::vec::Vec<super::OpcNode>,
123        /// Custom delimiter for path separation. Defaults to "/" if not specified.
124        #[prost(string, tag = "2")]
125        pub delimiter: ::prost::alloc::string::String,
126    }
127    #[derive(Clone, PartialEq, ::prost::Oneof)]
128    pub enum NamingConvention {
129        /// For example, "NodeId{ns=3;i=1010}"
130        #[prost(message, tag = "1")]
131        NodeId(OpcUaNodeId),
132        /// The "name" field under the "BrowseName" attribute
133        #[prost(message, tag = "2")]
134        BrowseName(OpcUaBrowseName),
135        /// The "text" field under the "DisplayName" attribute
136        #[prost(message, tag = "3")]
137        DisplayName(OpcUaDisplayName),
138        /// The full path of the node, separated by a delimiter. Use this setting for creating the hierarchical prefix tree.
139        #[prost(message, tag = "4")]
140        FullPath(OpcUaFullPath),
141    }
142}
143/// Configuration for connecting to an OPC-UA server
144#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct OpcUaConnectionDetails {
146    #[prost(string, tag = "1")]
147    pub uri: ::prost::alloc::string::String,
148    #[prost(enumeration = "OpcSecurityPolicy", tag = "2")]
149    pub security_policy: i32,
150    #[prost(message, optional, tag = "3")]
151    pub authentication_config: ::core::option::Option<OpcAuthenticationConfig>,
152}
153/// Configuration for connecting to an OPC-UA server with secrets
154#[derive(Clone, PartialEq, ::prost::Message)]
155pub struct OpcUaConnectionDetailsSecret {
156    #[prost(string, tag = "1")]
157    pub uri: ::prost::alloc::string::String,
158    #[prost(enumeration = "OpcSecurityPolicy", tag = "2")]
159    pub security_policy: i32,
160    #[prost(message, optional, tag = "3")]
161    pub authentication_config: ::core::option::Option<OpcAuthenticationConfigSecret>,
162}
163#[derive(Clone, PartialEq, ::prost::Message)]
164pub struct OpcUaTraversalConfig {
165    /// Root nodes to subscribe to. For each node specified here, we will
166    /// subscribe to that node and all of its children.
167    #[prost(message, repeated, tag = "1")]
168    pub root_nodes: ::prost::alloc::vec::Vec<OpcNode>,
169    /// We will not subscribe to any of these nodes.
170    #[prost(message, repeated, tag = "2")]
171    pub skip_nodes: ::prost::alloc::vec::Vec<OpcNode>,
172    /// The type of references that we will follow when traversing the root nodes in the OPC UA server.
173    #[prost(enumeration = "OpcUaReferenceExplorationType", tag = "3")]
174    pub reference_exploration_type: i32,
175}
176#[derive(Clone, PartialEq, ::prost::Message)]
177pub struct OpcUaDirectNodeSubscription {
178    #[prost(message, repeated, tag = "1")]
179    pub nodes: ::prost::alloc::vec::Vec<OpcNode>,
180}
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct OpcUaNodeExplorationConfig {
183    #[prost(
184        oneof = "opc_ua_node_exploration_config::OpcUaNodeExplorationConfig",
185        tags = "1, 2"
186    )]
187    pub opc_ua_node_exploration_config: ::core::option::Option<
188        opc_ua_node_exploration_config::OpcUaNodeExplorationConfig,
189    >,
190}
191/// Nested message and enum types in `OpcUaNodeExplorationConfig`.
192pub mod opc_ua_node_exploration_config {
193    #[derive(Clone, PartialEq, ::prost::Oneof)]
194    pub enum OpcUaNodeExplorationConfig {
195        #[prost(message, tag = "1")]
196        OpcUaTraversalConfig(super::OpcUaTraversalConfig),
197        #[prost(message, tag = "2")]
198        OpcUaDirectNodeSubscription(super::OpcUaDirectNodeSubscription),
199    }
200}
201#[derive(Clone, Copy, PartialEq, ::prost::Message)]
202pub struct OpcUaTimestampHandling {
203    #[prost(oneof = "opc_ua_timestamp_handling::TimestampType", tags = "1, 2, 3")]
204    pub timestamp_type: ::core::option::Option<opc_ua_timestamp_handling::TimestampType>,
205}
206/// Nested message and enum types in `OpcUaTimestampHandling`.
207pub mod opc_ua_timestamp_handling {
208    /// Use the server timestamp <https://reference.opcfoundation.org/Core/Part4/v104/docs/7.7.4>
209    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
210    pub struct OpcUaServerTime {}
211    /// Use the source timestamp <https://reference.opcfoundation.org/Core/Part4/v104/docs/7.7.3>
212    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
213    pub struct OpcUaSourceTime {}
214    /// Use the server timestamp, but add an an optional offset. By default, the offset will be the time now.
215    /// This is useful for when the server starts at an epoch time of 0.
216    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
217    pub struct OpcUaRelativeTimestamp {
218        #[prost(message, optional, tag = "1")]
219        pub offset: ::core::option::Option<
220            super::super::super::super::google::protobuf::Timestamp,
221        >,
222    }
223    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
224    pub enum TimestampType {
225        #[prost(message, tag = "1")]
226        Server(OpcUaServerTime),
227        #[prost(message, tag = "2")]
228        Source(OpcUaSourceTime),
229        #[prost(message, tag = "3")]
230        Relative(OpcUaRelativeTimestamp),
231    }
232}
233#[derive(Clone, Copy, PartialEq, ::prost::Message)]
234pub struct OpcUaDataChangeFilter {
235    /// The trigger for the data change filter.
236    #[prost(enumeration = "OpcUaDataChangeTrigger", tag = "1")]
237    pub trigger: i32,
238    #[prost(enumeration = "OpcUaDeadbandType", tag = "2")]
239    pub deadband_type: i32,
240    #[prost(double, tag = "3")]
241    pub deadband_value: f64,
242}
243/// Configuration for determining which nodes to scrape and how.
244#[derive(Clone, PartialEq, ::prost::Message)]
245pub struct OpcUaScrapingConfig {
246    #[prost(message, optional, tag = "1")]
247    pub node_exploration_config: ::core::option::Option<OpcUaNodeExplorationConfig>,
248    /// The browse name of the node under which the unit is stored for the nodes we scrape.
249    #[prost(string, tag = "2")]
250    pub unit_node_name: ::prost::alloc::string::String,
251    #[prost(message, optional, tag = "3")]
252    pub channel_naming_convention: ::core::option::Option<OpcUaChannelNamingConvention>,
253    /// If true, we will override the host and port of the OPC UA server with the host and port of the original server URL.
254    #[prost(bool, tag = "4")]
255    pub override_host: bool,
256    /// How we will handle unknown data types when we read them from the server
257    #[prost(enumeration = "OpcUaUnknownDataTypeHandling", tag = "5")]
258    pub unknown_data_type_handling: i32,
259    /// How to handle situations where there are failed monitors.
260    #[prost(enumeration = "OpcUaFailedMonitorHandling", tag = "6")]
261    pub failed_monitor_handling: i32,
262    /// What timestamps should we write for the channels?
263    #[prost(message, optional, tag = "7")]
264    pub timestamp_handling: ::core::option::Option<OpcUaTimestampHandling>,
265    /// The data change filter to be applied for the monitored items in the subscription.
266    #[prost(message, optional, tag = "8")]
267    pub data_change_filter: ::core::option::Option<OpcUaDataChangeFilter>,
268}
269/// Security policies supported for OPC-UA connections
270/// buf:lint:ignore ENUM_VALUE_PREFIX
271#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
272#[repr(i32)]
273pub enum OpcSecurityPolicy {
274    Unspecified = 0,
275    None = 1,
276    Basic256Sha256 = 2,
277}
278impl OpcSecurityPolicy {
279    /// String value of the enum field names used in the ProtoBuf definition.
280    ///
281    /// The values are not transformed in any way and thus are considered stable
282    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
283    pub fn as_str_name(&self) -> &'static str {
284        match self {
285            Self::Unspecified => "OPC_SECURITY_POLICY_UNSPECIFIED",
286            Self::None => "NONE",
287            Self::Basic256Sha256 => "BASIC_256_SHA_256",
288        }
289    }
290    /// Creates an enum from field names used in the ProtoBuf definition.
291    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
292        match value {
293            "OPC_SECURITY_POLICY_UNSPECIFIED" => Some(Self::Unspecified),
294            "NONE" => Some(Self::None),
295            "BASIC_256_SHA_256" => Some(Self::Basic256Sha256),
296            _ => None,
297        }
298    }
299}
300#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
301#[repr(i32)]
302pub enum OpcUaReferenceExplorationType {
303    Unspecified = 0,
304    Organizes = 1,
305    HierarchicalReferences = 2,
306}
307impl OpcUaReferenceExplorationType {
308    /// String value of the enum field names used in the ProtoBuf definition.
309    ///
310    /// The values are not transformed in any way and thus are considered stable
311    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
312    pub fn as_str_name(&self) -> &'static str {
313        match self {
314            Self::Unspecified => "OPC_UA_REFERENCE_EXPLORATION_TYPE_UNSPECIFIED",
315            Self::Organizes => "OPC_UA_REFERENCE_EXPLORATION_TYPE_ORGANIZES",
316            Self::HierarchicalReferences => {
317                "OPC_UA_REFERENCE_EXPLORATION_TYPE_HIERARCHICAL_REFERENCES"
318            }
319        }
320    }
321    /// Creates an enum from field names used in the ProtoBuf definition.
322    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
323        match value {
324            "OPC_UA_REFERENCE_EXPLORATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
325            "OPC_UA_REFERENCE_EXPLORATION_TYPE_ORGANIZES" => Some(Self::Organizes),
326            "OPC_UA_REFERENCE_EXPLORATION_TYPE_HIERARCHICAL_REFERENCES" => {
327                Some(Self::HierarchicalReferences)
328            }
329            _ => None,
330        }
331    }
332}
333#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
334#[repr(i32)]
335pub enum OpcUaUnknownDataTypeHandling {
336    Unspecified = 0,
337    /// If we encounter an unknown data type, we will error out
338    Error = 1,
339    /// If we encounter an unknown data type, we will assume it is a double
340    TreatAsDouble = 2,
341    /// If we encounter an unknown data type, we will assume it is a string
342    TreatAsString = 3,
343}
344impl OpcUaUnknownDataTypeHandling {
345    /// String value of the enum field names used in the ProtoBuf definition.
346    ///
347    /// The values are not transformed in any way and thus are considered stable
348    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
349    pub fn as_str_name(&self) -> &'static str {
350        match self {
351            Self::Unspecified => "OPC_UA_UNKNOWN_DATA_TYPE_HANDLING_UNSPECIFIED",
352            Self::Error => "OPC_UA_UNKNOWN_DATA_TYPE_HANDLING_ERROR",
353            Self::TreatAsDouble => "OPC_UA_UNKNOWN_DATA_TYPE_HANDLING_TREAT_AS_DOUBLE",
354            Self::TreatAsString => "OPC_UA_UNKNOWN_DATA_TYPE_HANDLING_TREAT_AS_STRING",
355        }
356    }
357    /// Creates an enum from field names used in the ProtoBuf definition.
358    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
359        match value {
360            "OPC_UA_UNKNOWN_DATA_TYPE_HANDLING_UNSPECIFIED" => Some(Self::Unspecified),
361            "OPC_UA_UNKNOWN_DATA_TYPE_HANDLING_ERROR" => Some(Self::Error),
362            "OPC_UA_UNKNOWN_DATA_TYPE_HANDLING_TREAT_AS_DOUBLE" => {
363                Some(Self::TreatAsDouble)
364            }
365            "OPC_UA_UNKNOWN_DATA_TYPE_HANDLING_TREAT_AS_STRING" => {
366                Some(Self::TreatAsString)
367            }
368            _ => None,
369        }
370    }
371}
372#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
373#[repr(i32)]
374pub enum OpcUaFailedMonitorHandling {
375    Unspecified = 0,
376    Error = 1,
377    Ignore = 2,
378}
379impl OpcUaFailedMonitorHandling {
380    /// String value of the enum field names used in the ProtoBuf definition.
381    ///
382    /// The values are not transformed in any way and thus are considered stable
383    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
384    pub fn as_str_name(&self) -> &'static str {
385        match self {
386            Self::Unspecified => "OPC_UA_FAILED_MONITOR_HANDLING_UNSPECIFIED",
387            Self::Error => "OPC_UA_FAILED_MONITOR_HANDLING_ERROR",
388            Self::Ignore => "OPC_UA_FAILED_MONITOR_HANDLING_IGNORE",
389        }
390    }
391    /// Creates an enum from field names used in the ProtoBuf definition.
392    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
393        match value {
394            "OPC_UA_FAILED_MONITOR_HANDLING_UNSPECIFIED" => Some(Self::Unspecified),
395            "OPC_UA_FAILED_MONITOR_HANDLING_ERROR" => Some(Self::Error),
396            "OPC_UA_FAILED_MONITOR_HANDLING_IGNORE" => Some(Self::Ignore),
397            _ => None,
398        }
399    }
400}
401#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
402#[repr(i32)]
403pub enum OpcUaDataChangeTrigger {
404    Unspecified = 0,
405    StatusOnly = 1,
406    StatusValue = 2,
407    StatusValueTimestamp = 3,
408}
409impl OpcUaDataChangeTrigger {
410    /// String value of the enum field names used in the ProtoBuf definition.
411    ///
412    /// The values are not transformed in any way and thus are considered stable
413    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
414    pub fn as_str_name(&self) -> &'static str {
415        match self {
416            Self::Unspecified => "OPC_UA_DATA_CHANGE_TRIGGER_UNSPECIFIED",
417            Self::StatusOnly => "OPC_UA_DATA_CHANGE_TRIGGER_STATUS_ONLY",
418            Self::StatusValue => "OPC_UA_DATA_CHANGE_TRIGGER_STATUS_VALUE",
419            Self::StatusValueTimestamp => {
420                "OPC_UA_DATA_CHANGE_TRIGGER_STATUS_VALUE_TIMESTAMP"
421            }
422        }
423    }
424    /// Creates an enum from field names used in the ProtoBuf definition.
425    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
426        match value {
427            "OPC_UA_DATA_CHANGE_TRIGGER_UNSPECIFIED" => Some(Self::Unspecified),
428            "OPC_UA_DATA_CHANGE_TRIGGER_STATUS_ONLY" => Some(Self::StatusOnly),
429            "OPC_UA_DATA_CHANGE_TRIGGER_STATUS_VALUE" => Some(Self::StatusValue),
430            "OPC_UA_DATA_CHANGE_TRIGGER_STATUS_VALUE_TIMESTAMP" => {
431                Some(Self::StatusValueTimestamp)
432            }
433            _ => None,
434        }
435    }
436}
437#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
438#[repr(i32)]
439pub enum OpcUaDeadbandType {
440    Unspecified = 0,
441    None = 1,
442    Absolute = 2,
443    Percent = 3,
444}
445impl OpcUaDeadbandType {
446    /// String value of the enum field names used in the ProtoBuf definition.
447    ///
448    /// The values are not transformed in any way and thus are considered stable
449    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
450    pub fn as_str_name(&self) -> &'static str {
451        match self {
452            Self::Unspecified => "OPC_UA_DEADBAND_TYPE_UNSPECIFIED",
453            Self::None => "OPC_UA_DEADBAND_TYPE_NONE",
454            Self::Absolute => "OPC_UA_DEADBAND_TYPE_ABSOLUTE",
455            Self::Percent => "OPC_UA_DEADBAND_TYPE_PERCENT",
456        }
457    }
458    /// Creates an enum from field names used in the ProtoBuf definition.
459    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
460        match value {
461            "OPC_UA_DEADBAND_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
462            "OPC_UA_DEADBAND_TYPE_NONE" => Some(Self::None),
463            "OPC_UA_DEADBAND_TYPE_ABSOLUTE" => Some(Self::Absolute),
464            "OPC_UA_DEADBAND_TYPE_PERCENT" => Some(Self::Percent),
465            _ => None,
466        }
467    }
468}
469/// Request to create a new streaming connection
470#[derive(Clone, PartialEq, ::prost::Message)]
471pub struct CreateStreamingConnectionRequest {
472    #[prost(string, tag = "1")]
473    pub name: ::prost::alloc::string::String,
474    #[prost(string, optional, tag = "2")]
475    pub description: ::core::option::Option<::prost::alloc::string::String>,
476    #[prost(message, optional, tag = "3")]
477    pub connection_details: ::core::option::Option<StreamingConnectionDetails>,
478    #[prost(string, optional, tag = "4")]
479    pub workspace_rid: ::core::option::Option<::prost::alloc::string::String>,
480}
481/// Response for creating a new streaming connection
482#[derive(Clone, PartialEq, ::prost::Message)]
483pub struct CreateStreamingConnectionResponse {
484    #[prost(string, tag = "1")]
485    pub streaming_connection_rid: ::prost::alloc::string::String,
486}
487/// Response for stream operations
488#[derive(Clone, Copy, PartialEq, ::prost::Message)]
489pub struct StopStreamResponse {
490    #[prost(bool, tag = "1")]
491    pub success: bool,
492}
493#[derive(Clone, Copy, PartialEq, ::prost::Message)]
494pub struct StartStreamResponse {
495    #[prost(bool, tag = "1")]
496    pub success: bool,
497}
498/// A configured streaming connection
499#[derive(Clone, PartialEq, ::prost::Message)]
500pub struct StreamingConnection {
501    #[prost(string, tag = "1")]
502    pub streaming_connection_rid: ::prost::alloc::string::String,
503    #[prost(string, tag = "2")]
504    pub name: ::prost::alloc::string::String,
505    #[prost(string, optional, tag = "3")]
506    pub description: ::core::option::Option<::prost::alloc::string::String>,
507    #[prost(message, optional, tag = "4")]
508    pub connection_details: ::core::option::Option<StreamingConnectionDetailsSecret>,
509    #[prost(enumeration = "StreamingConnectionStatus", tag = "6")]
510    pub status: i32,
511    #[prost(message, optional, tag = "7")]
512    pub created_at: ::core::option::Option<
513        super::super::super::google::protobuf::Timestamp,
514    >,
515}
516/// Union type for different streaming connection types
517#[derive(Clone, PartialEq, ::prost::Message)]
518pub struct StreamingConnectionDetails {
519    #[prost(
520        oneof = "streaming_connection_details::StreamingConnectionDetails",
521        tags = "1"
522    )]
523    pub streaming_connection_details: ::core::option::Option<
524        streaming_connection_details::StreamingConnectionDetails,
525    >,
526}
527/// Nested message and enum types in `StreamingConnectionDetails`.
528pub mod streaming_connection_details {
529    #[derive(Clone, PartialEq, ::prost::Oneof)]
530    pub enum StreamingConnectionDetails {
531        #[prost(message, tag = "1")]
532        OpcUa(super::OpcUaConnectionDetails),
533    }
534}
535/// Union type for different streaming connection secret types
536#[derive(Clone, PartialEq, ::prost::Message)]
537pub struct StreamingConnectionDetailsSecret {
538    #[prost(
539        oneof = "streaming_connection_details_secret::StreamingConnectionDetails",
540        tags = "1"
541    )]
542    pub streaming_connection_details: ::core::option::Option<
543        streaming_connection_details_secret::StreamingConnectionDetails,
544    >,
545}
546/// Nested message and enum types in `StreamingConnectionDetailsSecret`.
547pub mod streaming_connection_details_secret {
548    #[derive(Clone, PartialEq, ::prost::Oneof)]
549    pub enum StreamingConnectionDetails {
550        #[prost(message, tag = "1")]
551        OpcUa(super::OpcUaConnectionDetailsSecret),
552    }
553}
554/// Union type for different streaming scraping types
555#[derive(Clone, PartialEq, ::prost::Message)]
556pub struct StreamingScrapingConfig {
557    #[prost(oneof = "streaming_scraping_config::StreamingScrapingConfig", tags = "1")]
558    pub streaming_scraping_config: ::core::option::Option<
559        streaming_scraping_config::StreamingScrapingConfig,
560    >,
561}
562/// Nested message and enum types in `StreamingScrapingConfig`.
563pub mod streaming_scraping_config {
564    #[derive(Clone, PartialEq, ::prost::Oneof)]
565    pub enum StreamingScrapingConfig {
566        #[prost(message, tag = "1")]
567        OpcUa(super::OpcUaScrapingConfig),
568    }
569}
570#[derive(Clone, PartialEq, ::prost::Message)]
571pub struct GetStreamingConnectionRequest {
572    #[prost(string, tag = "1")]
573    pub streaming_connection_rid: ::prost::alloc::string::String,
574}
575#[derive(Clone, PartialEq, ::prost::Message)]
576pub struct GetStreamingConnectionResponse {
577    #[prost(message, optional, tag = "1")]
578    pub streaming_connection: ::core::option::Option<StreamingConnection>,
579}
580#[derive(Clone, PartialEq, ::prost::Message)]
581pub struct ListStreamingConnectionsRequest {
582    #[prost(string, repeated, tag = "1")]
583    pub workspace_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
584}
585#[derive(Clone, PartialEq, ::prost::Message)]
586pub struct ListStreamingConnectionsResponse {
587    #[prost(message, repeated, tag = "1")]
588    pub streaming_connections: ::prost::alloc::vec::Vec<StreamingConnection>,
589}
590#[derive(Clone, PartialEq, ::prost::Message)]
591pub struct UpdateStreamingConnectionStatusRequest {
592    #[prost(string, tag = "1")]
593    pub streaming_connection_rid: ::prost::alloc::string::String,
594    #[prost(enumeration = "StreamingConnectionStatus", tag = "2")]
595    pub status: i32,
596}
597#[derive(Clone, PartialEq, ::prost::Message)]
598pub struct UpdateStreamingConnectionStatusResponse {
599    #[prost(message, optional, tag = "1")]
600    pub streaming_connection: ::core::option::Option<StreamingConnection>,
601}
602#[derive(Clone, PartialEq, ::prost::Message)]
603pub struct StartStreamRequest {
604    #[prost(string, tag = "1")]
605    pub streaming_connection_rid: ::prost::alloc::string::String,
606    #[prost(message, optional, tag = "2")]
607    pub scraping_config: ::core::option::Option<StreamingScrapingConfig>,
608    #[prost(string, tag = "3")]
609    pub target_dataset_rid: ::prost::alloc::string::String,
610}
611#[derive(Clone, PartialEq, ::prost::Message)]
612pub struct StopStreamRequest {
613    #[prost(string, tag = "1")]
614    pub streaming_connection_rid: ::prost::alloc::string::String,
615}
616/// Error types for streaming connection operations
617#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
618#[repr(i32)]
619pub enum StreamingConnectionErrorType {
620    Unspecified = 0,
621    ConnectionNotFound = 1,
622    StreamingConnectionAlreadyRunning = 2,
623}
624impl StreamingConnectionErrorType {
625    /// String value of the enum field names used in the ProtoBuf definition.
626    ///
627    /// The values are not transformed in any way and thus are considered stable
628    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
629    pub fn as_str_name(&self) -> &'static str {
630        match self {
631            Self::Unspecified => "STREAMING_CONNECTION_ERROR_TYPE_UNSPECIFIED",
632            Self::ConnectionNotFound => {
633                "STREAMING_CONNECTION_ERROR_TYPE_CONNECTION_NOT_FOUND"
634            }
635            Self::StreamingConnectionAlreadyRunning => {
636                "STREAMING_CONNECTION_ERROR_TYPE_STREAMING_CONNECTION_ALREADY_RUNNING"
637            }
638        }
639    }
640    /// Creates an enum from field names used in the ProtoBuf definition.
641    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
642        match value {
643            "STREAMING_CONNECTION_ERROR_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
644            "STREAMING_CONNECTION_ERROR_TYPE_CONNECTION_NOT_FOUND" => {
645                Some(Self::ConnectionNotFound)
646            }
647            "STREAMING_CONNECTION_ERROR_TYPE_STREAMING_CONNECTION_ALREADY_RUNNING" => {
648                Some(Self::StreamingConnectionAlreadyRunning)
649            }
650            _ => None,
651        }
652    }
653}
654/// The current status of a streaming connection
655/// buf:lint:ignore ENUM_VALUE_PREFIX
656#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
657#[repr(i32)]
658pub enum StreamingConnectionStatus {
659    Unspecified = 0,
660    Connected = 1,
661    Disconnected = 2,
662}
663impl StreamingConnectionStatus {
664    /// String value of the enum field names used in the ProtoBuf definition.
665    ///
666    /// The values are not transformed in any way and thus are considered stable
667    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
668    pub fn as_str_name(&self) -> &'static str {
669        match self {
670            Self::Unspecified => "STREAMING_CONNECTION_STATUS_UNSPECIFIED",
671            Self::Connected => "CONNECTED",
672            Self::Disconnected => "DISCONNECTED",
673        }
674    }
675    /// Creates an enum from field names used in the ProtoBuf definition.
676    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
677        match value {
678            "STREAMING_CONNECTION_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
679            "CONNECTED" => Some(Self::Connected),
680            "DISCONNECTED" => Some(Self::Disconnected),
681            _ => None,
682        }
683    }
684}
685/// Generated client implementations.
686pub mod streaming_connection_service_client {
687    #![allow(
688        unused_variables,
689        dead_code,
690        missing_docs,
691        clippy::wildcard_imports,
692        clippy::let_unit_value,
693    )]
694    use tonic::codegen::*;
695    use tonic::codegen::http::Uri;
696    /// Service for managing streaming connections to external data sources.
697    /// Supports OPC-UA with plans for MQTT, Kafka, and other protocols.
698    #[derive(Debug, Clone)]
699    pub struct StreamingConnectionServiceClient<T> {
700        inner: tonic::client::Grpc<T>,
701    }
702    impl StreamingConnectionServiceClient<tonic::transport::Channel> {
703        /// Attempt to create a new client by connecting to a given endpoint.
704        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
705        where
706            D: TryInto<tonic::transport::Endpoint>,
707            D::Error: Into<StdError>,
708        {
709            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
710            Ok(Self::new(conn))
711        }
712    }
713    impl<T> StreamingConnectionServiceClient<T>
714    where
715        T: tonic::client::GrpcService<tonic::body::Body>,
716        T::Error: Into<StdError>,
717        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
718        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
719    {
720        pub fn new(inner: T) -> Self {
721            let inner = tonic::client::Grpc::new(inner);
722            Self { inner }
723        }
724        pub fn with_origin(inner: T, origin: Uri) -> Self {
725            let inner = tonic::client::Grpc::with_origin(inner, origin);
726            Self { inner }
727        }
728        pub fn with_interceptor<F>(
729            inner: T,
730            interceptor: F,
731        ) -> StreamingConnectionServiceClient<InterceptedService<T, F>>
732        where
733            F: tonic::service::Interceptor,
734            T::ResponseBody: Default,
735            T: tonic::codegen::Service<
736                http::Request<tonic::body::Body>,
737                Response = http::Response<
738                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
739                >,
740            >,
741            <T as tonic::codegen::Service<
742                http::Request<tonic::body::Body>,
743            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
744        {
745            StreamingConnectionServiceClient::new(
746                InterceptedService::new(inner, interceptor),
747            )
748        }
749        /// Compress requests with the given encoding.
750        ///
751        /// This requires the server to support it otherwise it might respond with an
752        /// error.
753        #[must_use]
754        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
755            self.inner = self.inner.send_compressed(encoding);
756            self
757        }
758        /// Enable decompressing responses.
759        #[must_use]
760        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
761            self.inner = self.inner.accept_compressed(encoding);
762            self
763        }
764        /// Limits the maximum size of a decoded message.
765        ///
766        /// Default: `4MB`
767        #[must_use]
768        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
769            self.inner = self.inner.max_decoding_message_size(limit);
770            self
771        }
772        /// Limits the maximum size of an encoded message.
773        ///
774        /// Default: `usize::MAX`
775        #[must_use]
776        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
777            self.inner = self.inner.max_encoding_message_size(limit);
778            self
779        }
780        /// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
781        /// Creates a new streaming connection configuration
782        /// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
783        pub async fn create_streaming_connection(
784            &mut self,
785            request: impl tonic::IntoRequest<super::CreateStreamingConnectionRequest>,
786        ) -> std::result::Result<
787            tonic::Response<super::CreateStreamingConnectionResponse>,
788            tonic::Status,
789        > {
790            self.inner
791                .ready()
792                .await
793                .map_err(|e| {
794                    tonic::Status::unknown(
795                        format!("Service was not ready: {}", e.into()),
796                    )
797                })?;
798            let codec = tonic::codec::ProstCodec::default();
799            let path = http::uri::PathAndQuery::from_static(
800                "/nominal.streaming_connection_service.v1.StreamingConnectionService/CreateStreamingConnection",
801            );
802            let mut req = request.into_request();
803            req.extensions_mut()
804                .insert(
805                    GrpcMethod::new(
806                        "nominal.streaming_connection_service.v1.StreamingConnectionService",
807                        "CreateStreamingConnection",
808                    ),
809                );
810            self.inner.unary(req, path, codec).await
811        }
812        /// Gets the details and status of a streaming connection
813        pub async fn get_streaming_connection(
814            &mut self,
815            request: impl tonic::IntoRequest<super::GetStreamingConnectionRequest>,
816        ) -> std::result::Result<
817            tonic::Response<super::GetStreamingConnectionResponse>,
818            tonic::Status,
819        > {
820            self.inner
821                .ready()
822                .await
823                .map_err(|e| {
824                    tonic::Status::unknown(
825                        format!("Service was not ready: {}", e.into()),
826                    )
827                })?;
828            let codec = tonic::codec::ProstCodec::default();
829            let path = http::uri::PathAndQuery::from_static(
830                "/nominal.streaming_connection_service.v1.StreamingConnectionService/GetStreamingConnection",
831            );
832            let mut req = request.into_request();
833            req.extensions_mut()
834                .insert(
835                    GrpcMethod::new(
836                        "nominal.streaming_connection_service.v1.StreamingConnectionService",
837                        "GetStreamingConnection",
838                    ),
839                );
840            self.inner.unary(req, path, codec).await
841        }
842        /// List all the streaming connections for a set of workspaces
843        pub async fn list_streaming_connections(
844            &mut self,
845            request: impl tonic::IntoRequest<super::ListStreamingConnectionsRequest>,
846        ) -> std::result::Result<
847            tonic::Response<super::ListStreamingConnectionsResponse>,
848            tonic::Status,
849        > {
850            self.inner
851                .ready()
852                .await
853                .map_err(|e| {
854                    tonic::Status::unknown(
855                        format!("Service was not ready: {}", e.into()),
856                    )
857                })?;
858            let codec = tonic::codec::ProstCodec::default();
859            let path = http::uri::PathAndQuery::from_static(
860                "/nominal.streaming_connection_service.v1.StreamingConnectionService/ListStreamingConnections",
861            );
862            let mut req = request.into_request();
863            req.extensions_mut()
864                .insert(
865                    GrpcMethod::new(
866                        "nominal.streaming_connection_service.v1.StreamingConnectionService",
867                        "ListStreamingConnections",
868                    ),
869                );
870            self.inner.unary(req, path, codec).await
871        }
872        /// Update the status of a streaming connection
873        pub async fn update_streaming_connection_status(
874            &mut self,
875            request: impl tonic::IntoRequest<
876                super::UpdateStreamingConnectionStatusRequest,
877            >,
878        ) -> std::result::Result<
879            tonic::Response<super::UpdateStreamingConnectionStatusResponse>,
880            tonic::Status,
881        > {
882            self.inner
883                .ready()
884                .await
885                .map_err(|e| {
886                    tonic::Status::unknown(
887                        format!("Service was not ready: {}", e.into()),
888                    )
889                })?;
890            let codec = tonic::codec::ProstCodec::default();
891            let path = http::uri::PathAndQuery::from_static(
892                "/nominal.streaming_connection_service.v1.StreamingConnectionService/UpdateStreamingConnectionStatus",
893            );
894            let mut req = request.into_request();
895            req.extensions_mut()
896                .insert(
897                    GrpcMethod::new(
898                        "nominal.streaming_connection_service.v1.StreamingConnectionService",
899                        "UpdateStreamingConnectionStatus",
900                    ),
901                );
902            self.inner.unary(req, path, codec).await
903        }
904        /// Starts streaming data for a connection
905        pub async fn start_stream(
906            &mut self,
907            request: impl tonic::IntoRequest<super::StartStreamRequest>,
908        ) -> std::result::Result<
909            tonic::Response<super::StartStreamResponse>,
910            tonic::Status,
911        > {
912            self.inner
913                .ready()
914                .await
915                .map_err(|e| {
916                    tonic::Status::unknown(
917                        format!("Service was not ready: {}", e.into()),
918                    )
919                })?;
920            let codec = tonic::codec::ProstCodec::default();
921            let path = http::uri::PathAndQuery::from_static(
922                "/nominal.streaming_connection_service.v1.StreamingConnectionService/StartStream",
923            );
924            let mut req = request.into_request();
925            req.extensions_mut()
926                .insert(
927                    GrpcMethod::new(
928                        "nominal.streaming_connection_service.v1.StreamingConnectionService",
929                        "StartStream",
930                    ),
931                );
932            self.inner.unary(req, path, codec).await
933        }
934        /// Stops streaming data for a connection
935        pub async fn stop_stream(
936            &mut self,
937            request: impl tonic::IntoRequest<super::StopStreamRequest>,
938        ) -> std::result::Result<
939            tonic::Response<super::StopStreamResponse>,
940            tonic::Status,
941        > {
942            self.inner
943                .ready()
944                .await
945                .map_err(|e| {
946                    tonic::Status::unknown(
947                        format!("Service was not ready: {}", e.into()),
948                    )
949                })?;
950            let codec = tonic::codec::ProstCodec::default();
951            let path = http::uri::PathAndQuery::from_static(
952                "/nominal.streaming_connection_service.v1.StreamingConnectionService/StopStream",
953            );
954            let mut req = request.into_request();
955            req.extensions_mut()
956                .insert(
957                    GrpcMethod::new(
958                        "nominal.streaming_connection_service.v1.StreamingConnectionService",
959                        "StopStream",
960                    ),
961                );
962            self.inner.unary(req, path, codec).await
963        }
964    }
965}