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