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