Skip to main content

nominal_api_proto/proto/
nominal.internalseriescache.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Chunk {
4    #[prost(string, tag = "1")]
5    pub rid: ::prost::alloc::string::String,
6    #[prost(enumeration = "ChunkType", tag = "2")]
7    pub r#type: i32,
8    #[prost(string, tag = "3")]
9    pub logical_series_rid: ::prost::alloc::string::String,
10    #[prost(message, optional, tag = "4")]
11    pub start_time: ::core::option::Option<
12        super::super::super::google::protobuf::Timestamp,
13    >,
14    #[prost(message, optional, tag = "5")]
15    pub end_time: ::core::option::Option<
16        super::super::super::google::protobuf::Timestamp,
17    >,
18    #[prost(int64, tag = "6")]
19    pub count: i64,
20    #[prost(int64, tag = "7")]
21    pub size_in_bytes: i64,
22    #[prost(int64, tag = "8")]
23    pub resolution_nanos: i64,
24    #[prost(message, optional, tag = "9")]
25    pub storage: ::core::option::Option<ChunkStorage>,
26}
27#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct ChunkStorage {
29    #[prost(oneof = "chunk_storage::Storage", tags = "1")]
30    pub storage: ::core::option::Option<chunk_storage::Storage>,
31}
32/// Nested message and enum types in `ChunkStorage`.
33pub mod chunk_storage {
34    #[derive(Clone, PartialEq, ::prost::Oneof)]
35    pub enum Storage {
36        #[prost(message, tag = "1")]
37        S3(super::S3ChunkStorage),
38    }
39}
40#[derive(Clone, PartialEq, ::prost::Message)]
41pub struct S3ChunkStorage {
42    #[prost(string, tag = "1")]
43    pub path: ::prost::alloc::string::String,
44}
45#[derive(Clone, PartialEq, ::prost::Message)]
46pub struct SearchChunksRequest {
47    #[prost(string, tag = "1")]
48    pub logical_series_rid: ::prost::alloc::string::String,
49    #[prost(message, optional, tag = "2")]
50    pub start_time: ::core::option::Option<
51        super::super::super::google::protobuf::Timestamp,
52    >,
53    #[prost(message, optional, tag = "3")]
54    pub end_time: ::core::option::Option<
55        super::super::super::google::protobuf::Timestamp,
56    >,
57    #[prost(int64, tag = "4")]
58    pub resolution_nanos: i64,
59    #[prost(int32, optional, tag = "5")]
60    pub page_size: ::core::option::Option<i32>,
61    #[prost(string, tag = "6")]
62    pub page_token: ::prost::alloc::string::String,
63}
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct SearchChunksResponse {
66    #[prost(message, repeated, tag = "1")]
67    pub chunks: ::prost::alloc::vec::Vec<Chunk>,
68    #[prost(string, tag = "2")]
69    pub next_page_token: ::prost::alloc::string::String,
70}
71#[derive(Clone, PartialEq, ::prost::Message)]
72pub struct CreateChunkRequest {
73    #[prost(enumeration = "ChunkType", tag = "1")]
74    pub r#type: i32,
75    #[prost(string, tag = "2")]
76    pub logical_series_rid: ::prost::alloc::string::String,
77    #[prost(message, optional, tag = "3")]
78    pub start_time: ::core::option::Option<
79        super::super::super::google::protobuf::Timestamp,
80    >,
81    #[prost(message, optional, tag = "4")]
82    pub end_time: ::core::option::Option<
83        super::super::super::google::protobuf::Timestamp,
84    >,
85    #[prost(int64, tag = "5")]
86    pub count: i64,
87    #[prost(int64, tag = "6")]
88    pub size_in_bytes: i64,
89    #[prost(int64, tag = "7")]
90    pub resolution_nanos: i64,
91    #[prost(message, optional, tag = "8")]
92    pub storage: ::core::option::Option<ChunkStorage>,
93}
94#[derive(Clone, PartialEq, ::prost::Message)]
95pub struct BatchCreateChunksRequest {
96    #[prost(message, repeated, tag = "1")]
97    pub requests: ::prost::alloc::vec::Vec<CreateChunkRequest>,
98}
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct BatchCreateChunksResponse {
101    #[prost(string, repeated, tag = "1")]
102    pub chunk_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
103}
104#[derive(Clone, PartialEq, ::prost::Message)]
105pub struct DeleteChunksRequest {
106    #[prost(string, tag = "1")]
107    pub logical_series_rid: ::prost::alloc::string::String,
108    #[prost(message, optional, tag = "2")]
109    pub start_time: ::core::option::Option<
110        super::super::super::google::protobuf::Timestamp,
111    >,
112    #[prost(message, optional, tag = "3")]
113    pub end_time: ::core::option::Option<
114        super::super::super::google::protobuf::Timestamp,
115    >,
116}
117#[derive(Clone, Copy, PartialEq, ::prost::Message)]
118pub struct DeleteChunksResponse {
119    #[prost(int64, tag = "1")]
120    pub deleted_chunk_count: i64,
121}
122#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
123#[repr(i32)]
124pub enum ChunkType {
125    Unspecified = 0,
126    ArrowWithRelativeTimestamps = 1,
127    ArrowWithAbsoluteTimestamps = 2,
128}
129impl ChunkType {
130    /// String value of the enum field names used in the ProtoBuf definition.
131    ///
132    /// The values are not transformed in any way and thus are considered stable
133    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
134    pub fn as_str_name(&self) -> &'static str {
135        match self {
136            Self::Unspecified => "CHUNK_TYPE_UNSPECIFIED",
137            Self::ArrowWithRelativeTimestamps => {
138                "CHUNK_TYPE_ARROW_WITH_RELATIVE_TIMESTAMPS"
139            }
140            Self::ArrowWithAbsoluteTimestamps => {
141                "CHUNK_TYPE_ARROW_WITH_ABSOLUTE_TIMESTAMPS"
142            }
143        }
144    }
145    /// Creates an enum from field names used in the ProtoBuf definition.
146    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
147        match value {
148            "CHUNK_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
149            "CHUNK_TYPE_ARROW_WITH_RELATIVE_TIMESTAMPS" => {
150                Some(Self::ArrowWithRelativeTimestamps)
151            }
152            "CHUNK_TYPE_ARROW_WITH_ABSOLUTE_TIMESTAMPS" => {
153                Some(Self::ArrowWithAbsoluteTimestamps)
154            }
155            _ => None,
156        }
157    }
158}
159#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
160#[repr(i32)]
161pub enum InternalSeriesCacheError {
162    InvalidRequest = 0,
163}
164impl InternalSeriesCacheError {
165    /// String value of the enum field names used in the ProtoBuf definition.
166    ///
167    /// The values are not transformed in any way and thus are considered stable
168    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
169    pub fn as_str_name(&self) -> &'static str {
170        match self {
171            Self::InvalidRequest => "INTERNAL_SERIES_CACHE_ERROR_INVALID_REQUEST",
172        }
173    }
174    /// Creates an enum from field names used in the ProtoBuf definition.
175    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
176        match value {
177            "INTERNAL_SERIES_CACHE_ERROR_INVALID_REQUEST" => Some(Self::InvalidRequest),
178            _ => None,
179        }
180    }
181}
182/// Generated client implementations.
183pub mod internal_series_cache_service_client {
184    #![allow(
185        unused_variables,
186        dead_code,
187        missing_docs,
188        clippy::wildcard_imports,
189        clippy::let_unit_value,
190    )]
191    use tonic::codegen::*;
192    use tonic::codegen::http::Uri;
193    #[derive(Debug, Clone)]
194    pub struct InternalSeriesCacheServiceClient<T> {
195        inner: tonic::client::Grpc<T>,
196    }
197    impl InternalSeriesCacheServiceClient<tonic::transport::Channel> {
198        /// Attempt to create a new client by connecting to a given endpoint.
199        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
200        where
201            D: TryInto<tonic::transport::Endpoint>,
202            D::Error: Into<StdError>,
203        {
204            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
205            Ok(Self::new(conn))
206        }
207    }
208    impl<T> InternalSeriesCacheServiceClient<T>
209    where
210        T: tonic::client::GrpcService<tonic::body::Body>,
211        T::Error: Into<StdError>,
212        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
213        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
214    {
215        pub fn new(inner: T) -> Self {
216            let inner = tonic::client::Grpc::new(inner);
217            Self { inner }
218        }
219        pub fn with_origin(inner: T, origin: Uri) -> Self {
220            let inner = tonic::client::Grpc::with_origin(inner, origin);
221            Self { inner }
222        }
223        pub fn with_interceptor<F>(
224            inner: T,
225            interceptor: F,
226        ) -> InternalSeriesCacheServiceClient<InterceptedService<T, F>>
227        where
228            F: tonic::service::Interceptor,
229            T::ResponseBody: Default,
230            T: tonic::codegen::Service<
231                http::Request<tonic::body::Body>,
232                Response = http::Response<
233                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
234                >,
235            >,
236            <T as tonic::codegen::Service<
237                http::Request<tonic::body::Body>,
238            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
239        {
240            InternalSeriesCacheServiceClient::new(
241                InterceptedService::new(inner, interceptor),
242            )
243        }
244        /// Compress requests with the given encoding.
245        ///
246        /// This requires the server to support it otherwise it might respond with an
247        /// error.
248        #[must_use]
249        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
250            self.inner = self.inner.send_compressed(encoding);
251            self
252        }
253        /// Enable decompressing responses.
254        #[must_use]
255        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
256            self.inner = self.inner.accept_compressed(encoding);
257            self
258        }
259        /// Limits the maximum size of a decoded message.
260        ///
261        /// Default: `4MB`
262        #[must_use]
263        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
264            self.inner = self.inner.max_decoding_message_size(limit);
265            self
266        }
267        /// Limits the maximum size of an encoded message.
268        ///
269        /// Default: `usize::MAX`
270        #[must_use]
271        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
272            self.inner = self.inner.max_encoding_message_size(limit);
273            self
274        }
275        pub async fn search_chunks(
276            &mut self,
277            request: impl tonic::IntoRequest<super::SearchChunksRequest>,
278        ) -> std::result::Result<
279            tonic::Response<super::SearchChunksResponse>,
280            tonic::Status,
281        > {
282            self.inner
283                .ready()
284                .await
285                .map_err(|e| {
286                    tonic::Status::unknown(
287                        format!("Service was not ready: {}", e.into()),
288                    )
289                })?;
290            let codec = tonic::codec::ProstCodec::default();
291            let path = http::uri::PathAndQuery::from_static(
292                "/nominal.internalseriescache.v1.InternalSeriesCacheService/SearchChunks",
293            );
294            let mut req = request.into_request();
295            req.extensions_mut()
296                .insert(
297                    GrpcMethod::new(
298                        "nominal.internalseriescache.v1.InternalSeriesCacheService",
299                        "SearchChunks",
300                    ),
301                );
302            self.inner.unary(req, path, codec).await
303        }
304        pub async fn batch_create_chunks(
305            &mut self,
306            request: impl tonic::IntoRequest<super::BatchCreateChunksRequest>,
307        ) -> std::result::Result<
308            tonic::Response<super::BatchCreateChunksResponse>,
309            tonic::Status,
310        > {
311            self.inner
312                .ready()
313                .await
314                .map_err(|e| {
315                    tonic::Status::unknown(
316                        format!("Service was not ready: {}", e.into()),
317                    )
318                })?;
319            let codec = tonic::codec::ProstCodec::default();
320            let path = http::uri::PathAndQuery::from_static(
321                "/nominal.internalseriescache.v1.InternalSeriesCacheService/BatchCreateChunks",
322            );
323            let mut req = request.into_request();
324            req.extensions_mut()
325                .insert(
326                    GrpcMethod::new(
327                        "nominal.internalseriescache.v1.InternalSeriesCacheService",
328                        "BatchCreateChunks",
329                    ),
330                );
331            self.inner.unary(req, path, codec).await
332        }
333        pub async fn delete_chunks(
334            &mut self,
335            request: impl tonic::IntoRequest<super::DeleteChunksRequest>,
336        ) -> std::result::Result<
337            tonic::Response<super::DeleteChunksResponse>,
338            tonic::Status,
339        > {
340            self.inner
341                .ready()
342                .await
343                .map_err(|e| {
344                    tonic::Status::unknown(
345                        format!("Service was not ready: {}", e.into()),
346                    )
347                })?;
348            let codec = tonic::codec::ProstCodec::default();
349            let path = http::uri::PathAndQuery::from_static(
350                "/nominal.internalseriescache.v1.InternalSeriesCacheService/DeleteChunks",
351            );
352            let mut req = request.into_request();
353            req.extensions_mut()
354                .insert(
355                    GrpcMethod::new(
356                        "nominal.internalseriescache.v1.InternalSeriesCacheService",
357                        "DeleteChunks",
358                    ),
359                );
360            self.inner.unary(req, path, codec).await
361        }
362    }
363}