1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
7pub struct Timestamp {
8 #[prost(int64, tag = "1")]
9 pub seconds: i64,
10 #[prost(int64, tag = "2")]
11 pub nanos: i64,
12 #[prost(int32, tag = "3")]
13 pub picos: i32,
14}
15#[derive(Clone, Copy, PartialEq, ::prost::Message)]
16pub struct Range {
17 #[prost(message, optional, tag = "1")]
18 pub start_time_inclusive: ::core::option::Option<Timestamp>,
19 #[prost(message, optional, tag = "2")]
20 pub end_time_exclusive: ::core::option::Option<Timestamp>,
21}
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct TagValues {
24 #[prost(string, repeated, tag = "1")]
27 pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
28}
29#[derive(Clone, PartialEq, ::prost::Message)]
30pub struct ChannelMetadata {
31 #[prost(string, tag = "1")]
33 pub channel: ::prost::alloc::string::String,
34 #[prost(enumeration = "DataType", tag = "2")]
36 pub data_type: i32,
37 #[prost(map = "string, message", tag = "3")]
39 pub all_tag_values: ::std::collections::HashMap<
40 ::prost::alloc::string::String,
41 TagValues,
42 >,
43}
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct ListChannelsRequest {
46 #[prost(int32, tag = "1")]
48 pub page_size: i32,
49 #[prost(message, optional, tag = "2")]
51 pub range: ::core::option::Option<Range>,
52 #[prost(string, optional, tag = "3")]
54 pub page_token: ::core::option::Option<::prost::alloc::string::String>,
55}
56#[derive(Clone, PartialEq, ::prost::Message)]
57pub struct ListChannelsResponse {
58 #[prost(message, repeated, tag = "1")]
59 pub channels: ::prost::alloc::vec::Vec<ChannelMetadata>,
60 #[prost(string, optional, tag = "2")]
61 pub page_token: ::core::option::Option<::prost::alloc::string::String>,
62}
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct QueryChannelRequest {
65 #[prost(string, tag = "1")]
67 pub channel: ::prost::alloc::string::String,
68 #[prost(map = "string, string", tag = "2")]
70 pub tags: ::std::collections::HashMap<
71 ::prost::alloc::string::String,
72 ::prost::alloc::string::String,
73 >,
74 #[prost(message, optional, tag = "3")]
76 pub range: ::core::option::Option<Range>,
77}
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct IntPoints {
80 #[prost(message, repeated, tag = "1")]
81 pub timestamps: ::prost::alloc::vec::Vec<Timestamp>,
82 #[prost(int64, repeated, tag = "2")]
83 pub values: ::prost::alloc::vec::Vec<i64>,
84}
85#[derive(Clone, PartialEq, ::prost::Message)]
86pub struct DoublePoints {
87 #[prost(message, repeated, tag = "1")]
88 pub timestamps: ::prost::alloc::vec::Vec<Timestamp>,
89 #[prost(double, repeated, tag = "2")]
90 pub values: ::prost::alloc::vec::Vec<f64>,
91}
92#[derive(Clone, PartialEq, ::prost::Message)]
93pub struct StringPoints {
94 #[prost(message, repeated, tag = "1")]
95 pub timestamps: ::prost::alloc::vec::Vec<Timestamp>,
96 #[prost(string, repeated, tag = "2")]
97 pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
98}
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct QueryChannelResponse {
101 #[prost(oneof = "query_channel_response::Values", tags = "1, 2, 3")]
102 pub values: ::core::option::Option<query_channel_response::Values>,
103}
104pub mod query_channel_response {
106 #[derive(Clone, PartialEq, ::prost::Oneof)]
107 pub enum Values {
108 #[prost(message, tag = "1")]
109 Ints(super::IntPoints),
110 #[prost(message, tag = "2")]
111 Doubles(super::DoublePoints),
112 #[prost(message, tag = "3")]
113 Strings(super::StringPoints),
114 }
115}
116#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
117#[repr(i32)]
118pub enum DataType {
119 Unspecified = 0,
120 Int = 1,
121 Double = 2,
122 String = 3,
123}
124impl DataType {
125 pub fn as_str_name(&self) -> &'static str {
130 match self {
131 Self::Unspecified => "DATA_TYPE_UNSPECIFIED",
132 Self::Int => "DATA_TYPE_INT",
133 Self::Double => "DATA_TYPE_DOUBLE",
134 Self::String => "DATA_TYPE_STRING",
135 }
136 }
137 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
139 match value {
140 "DATA_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
141 "DATA_TYPE_INT" => Some(Self::Int),
142 "DATA_TYPE_DOUBLE" => Some(Self::Double),
143 "DATA_TYPE_STRING" => Some(Self::String),
144 _ => None,
145 }
146 }
147}
148pub mod connections_service_client {
150 #![allow(
151 unused_variables,
152 dead_code,
153 missing_docs,
154 clippy::wildcard_imports,
155 clippy::let_unit_value,
156 )]
157 use tonic::codegen::*;
158 use tonic::codegen::http::Uri;
159 #[derive(Debug, Clone)]
167 pub struct ConnectionsServiceClient<T> {
168 inner: tonic::client::Grpc<T>,
169 }
170 impl ConnectionsServiceClient<tonic::transport::Channel> {
171 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
173 where
174 D: TryInto<tonic::transport::Endpoint>,
175 D::Error: Into<StdError>,
176 {
177 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
178 Ok(Self::new(conn))
179 }
180 }
181 impl<T> ConnectionsServiceClient<T>
182 where
183 T: tonic::client::GrpcService<tonic::body::Body>,
184 T::Error: Into<StdError>,
185 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
186 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
187 {
188 pub fn new(inner: T) -> Self {
189 let inner = tonic::client::Grpc::new(inner);
190 Self { inner }
191 }
192 pub fn with_origin(inner: T, origin: Uri) -> Self {
193 let inner = tonic::client::Grpc::with_origin(inner, origin);
194 Self { inner }
195 }
196 pub fn with_interceptor<F>(
197 inner: T,
198 interceptor: F,
199 ) -> ConnectionsServiceClient<InterceptedService<T, F>>
200 where
201 F: tonic::service::Interceptor,
202 T::ResponseBody: Default,
203 T: tonic::codegen::Service<
204 http::Request<tonic::body::Body>,
205 Response = http::Response<
206 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
207 >,
208 >,
209 <T as tonic::codegen::Service<
210 http::Request<tonic::body::Body>,
211 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
212 {
213 ConnectionsServiceClient::new(InterceptedService::new(inner, interceptor))
214 }
215 #[must_use]
220 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
221 self.inner = self.inner.send_compressed(encoding);
222 self
223 }
224 #[must_use]
226 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
227 self.inner = self.inner.accept_compressed(encoding);
228 self
229 }
230 #[must_use]
234 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
235 self.inner = self.inner.max_decoding_message_size(limit);
236 self
237 }
238 #[must_use]
242 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
243 self.inner = self.inner.max_encoding_message_size(limit);
244 self
245 }
246 pub async fn list_channels(
251 &mut self,
252 request: impl tonic::IntoRequest<super::ListChannelsRequest>,
253 ) -> std::result::Result<
254 tonic::Response<super::ListChannelsResponse>,
255 tonic::Status,
256 > {
257 self.inner
258 .ready()
259 .await
260 .map_err(|e| {
261 tonic::Status::unknown(
262 format!("Service was not ready: {}", e.into()),
263 )
264 })?;
265 let codec = tonic::codec::ProstCodec::default();
266 let path = http::uri::PathAndQuery::from_static(
267 "/nominal.connections.v1.ConnectionsService/ListChannels",
268 );
269 let mut req = request.into_request();
270 req.extensions_mut()
271 .insert(
272 GrpcMethod::new(
273 "nominal.connections.v1.ConnectionsService",
274 "ListChannels",
275 ),
276 );
277 self.inner.unary(req, path, codec).await
278 }
279 pub async fn query_channel(
283 &mut self,
284 request: impl tonic::IntoRequest<super::QueryChannelRequest>,
285 ) -> std::result::Result<
286 tonic::Response<tonic::codec::Streaming<super::QueryChannelResponse>>,
287 tonic::Status,
288 > {
289 self.inner
290 .ready()
291 .await
292 .map_err(|e| {
293 tonic::Status::unknown(
294 format!("Service was not ready: {}", e.into()),
295 )
296 })?;
297 let codec = tonic::codec::ProstCodec::default();
298 let path = http::uri::PathAndQuery::from_static(
299 "/nominal.connections.v1.ConnectionsService/QueryChannel",
300 );
301 let mut req = request.into_request();
302 req.extensions_mut()
303 .insert(
304 GrpcMethod::new(
305 "nominal.connections.v1.ConnectionsService",
306 "QueryChannel",
307 ),
308 );
309 self.inner.server_streaming(req, path, codec).await
310 }
311 }
312}