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