Skip to main content

nominal_api_proto/proto/
nominal.connections.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct Timestamp {
4    #[prost(int64, tag = "1")]
5    pub seconds: i64,
6    #[prost(int64, tag = "2")]
7    pub nanos: i64,
8}
9#[derive(Clone, Copy, PartialEq, ::prost::Message)]
10pub struct Range {
11    #[prost(message, optional, tag = "1")]
12    pub start_time_inclusive: ::core::option::Option<Timestamp>,
13    #[prost(message, optional, tag = "2")]
14    pub end_time_exclusive: ::core::option::Option<Timestamp>,
15}
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct TagValues {
18    #[prost(string, repeated, tag = "1")]
19    pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
20}
21#[derive(Clone, PartialEq, ::prost::Message)]
22pub struct ChannelMetadata {
23    #[prost(string, tag = "1")]
24    pub channel: ::prost::alloc::string::String,
25    #[prost(enumeration = "DataType", tag = "2")]
26    pub data_type: i32,
27    #[prost(map = "string, message", tag = "3")]
28    pub all_tag_values: ::std::collections::HashMap<
29        ::prost::alloc::string::String,
30        TagValues,
31    >,
32}
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct ListChannelsRequest {
35    #[prost(int32, tag = "1")]
36    pub page_size: i32,
37    #[prost(message, optional, tag = "2")]
38    pub range: ::core::option::Option<Range>,
39    #[prost(string, optional, tag = "3")]
40    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
41}
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct ListChannelsResponse {
44    #[prost(message, repeated, tag = "1")]
45    pub channels: ::prost::alloc::vec::Vec<ChannelMetadata>,
46    #[prost(string, optional, tag = "2")]
47    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
48}
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct QueryChannelRequest {
51    #[prost(string, tag = "1")]
52    pub channel: ::prost::alloc::string::String,
53    #[prost(map = "string, string", tag = "2")]
54    pub tags: ::std::collections::HashMap<
55        ::prost::alloc::string::String,
56        ::prost::alloc::string::String,
57    >,
58    #[prost(message, optional, tag = "3")]
59    pub range: ::core::option::Option<Range>,
60}
61#[derive(Clone, PartialEq, ::prost::Message)]
62pub struct IntPoints {
63    #[prost(message, repeated, tag = "1")]
64    pub timestamps: ::prost::alloc::vec::Vec<Timestamp>,
65    #[prost(int64, repeated, tag = "2")]
66    pub values: ::prost::alloc::vec::Vec<i64>,
67}
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct DoublePoints {
70    #[prost(message, repeated, tag = "1")]
71    pub timestamps: ::prost::alloc::vec::Vec<Timestamp>,
72    #[prost(double, repeated, tag = "2")]
73    pub values: ::prost::alloc::vec::Vec<f64>,
74}
75#[derive(Clone, PartialEq, ::prost::Message)]
76pub struct StringPoints {
77    #[prost(message, repeated, tag = "1")]
78    pub timestamps: ::prost::alloc::vec::Vec<Timestamp>,
79    #[prost(string, repeated, tag = "2")]
80    pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
81}
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct QueryChannelResponse {
84    #[prost(oneof = "query_channel_response::Values", tags = "1, 2, 3")]
85    pub values: ::core::option::Option<query_channel_response::Values>,
86}
87/// Nested message and enum types in `QueryChannelResponse`.
88pub mod query_channel_response {
89    #[derive(Clone, PartialEq, ::prost::Oneof)]
90    pub enum Values {
91        #[prost(message, tag = "1")]
92        Ints(super::IntPoints),
93        #[prost(message, tag = "2")]
94        Doubles(super::DoublePoints),
95        #[prost(message, tag = "3")]
96        Strings(super::StringPoints),
97    }
98}
99#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
100#[repr(i32)]
101pub enum DataType {
102    Unspecified = 0,
103    Int = 1,
104    Double = 2,
105    String = 3,
106}
107impl DataType {
108    /// String value of the enum field names used in the ProtoBuf definition.
109    ///
110    /// The values are not transformed in any way and thus are considered stable
111    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
112    pub fn as_str_name(&self) -> &'static str {
113        match self {
114            Self::Unspecified => "DATA_TYPE_UNSPECIFIED",
115            Self::Int => "DATA_TYPE_INT",
116            Self::Double => "DATA_TYPE_DOUBLE",
117            Self::String => "DATA_TYPE_STRING",
118        }
119    }
120    /// Creates an enum from field names used in the ProtoBuf definition.
121    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
122        match value {
123            "DATA_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
124            "DATA_TYPE_INT" => Some(Self::Int),
125            "DATA_TYPE_DOUBLE" => Some(Self::Double),
126            "DATA_TYPE_STRING" => Some(Self::String),
127            _ => None,
128        }
129    }
130}
131/// Generated client implementations.
132pub mod connections_service_client {
133    #![allow(
134        unused_variables,
135        dead_code,
136        missing_docs,
137        clippy::wildcard_imports,
138        clippy::let_unit_value,
139    )]
140    use tonic::codegen::*;
141    use tonic::codegen::http::Uri;
142    #[derive(Debug, Clone)]
143    pub struct ConnectionsServiceClient<T> {
144        inner: tonic::client::Grpc<T>,
145    }
146    impl ConnectionsServiceClient<tonic::transport::Channel> {
147        /// Attempt to create a new client by connecting to a given endpoint.
148        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
149        where
150            D: TryInto<tonic::transport::Endpoint>,
151            D::Error: Into<StdError>,
152        {
153            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
154            Ok(Self::new(conn))
155        }
156    }
157    impl<T> ConnectionsServiceClient<T>
158    where
159        T: tonic::client::GrpcService<tonic::body::Body>,
160        T::Error: Into<StdError>,
161        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
162        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
163    {
164        pub fn new(inner: T) -> Self {
165            let inner = tonic::client::Grpc::new(inner);
166            Self { inner }
167        }
168        pub fn with_origin(inner: T, origin: Uri) -> Self {
169            let inner = tonic::client::Grpc::with_origin(inner, origin);
170            Self { inner }
171        }
172        pub fn with_interceptor<F>(
173            inner: T,
174            interceptor: F,
175        ) -> ConnectionsServiceClient<InterceptedService<T, F>>
176        where
177            F: tonic::service::Interceptor,
178            T::ResponseBody: Default,
179            T: tonic::codegen::Service<
180                http::Request<tonic::body::Body>,
181                Response = http::Response<
182                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
183                >,
184            >,
185            <T as tonic::codegen::Service<
186                http::Request<tonic::body::Body>,
187            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
188        {
189            ConnectionsServiceClient::new(InterceptedService::new(inner, interceptor))
190        }
191        /// Compress requests with the given encoding.
192        ///
193        /// This requires the server to support it otherwise it might respond with an
194        /// error.
195        #[must_use]
196        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
197            self.inner = self.inner.send_compressed(encoding);
198            self
199        }
200        /// Enable decompressing responses.
201        #[must_use]
202        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
203            self.inner = self.inner.accept_compressed(encoding);
204            self
205        }
206        /// Limits the maximum size of a decoded message.
207        ///
208        /// Default: `4MB`
209        #[must_use]
210        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
211            self.inner = self.inner.max_decoding_message_size(limit);
212            self
213        }
214        /// Limits the maximum size of an encoded message.
215        ///
216        /// Default: `usize::MAX`
217        #[must_use]
218        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
219            self.inner = self.inner.max_encoding_message_size(limit);
220            self
221        }
222        pub async fn list_channels(
223            &mut self,
224            request: impl tonic::IntoRequest<super::ListChannelsRequest>,
225        ) -> std::result::Result<
226            tonic::Response<super::ListChannelsResponse>,
227            tonic::Status,
228        > {
229            self.inner
230                .ready()
231                .await
232                .map_err(|e| {
233                    tonic::Status::unknown(
234                        format!("Service was not ready: {}", e.into()),
235                    )
236                })?;
237            let codec = tonic::codec::ProstCodec::default();
238            let path = http::uri::PathAndQuery::from_static(
239                "/nominal.connections.v1.ConnectionsService/ListChannels",
240            );
241            let mut req = request.into_request();
242            req.extensions_mut()
243                .insert(
244                    GrpcMethod::new(
245                        "nominal.connections.v1.ConnectionsService",
246                        "ListChannels",
247                    ),
248                );
249            self.inner.unary(req, path, codec).await
250        }
251        pub async fn query_channel(
252            &mut self,
253            request: impl tonic::IntoRequest<super::QueryChannelRequest>,
254        ) -> std::result::Result<
255            tonic::Response<tonic::codec::Streaming<super::QueryChannelResponse>>,
256            tonic::Status,
257        > {
258            self.inner
259                .ready()
260                .await
261                .map_err(|e| {
262                    tonic::Status::unknown(
263                        format!("Service was not ready: {}", e.into()),
264                    )
265                })?;
266            let codec = tonic::codec::ProstCodec::default();
267            let path = http::uri::PathAndQuery::from_static(
268                "/nominal.connections.v1.ConnectionsService/QueryChannel",
269            );
270            let mut req = request.into_request();
271            req.extensions_mut()
272                .insert(
273                    GrpcMethod::new(
274                        "nominal.connections.v1.ConnectionsService",
275                        "QueryChannel",
276                    ),
277                );
278            self.inner.server_streaming(req, path, codec).await
279        }
280    }
281}