nullnet_libdatastore/
datastore.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct GetByIdRequest {
4    #[prost(message, optional, tag = "1")]
5    pub params: ::core::option::Option<Params>,
6    #[prost(message, optional, tag = "2")]
7    pub query: ::core::option::Option<Query>,
8}
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct GetByFilterRequest {
11    #[prost(message, optional, tag = "1")]
12    pub body: ::core::option::Option<GetByFilterBody>,
13    #[prost(message, optional, tag = "2")]
14    pub params: ::core::option::Option<Params>,
15}
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct GetByFilterBody {
18    #[prost(string, repeated, tag = "1")]
19    pub pluck: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
20    #[prost(message, repeated, tag = "2")]
21    pub advance_filters: ::prost::alloc::vec::Vec<AdvanceFilter>,
22    #[prost(string, tag = "3")]
23    pub order_by: ::prost::alloc::string::String,
24    #[prost(int32, tag = "4")]
25    pub limit: i32,
26    #[prost(int32, tag = "5")]
27    pub offset: i32,
28    #[prost(string, tag = "6")]
29    pub order_direction: ::prost::alloc::string::String,
30    #[prost(message, repeated, tag = "7")]
31    pub joins: ::prost::alloc::vec::Vec<Join>,
32    #[prost(message, repeated, tag = "8")]
33    pub multiple_sort: ::prost::alloc::vec::Vec<MultipleSort>,
34    #[prost(map = "string, string", tag = "9")]
35    pub pluck_object: ::std::collections::HashMap<
36        ::prost::alloc::string::String,
37        ::prost::alloc::string::String,
38    >,
39    #[prost(string, tag = "10")]
40    pub date_format: ::prost::alloc::string::String,
41}
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct AdvanceFilter {
44    #[prost(string, tag = "1")]
45    pub r#type: ::prost::alloc::string::String,
46    #[prost(string, tag = "2")]
47    pub field: ::prost::alloc::string::String,
48    #[prost(string, tag = "3")]
49    pub operator: ::prost::alloc::string::String,
50    #[prost(string, tag = "4")]
51    pub entity: ::prost::alloc::string::String,
52    #[prost(string, tag = "5")]
53    pub values: ::prost::alloc::string::String,
54}
55#[derive(Clone, PartialEq, ::prost::Message)]
56pub struct Value {
57    #[prost(oneof = "value::Value", tags = "1, 2")]
58    pub value: ::core::option::Option<value::Value>,
59}
60/// Nested message and enum types in `Value`.
61pub mod value {
62    #[derive(Clone, PartialEq, ::prost::Oneof)]
63    pub enum Value {
64        #[prost(string, tag = "1")]
65        StringValue(::prost::alloc::string::String),
66        #[prost(int32, tag = "2")]
67        IntValue(i32),
68    }
69}
70#[derive(Clone, PartialEq, ::prost::Message)]
71pub struct MultipleSort {
72    #[prost(string, tag = "1")]
73    pub by_field: ::prost::alloc::string::String,
74    #[prost(string, tag = "2")]
75    pub by_direction: ::prost::alloc::string::String,
76}
77#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct Join {
79    #[prost(string, tag = "1")]
80    pub r#type: ::prost::alloc::string::String,
81    #[prost(message, optional, tag = "2")]
82    pub field_relation: ::core::option::Option<FieldRelation>,
83}
84#[derive(Clone, PartialEq, ::prost::Message)]
85pub struct FieldRelation {
86    #[prost(message, optional, tag = "1")]
87    pub to: ::core::option::Option<EntityFieldTo>,
88    #[prost(message, optional, tag = "2")]
89    pub from: ::core::option::Option<EntityFieldFrom>,
90}
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct EntityFieldTo {
93    #[prost(string, tag = "1")]
94    pub entity: ::prost::alloc::string::String,
95    #[prost(string, tag = "2")]
96    pub field: ::prost::alloc::string::String,
97    #[prost(string, tag = "3")]
98    pub alias: ::prost::alloc::string::String,
99    #[prost(int32, tag = "4")]
100    pub limit: i32,
101    #[prost(string, tag = "5")]
102    pub order_by: ::prost::alloc::string::String,
103    #[prost(message, repeated, tag = "6")]
104    pub filters: ::prost::alloc::vec::Vec<AdvanceFilter>,
105}
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct EntityFieldFrom {
108    #[prost(string, tag = "1")]
109    pub entity: ::prost::alloc::string::String,
110    #[prost(string, tag = "2")]
111    pub field: ::prost::alloc::string::String,
112}
113#[derive(Clone, PartialEq, ::prost::Message)]
114pub struct AggregateRequest {
115    #[prost(message, optional, tag = "1")]
116    pub body: ::core::option::Option<AggregateBody>,
117    #[prost(message, optional, tag = "2")]
118    pub params: ::core::option::Option<Params>,
119}
120#[derive(Clone, PartialEq, ::prost::Message)]
121pub struct AggregateBody {
122    #[prost(message, repeated, tag = "1")]
123    pub aggregations: ::prost::alloc::vec::Vec<Aggregation>,
124    #[prost(message, repeated, tag = "2")]
125    pub advance_filters: ::prost::alloc::vec::Vec<AdvanceFilter>,
126    #[prost(string, tag = "3")]
127    pub entity: ::prost::alloc::string::String,
128    #[prost(string, tag = "4")]
129    pub bucket_size: ::prost::alloc::string::String,
130    #[prost(message, optional, tag = "5")]
131    pub order: ::core::option::Option<Order>,
132    #[prost(message, repeated, tag = "6")]
133    pub joins: ::prost::alloc::vec::Vec<Join>,
134}
135#[derive(Clone, PartialEq, ::prost::Message)]
136pub struct Aggregation {
137    #[prost(string, tag = "1")]
138    pub aggregation: ::prost::alloc::string::String,
139    #[prost(string, tag = "2")]
140    pub aggregate_on: ::prost::alloc::string::String,
141    #[prost(string, tag = "3")]
142    pub bucket_name: ::prost::alloc::string::String,
143}
144#[derive(Clone, PartialEq, ::prost::Message)]
145pub struct Order {
146    #[prost(string, tag = "1")]
147    pub order_by: ::prost::alloc::string::String,
148    #[prost(string, tag = "2")]
149    pub order_direction: ::prost::alloc::string::String,
150}
151#[derive(Clone, PartialEq, ::prost::Message)]
152pub struct UpdateRequest {
153    #[prost(message, optional, tag = "1")]
154    pub params: ::core::option::Option<Params>,
155    #[prost(message, optional, tag = "2")]
156    pub query: ::core::option::Option<Query>,
157    #[prost(string, tag = "3")]
158    pub body: ::prost::alloc::string::String,
159}
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct DeleteRequest {
162    #[prost(message, optional, tag = "1")]
163    pub params: ::core::option::Option<Params>,
164    #[prost(message, optional, tag = "2")]
165    pub query: ::core::option::Option<DeleteQuery>,
166}
167#[derive(Clone, PartialEq, ::prost::Message)]
168pub struct DeleteQuery {
169    #[prost(string, tag = "1")]
170    pub is_permanent: ::prost::alloc::string::String,
171}
172#[derive(Clone, PartialEq, ::prost::Message)]
173pub struct CreateRequest {
174    #[prost(message, optional, tag = "1")]
175    pub params: ::core::option::Option<CreateParams>,
176    #[prost(message, optional, tag = "2")]
177    pub query: ::core::option::Option<Query>,
178    #[prost(string, tag = "3")]
179    pub body: ::prost::alloc::string::String,
180}
181/// BATCH CREATE
182#[derive(Clone, PartialEq, ::prost::Message)]
183pub struct BatchCreateRequest {
184    #[prost(message, optional, tag = "1")]
185    pub params: ::core::option::Option<CreateParams>,
186    #[prost(message, optional, tag = "2")]
187    pub query: ::core::option::Option<Query>,
188    #[prost(message, optional, tag = "3")]
189    pub body: ::core::option::Option<BatchCreateBody>,
190}
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct BatchCreateBody {
193    #[prost(string, tag = "1")]
194    pub records: ::prost::alloc::string::String,
195    #[prost(string, tag = "2")]
196    pub entity_prefix: ::prost::alloc::string::String,
197}
198/// BATCH UPDATE
199#[derive(Clone, PartialEq, ::prost::Message)]
200pub struct BatchUpdateRequest {
201    #[prost(message, optional, tag = "1")]
202    pub params: ::core::option::Option<Params>,
203    #[prost(message, optional, tag = "3")]
204    pub body: ::core::option::Option<BatchUpdateBody>,
205}
206#[derive(Clone, PartialEq, ::prost::Message)]
207pub struct BatchUpdateBody {
208    #[prost(message, repeated, tag = "1")]
209    pub advance_filters: ::prost::alloc::vec::Vec<AdvanceFilter>,
210    #[prost(string, tag = "2")]
211    pub updates: ::prost::alloc::string::String,
212}
213/// BATCH DELETE
214#[derive(Clone, PartialEq, ::prost::Message)]
215pub struct BatchDeleteRequest {
216    #[prost(message, optional, tag = "1")]
217    pub params: ::core::option::Option<Params>,
218    #[prost(message, optional, tag = "3")]
219    pub body: ::core::option::Option<BatchDeleteBody>,
220}
221#[derive(Clone, PartialEq, ::prost::Message)]
222pub struct BatchDeleteBody {
223    #[prost(message, repeated, tag = "1")]
224    pub advance_filters: ::prost::alloc::vec::Vec<AdvanceFilter>,
225}
226#[derive(Clone, PartialEq, ::prost::Message)]
227pub struct CreateParams {
228    #[prost(string, tag = "1")]
229    pub table: ::prost::alloc::string::String,
230}
231#[derive(Clone, PartialEq, ::prost::Message)]
232pub struct LoginRequest {
233    #[prost(message, optional, tag = "1")]
234    pub body: ::core::option::Option<LoginBody>,
235}
236#[derive(Clone, PartialEq, ::prost::Message)]
237pub struct LoginBody {
238    #[prost(message, optional, tag = "1")]
239    pub data: ::core::option::Option<LoginData>,
240}
241#[derive(Clone, PartialEq, ::prost::Message)]
242pub struct LoginData {
243    #[prost(string, tag = "1")]
244    pub account_id: ::prost::alloc::string::String,
245    #[prost(string, tag = "2")]
246    pub account_secret: ::prost::alloc::string::String,
247}
248#[derive(Clone, PartialEq, ::prost::Message)]
249pub struct Query {
250    #[prost(string, tag = "1")]
251    pub pluck: ::prost::alloc::string::String,
252    #[prost(string, tag = "2")]
253    pub durability: ::prost::alloc::string::String,
254}
255#[derive(Clone, PartialEq, ::prost::Message)]
256pub struct Params {
257    #[prost(string, tag = "1")]
258    pub id: ::prost::alloc::string::String,
259    #[prost(string, tag = "2")]
260    pub table: ::prost::alloc::string::String,
261}
262#[derive(Clone, PartialEq, ::prost::Message)]
263pub struct LoginResponse {
264    #[prost(string, tag = "1")]
265    pub token: ::prost::alloc::string::String,
266}
267#[derive(Clone, PartialEq, ::prost::Message)]
268pub struct Response {
269    #[prost(bool, tag = "1")]
270    pub success: bool,
271    #[prost(string, tag = "2")]
272    pub message: ::prost::alloc::string::String,
273    #[prost(string, tag = "3")]
274    pub error: ::prost::alloc::string::String,
275    #[prost(string, tag = "4")]
276    pub status_code: ::prost::alloc::string::String,
277    #[prost(int32, tag = "5")]
278    pub count: i32,
279    #[prost(string, tag = "6")]
280    pub encoding: ::prost::alloc::string::String,
281    #[prost(string, tag = "7")]
282    pub data: ::prost::alloc::string::String,
283}
284/// Generated client implementations.
285pub mod store_service_client {
286    #![allow(
287        unused_variables,
288        dead_code,
289        missing_docs,
290        clippy::wildcard_imports,
291        clippy::let_unit_value,
292    )]
293    use tonic::codegen::*;
294    use tonic::codegen::http::Uri;
295    #[derive(Debug, Clone)]
296    pub struct StoreServiceClient<T> {
297        inner: tonic::client::Grpc<T>,
298    }
299    impl StoreServiceClient<tonic::transport::Channel> {
300        /// Attempt to create a new client by connecting to a given endpoint.
301        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
302        where
303            D: TryInto<tonic::transport::Endpoint>,
304            D::Error: Into<StdError>,
305        {
306            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
307            Ok(Self::new(conn))
308        }
309    }
310    impl<T> StoreServiceClient<T>
311    where
312        T: tonic::client::GrpcService<tonic::body::BoxBody>,
313        T::Error: Into<StdError>,
314        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
315        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
316    {
317        pub fn new(inner: T) -> Self {
318            let inner = tonic::client::Grpc::new(inner);
319            Self { inner }
320        }
321        pub fn with_origin(inner: T, origin: Uri) -> Self {
322            let inner = tonic::client::Grpc::with_origin(inner, origin);
323            Self { inner }
324        }
325        pub fn with_interceptor<F>(
326            inner: T,
327            interceptor: F,
328        ) -> StoreServiceClient<InterceptedService<T, F>>
329        where
330            F: tonic::service::Interceptor,
331            T::ResponseBody: Default,
332            T: tonic::codegen::Service<
333                http::Request<tonic::body::BoxBody>,
334                Response = http::Response<
335                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
336                >,
337            >,
338            <T as tonic::codegen::Service<
339                http::Request<tonic::body::BoxBody>,
340            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
341        {
342            StoreServiceClient::new(InterceptedService::new(inner, interceptor))
343        }
344        /// Compress requests with the given encoding.
345        ///
346        /// This requires the server to support it otherwise it might respond with an
347        /// error.
348        #[must_use]
349        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
350            self.inner = self.inner.send_compressed(encoding);
351            self
352        }
353        /// Enable decompressing responses.
354        #[must_use]
355        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
356            self.inner = self.inner.accept_compressed(encoding);
357            self
358        }
359        /// Limits the maximum size of a decoded message.
360        ///
361        /// Default: `4MB`
362        #[must_use]
363        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
364            self.inner = self.inner.max_decoding_message_size(limit);
365            self
366        }
367        /// Limits the maximum size of an encoded message.
368        ///
369        /// Default: `usize::MAX`
370        #[must_use]
371        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
372            self.inner = self.inner.max_encoding_message_size(limit);
373            self
374        }
375        pub async fn get_by_id(
376            &mut self,
377            request: impl tonic::IntoRequest<super::GetByIdRequest>,
378        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
379            self.inner
380                .ready()
381                .await
382                .map_err(|e| {
383                    tonic::Status::unknown(
384                        format!("Service was not ready: {}", e.into()),
385                    )
386                })?;
387            let codec = tonic::codec::ProstCodec::default();
388            let path = http::uri::PathAndQuery::from_static(
389                "/datastore.StoreService/GetById",
390            );
391            let mut req = request.into_request();
392            req.extensions_mut()
393                .insert(GrpcMethod::new("datastore.StoreService", "GetById"));
394            self.inner.unary(req, path, codec).await
395        }
396        pub async fn aggregate(
397            &mut self,
398            request: impl tonic::IntoRequest<super::AggregateRequest>,
399        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
400            self.inner
401                .ready()
402                .await
403                .map_err(|e| {
404                    tonic::Status::unknown(
405                        format!("Service was not ready: {}", e.into()),
406                    )
407                })?;
408            let codec = tonic::codec::ProstCodec::default();
409            let path = http::uri::PathAndQuery::from_static(
410                "/datastore.StoreService/Aggregate",
411            );
412            let mut req = request.into_request();
413            req.extensions_mut()
414                .insert(GrpcMethod::new("datastore.StoreService", "Aggregate"));
415            self.inner.unary(req, path, codec).await
416        }
417        pub async fn get_by_filter(
418            &mut self,
419            request: impl tonic::IntoRequest<super::GetByFilterRequest>,
420        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
421            self.inner
422                .ready()
423                .await
424                .map_err(|e| {
425                    tonic::Status::unknown(
426                        format!("Service was not ready: {}", e.into()),
427                    )
428                })?;
429            let codec = tonic::codec::ProstCodec::default();
430            let path = http::uri::PathAndQuery::from_static(
431                "/datastore.StoreService/GetByFilter",
432            );
433            let mut req = request.into_request();
434            req.extensions_mut()
435                .insert(GrpcMethod::new("datastore.StoreService", "GetByFilter"));
436            self.inner.unary(req, path, codec).await
437        }
438        pub async fn update(
439            &mut self,
440            request: impl tonic::IntoRequest<super::UpdateRequest>,
441        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
442            self.inner
443                .ready()
444                .await
445                .map_err(|e| {
446                    tonic::Status::unknown(
447                        format!("Service was not ready: {}", e.into()),
448                    )
449                })?;
450            let codec = tonic::codec::ProstCodec::default();
451            let path = http::uri::PathAndQuery::from_static(
452                "/datastore.StoreService/Update",
453            );
454            let mut req = request.into_request();
455            req.extensions_mut()
456                .insert(GrpcMethod::new("datastore.StoreService", "Update"));
457            self.inner.unary(req, path, codec).await
458        }
459        pub async fn delete(
460            &mut self,
461            request: impl tonic::IntoRequest<super::DeleteRequest>,
462        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
463            self.inner
464                .ready()
465                .await
466                .map_err(|e| {
467                    tonic::Status::unknown(
468                        format!("Service was not ready: {}", e.into()),
469                    )
470                })?;
471            let codec = tonic::codec::ProstCodec::default();
472            let path = http::uri::PathAndQuery::from_static(
473                "/datastore.StoreService/Delete",
474            );
475            let mut req = request.into_request();
476            req.extensions_mut()
477                .insert(GrpcMethod::new("datastore.StoreService", "Delete"));
478            self.inner.unary(req, path, codec).await
479        }
480        pub async fn create(
481            &mut self,
482            request: impl tonic::IntoRequest<super::CreateRequest>,
483        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
484            self.inner
485                .ready()
486                .await
487                .map_err(|e| {
488                    tonic::Status::unknown(
489                        format!("Service was not ready: {}", e.into()),
490                    )
491                })?;
492            let codec = tonic::codec::ProstCodec::default();
493            let path = http::uri::PathAndQuery::from_static(
494                "/datastore.StoreService/Create",
495            );
496            let mut req = request.into_request();
497            req.extensions_mut()
498                .insert(GrpcMethod::new("datastore.StoreService", "Create"));
499            self.inner.unary(req, path, codec).await
500        }
501        pub async fn batch_create(
502            &mut self,
503            request: impl tonic::IntoRequest<super::BatchCreateRequest>,
504        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
505            self.inner
506                .ready()
507                .await
508                .map_err(|e| {
509                    tonic::Status::unknown(
510                        format!("Service was not ready: {}", e.into()),
511                    )
512                })?;
513            let codec = tonic::codec::ProstCodec::default();
514            let path = http::uri::PathAndQuery::from_static(
515                "/datastore.StoreService/BatchCreate",
516            );
517            let mut req = request.into_request();
518            req.extensions_mut()
519                .insert(GrpcMethod::new("datastore.StoreService", "BatchCreate"));
520            self.inner.unary(req, path, codec).await
521        }
522        pub async fn batch_update(
523            &mut self,
524            request: impl tonic::IntoRequest<super::BatchUpdateRequest>,
525        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
526            self.inner
527                .ready()
528                .await
529                .map_err(|e| {
530                    tonic::Status::unknown(
531                        format!("Service was not ready: {}", e.into()),
532                    )
533                })?;
534            let codec = tonic::codec::ProstCodec::default();
535            let path = http::uri::PathAndQuery::from_static(
536                "/datastore.StoreService/BatchUpdate",
537            );
538            let mut req = request.into_request();
539            req.extensions_mut()
540                .insert(GrpcMethod::new("datastore.StoreService", "BatchUpdate"));
541            self.inner.unary(req, path, codec).await
542        }
543        pub async fn batch_delete(
544            &mut self,
545            request: impl tonic::IntoRequest<super::BatchDeleteRequest>,
546        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status> {
547            self.inner
548                .ready()
549                .await
550                .map_err(|e| {
551                    tonic::Status::unknown(
552                        format!("Service was not ready: {}", e.into()),
553                    )
554                })?;
555            let codec = tonic::codec::ProstCodec::default();
556            let path = http::uri::PathAndQuery::from_static(
557                "/datastore.StoreService/BatchDelete",
558            );
559            let mut req = request.into_request();
560            req.extensions_mut()
561                .insert(GrpcMethod::new("datastore.StoreService", "BatchDelete"));
562            self.inner.unary(req, path, codec).await
563        }
564        pub async fn login(
565            &mut self,
566            request: impl tonic::IntoRequest<super::LoginRequest>,
567        ) -> std::result::Result<tonic::Response<super::LoginResponse>, tonic::Status> {
568            self.inner
569                .ready()
570                .await
571                .map_err(|e| {
572                    tonic::Status::unknown(
573                        format!("Service was not ready: {}", e.into()),
574                    )
575                })?;
576            let codec = tonic::codec::ProstCodec::default();
577            let path = http::uri::PathAndQuery::from_static(
578                "/datastore.StoreService/Login",
579            );
580            let mut req = request.into_request();
581            req.extensions_mut()
582                .insert(GrpcMethod::new("datastore.StoreService", "Login"));
583            self.inner.unary(req, path, codec).await
584        }
585    }
586}
587/// Generated server implementations.
588pub mod store_service_server {
589    #![allow(
590        unused_variables,
591        dead_code,
592        missing_docs,
593        clippy::wildcard_imports,
594        clippy::let_unit_value,
595    )]
596    use tonic::codegen::*;
597    /// Generated trait containing gRPC methods that should be implemented for use with StoreServiceServer.
598    #[async_trait]
599    pub trait StoreService: std::marker::Send + std::marker::Sync + 'static {
600        async fn get_by_id(
601            &self,
602            request: tonic::Request<super::GetByIdRequest>,
603        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
604        async fn aggregate(
605            &self,
606            request: tonic::Request<super::AggregateRequest>,
607        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
608        async fn get_by_filter(
609            &self,
610            request: tonic::Request<super::GetByFilterRequest>,
611        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
612        async fn update(
613            &self,
614            request: tonic::Request<super::UpdateRequest>,
615        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
616        async fn delete(
617            &self,
618            request: tonic::Request<super::DeleteRequest>,
619        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
620        async fn create(
621            &self,
622            request: tonic::Request<super::CreateRequest>,
623        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
624        async fn batch_create(
625            &self,
626            request: tonic::Request<super::BatchCreateRequest>,
627        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
628        async fn batch_update(
629            &self,
630            request: tonic::Request<super::BatchUpdateRequest>,
631        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
632        async fn batch_delete(
633            &self,
634            request: tonic::Request<super::BatchDeleteRequest>,
635        ) -> std::result::Result<tonic::Response<super::Response>, tonic::Status>;
636        async fn login(
637            &self,
638            request: tonic::Request<super::LoginRequest>,
639        ) -> std::result::Result<tonic::Response<super::LoginResponse>, tonic::Status>;
640    }
641    #[derive(Debug)]
642    pub struct StoreServiceServer<T> {
643        inner: Arc<T>,
644        accept_compression_encodings: EnabledCompressionEncodings,
645        send_compression_encodings: EnabledCompressionEncodings,
646        max_decoding_message_size: Option<usize>,
647        max_encoding_message_size: Option<usize>,
648    }
649    impl<T> StoreServiceServer<T> {
650        pub fn new(inner: T) -> Self {
651            Self::from_arc(Arc::new(inner))
652        }
653        pub fn from_arc(inner: Arc<T>) -> Self {
654            Self {
655                inner,
656                accept_compression_encodings: Default::default(),
657                send_compression_encodings: Default::default(),
658                max_decoding_message_size: None,
659                max_encoding_message_size: None,
660            }
661        }
662        pub fn with_interceptor<F>(
663            inner: T,
664            interceptor: F,
665        ) -> InterceptedService<Self, F>
666        where
667            F: tonic::service::Interceptor,
668        {
669            InterceptedService::new(Self::new(inner), interceptor)
670        }
671        /// Enable decompressing requests with the given encoding.
672        #[must_use]
673        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
674            self.accept_compression_encodings.enable(encoding);
675            self
676        }
677        /// Compress responses with the given encoding, if the client supports it.
678        #[must_use]
679        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
680            self.send_compression_encodings.enable(encoding);
681            self
682        }
683        /// Limits the maximum size of a decoded message.
684        ///
685        /// Default: `4MB`
686        #[must_use]
687        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
688            self.max_decoding_message_size = Some(limit);
689            self
690        }
691        /// Limits the maximum size of an encoded message.
692        ///
693        /// Default: `usize::MAX`
694        #[must_use]
695        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
696            self.max_encoding_message_size = Some(limit);
697            self
698        }
699    }
700    impl<T, B> tonic::codegen::Service<http::Request<B>> for StoreServiceServer<T>
701    where
702        T: StoreService,
703        B: Body + std::marker::Send + 'static,
704        B::Error: Into<StdError> + std::marker::Send + 'static,
705    {
706        type Response = http::Response<tonic::body::BoxBody>;
707        type Error = std::convert::Infallible;
708        type Future = BoxFuture<Self::Response, Self::Error>;
709        fn poll_ready(
710            &mut self,
711            _cx: &mut Context<'_>,
712        ) -> Poll<std::result::Result<(), Self::Error>> {
713            Poll::Ready(Ok(()))
714        }
715        fn call(&mut self, req: http::Request<B>) -> Self::Future {
716            match req.uri().path() {
717                "/datastore.StoreService/GetById" => {
718                    #[allow(non_camel_case_types)]
719                    struct GetByIdSvc<T: StoreService>(pub Arc<T>);
720                    impl<
721                        T: StoreService,
722                    > tonic::server::UnaryService<super::GetByIdRequest>
723                    for GetByIdSvc<T> {
724                        type Response = super::Response;
725                        type Future = BoxFuture<
726                            tonic::Response<Self::Response>,
727                            tonic::Status,
728                        >;
729                        fn call(
730                            &mut self,
731                            request: tonic::Request<super::GetByIdRequest>,
732                        ) -> Self::Future {
733                            let inner = Arc::clone(&self.0);
734                            let fut = async move {
735                                <T as StoreService>::get_by_id(&inner, request).await
736                            };
737                            Box::pin(fut)
738                        }
739                    }
740                    let accept_compression_encodings = self.accept_compression_encodings;
741                    let send_compression_encodings = self.send_compression_encodings;
742                    let max_decoding_message_size = self.max_decoding_message_size;
743                    let max_encoding_message_size = self.max_encoding_message_size;
744                    let inner = self.inner.clone();
745                    let fut = async move {
746                        let method = GetByIdSvc(inner);
747                        let codec = tonic::codec::ProstCodec::default();
748                        let mut grpc = tonic::server::Grpc::new(codec)
749                            .apply_compression_config(
750                                accept_compression_encodings,
751                                send_compression_encodings,
752                            )
753                            .apply_max_message_size_config(
754                                max_decoding_message_size,
755                                max_encoding_message_size,
756                            );
757                        let res = grpc.unary(method, req).await;
758                        Ok(res)
759                    };
760                    Box::pin(fut)
761                }
762                "/datastore.StoreService/Aggregate" => {
763                    #[allow(non_camel_case_types)]
764                    struct AggregateSvc<T: StoreService>(pub Arc<T>);
765                    impl<
766                        T: StoreService,
767                    > tonic::server::UnaryService<super::AggregateRequest>
768                    for AggregateSvc<T> {
769                        type Response = super::Response;
770                        type Future = BoxFuture<
771                            tonic::Response<Self::Response>,
772                            tonic::Status,
773                        >;
774                        fn call(
775                            &mut self,
776                            request: tonic::Request<super::AggregateRequest>,
777                        ) -> Self::Future {
778                            let inner = Arc::clone(&self.0);
779                            let fut = async move {
780                                <T as StoreService>::aggregate(&inner, request).await
781                            };
782                            Box::pin(fut)
783                        }
784                    }
785                    let accept_compression_encodings = self.accept_compression_encodings;
786                    let send_compression_encodings = self.send_compression_encodings;
787                    let max_decoding_message_size = self.max_decoding_message_size;
788                    let max_encoding_message_size = self.max_encoding_message_size;
789                    let inner = self.inner.clone();
790                    let fut = async move {
791                        let method = AggregateSvc(inner);
792                        let codec = tonic::codec::ProstCodec::default();
793                        let mut grpc = tonic::server::Grpc::new(codec)
794                            .apply_compression_config(
795                                accept_compression_encodings,
796                                send_compression_encodings,
797                            )
798                            .apply_max_message_size_config(
799                                max_decoding_message_size,
800                                max_encoding_message_size,
801                            );
802                        let res = grpc.unary(method, req).await;
803                        Ok(res)
804                    };
805                    Box::pin(fut)
806                }
807                "/datastore.StoreService/GetByFilter" => {
808                    #[allow(non_camel_case_types)]
809                    struct GetByFilterSvc<T: StoreService>(pub Arc<T>);
810                    impl<
811                        T: StoreService,
812                    > tonic::server::UnaryService<super::GetByFilterRequest>
813                    for GetByFilterSvc<T> {
814                        type Response = super::Response;
815                        type Future = BoxFuture<
816                            tonic::Response<Self::Response>,
817                            tonic::Status,
818                        >;
819                        fn call(
820                            &mut self,
821                            request: tonic::Request<super::GetByFilterRequest>,
822                        ) -> Self::Future {
823                            let inner = Arc::clone(&self.0);
824                            let fut = async move {
825                                <T as StoreService>::get_by_filter(&inner, request).await
826                            };
827                            Box::pin(fut)
828                        }
829                    }
830                    let accept_compression_encodings = self.accept_compression_encodings;
831                    let send_compression_encodings = self.send_compression_encodings;
832                    let max_decoding_message_size = self.max_decoding_message_size;
833                    let max_encoding_message_size = self.max_encoding_message_size;
834                    let inner = self.inner.clone();
835                    let fut = async move {
836                        let method = GetByFilterSvc(inner);
837                        let codec = tonic::codec::ProstCodec::default();
838                        let mut grpc = tonic::server::Grpc::new(codec)
839                            .apply_compression_config(
840                                accept_compression_encodings,
841                                send_compression_encodings,
842                            )
843                            .apply_max_message_size_config(
844                                max_decoding_message_size,
845                                max_encoding_message_size,
846                            );
847                        let res = grpc.unary(method, req).await;
848                        Ok(res)
849                    };
850                    Box::pin(fut)
851                }
852                "/datastore.StoreService/Update" => {
853                    #[allow(non_camel_case_types)]
854                    struct UpdateSvc<T: StoreService>(pub Arc<T>);
855                    impl<
856                        T: StoreService,
857                    > tonic::server::UnaryService<super::UpdateRequest>
858                    for UpdateSvc<T> {
859                        type Response = super::Response;
860                        type Future = BoxFuture<
861                            tonic::Response<Self::Response>,
862                            tonic::Status,
863                        >;
864                        fn call(
865                            &mut self,
866                            request: tonic::Request<super::UpdateRequest>,
867                        ) -> Self::Future {
868                            let inner = Arc::clone(&self.0);
869                            let fut = async move {
870                                <T as StoreService>::update(&inner, request).await
871                            };
872                            Box::pin(fut)
873                        }
874                    }
875                    let accept_compression_encodings = self.accept_compression_encodings;
876                    let send_compression_encodings = self.send_compression_encodings;
877                    let max_decoding_message_size = self.max_decoding_message_size;
878                    let max_encoding_message_size = self.max_encoding_message_size;
879                    let inner = self.inner.clone();
880                    let fut = async move {
881                        let method = UpdateSvc(inner);
882                        let codec = tonic::codec::ProstCodec::default();
883                        let mut grpc = tonic::server::Grpc::new(codec)
884                            .apply_compression_config(
885                                accept_compression_encodings,
886                                send_compression_encodings,
887                            )
888                            .apply_max_message_size_config(
889                                max_decoding_message_size,
890                                max_encoding_message_size,
891                            );
892                        let res = grpc.unary(method, req).await;
893                        Ok(res)
894                    };
895                    Box::pin(fut)
896                }
897                "/datastore.StoreService/Delete" => {
898                    #[allow(non_camel_case_types)]
899                    struct DeleteSvc<T: StoreService>(pub Arc<T>);
900                    impl<
901                        T: StoreService,
902                    > tonic::server::UnaryService<super::DeleteRequest>
903                    for DeleteSvc<T> {
904                        type Response = super::Response;
905                        type Future = BoxFuture<
906                            tonic::Response<Self::Response>,
907                            tonic::Status,
908                        >;
909                        fn call(
910                            &mut self,
911                            request: tonic::Request<super::DeleteRequest>,
912                        ) -> Self::Future {
913                            let inner = Arc::clone(&self.0);
914                            let fut = async move {
915                                <T as StoreService>::delete(&inner, request).await
916                            };
917                            Box::pin(fut)
918                        }
919                    }
920                    let accept_compression_encodings = self.accept_compression_encodings;
921                    let send_compression_encodings = self.send_compression_encodings;
922                    let max_decoding_message_size = self.max_decoding_message_size;
923                    let max_encoding_message_size = self.max_encoding_message_size;
924                    let inner = self.inner.clone();
925                    let fut = async move {
926                        let method = DeleteSvc(inner);
927                        let codec = tonic::codec::ProstCodec::default();
928                        let mut grpc = tonic::server::Grpc::new(codec)
929                            .apply_compression_config(
930                                accept_compression_encodings,
931                                send_compression_encodings,
932                            )
933                            .apply_max_message_size_config(
934                                max_decoding_message_size,
935                                max_encoding_message_size,
936                            );
937                        let res = grpc.unary(method, req).await;
938                        Ok(res)
939                    };
940                    Box::pin(fut)
941                }
942                "/datastore.StoreService/Create" => {
943                    #[allow(non_camel_case_types)]
944                    struct CreateSvc<T: StoreService>(pub Arc<T>);
945                    impl<
946                        T: StoreService,
947                    > tonic::server::UnaryService<super::CreateRequest>
948                    for CreateSvc<T> {
949                        type Response = super::Response;
950                        type Future = BoxFuture<
951                            tonic::Response<Self::Response>,
952                            tonic::Status,
953                        >;
954                        fn call(
955                            &mut self,
956                            request: tonic::Request<super::CreateRequest>,
957                        ) -> Self::Future {
958                            let inner = Arc::clone(&self.0);
959                            let fut = async move {
960                                <T as StoreService>::create(&inner, request).await
961                            };
962                            Box::pin(fut)
963                        }
964                    }
965                    let accept_compression_encodings = self.accept_compression_encodings;
966                    let send_compression_encodings = self.send_compression_encodings;
967                    let max_decoding_message_size = self.max_decoding_message_size;
968                    let max_encoding_message_size = self.max_encoding_message_size;
969                    let inner = self.inner.clone();
970                    let fut = async move {
971                        let method = CreateSvc(inner);
972                        let codec = tonic::codec::ProstCodec::default();
973                        let mut grpc = tonic::server::Grpc::new(codec)
974                            .apply_compression_config(
975                                accept_compression_encodings,
976                                send_compression_encodings,
977                            )
978                            .apply_max_message_size_config(
979                                max_decoding_message_size,
980                                max_encoding_message_size,
981                            );
982                        let res = grpc.unary(method, req).await;
983                        Ok(res)
984                    };
985                    Box::pin(fut)
986                }
987                "/datastore.StoreService/BatchCreate" => {
988                    #[allow(non_camel_case_types)]
989                    struct BatchCreateSvc<T: StoreService>(pub Arc<T>);
990                    impl<
991                        T: StoreService,
992                    > tonic::server::UnaryService<super::BatchCreateRequest>
993                    for BatchCreateSvc<T> {
994                        type Response = super::Response;
995                        type Future = BoxFuture<
996                            tonic::Response<Self::Response>,
997                            tonic::Status,
998                        >;
999                        fn call(
1000                            &mut self,
1001                            request: tonic::Request<super::BatchCreateRequest>,
1002                        ) -> Self::Future {
1003                            let inner = Arc::clone(&self.0);
1004                            let fut = async move {
1005                                <T as StoreService>::batch_create(&inner, request).await
1006                            };
1007                            Box::pin(fut)
1008                        }
1009                    }
1010                    let accept_compression_encodings = self.accept_compression_encodings;
1011                    let send_compression_encodings = self.send_compression_encodings;
1012                    let max_decoding_message_size = self.max_decoding_message_size;
1013                    let max_encoding_message_size = self.max_encoding_message_size;
1014                    let inner = self.inner.clone();
1015                    let fut = async move {
1016                        let method = BatchCreateSvc(inner);
1017                        let codec = tonic::codec::ProstCodec::default();
1018                        let mut grpc = tonic::server::Grpc::new(codec)
1019                            .apply_compression_config(
1020                                accept_compression_encodings,
1021                                send_compression_encodings,
1022                            )
1023                            .apply_max_message_size_config(
1024                                max_decoding_message_size,
1025                                max_encoding_message_size,
1026                            );
1027                        let res = grpc.unary(method, req).await;
1028                        Ok(res)
1029                    };
1030                    Box::pin(fut)
1031                }
1032                "/datastore.StoreService/BatchUpdate" => {
1033                    #[allow(non_camel_case_types)]
1034                    struct BatchUpdateSvc<T: StoreService>(pub Arc<T>);
1035                    impl<
1036                        T: StoreService,
1037                    > tonic::server::UnaryService<super::BatchUpdateRequest>
1038                    for BatchUpdateSvc<T> {
1039                        type Response = super::Response;
1040                        type Future = BoxFuture<
1041                            tonic::Response<Self::Response>,
1042                            tonic::Status,
1043                        >;
1044                        fn call(
1045                            &mut self,
1046                            request: tonic::Request<super::BatchUpdateRequest>,
1047                        ) -> Self::Future {
1048                            let inner = Arc::clone(&self.0);
1049                            let fut = async move {
1050                                <T as StoreService>::batch_update(&inner, request).await
1051                            };
1052                            Box::pin(fut)
1053                        }
1054                    }
1055                    let accept_compression_encodings = self.accept_compression_encodings;
1056                    let send_compression_encodings = self.send_compression_encodings;
1057                    let max_decoding_message_size = self.max_decoding_message_size;
1058                    let max_encoding_message_size = self.max_encoding_message_size;
1059                    let inner = self.inner.clone();
1060                    let fut = async move {
1061                        let method = BatchUpdateSvc(inner);
1062                        let codec = tonic::codec::ProstCodec::default();
1063                        let mut grpc = tonic::server::Grpc::new(codec)
1064                            .apply_compression_config(
1065                                accept_compression_encodings,
1066                                send_compression_encodings,
1067                            )
1068                            .apply_max_message_size_config(
1069                                max_decoding_message_size,
1070                                max_encoding_message_size,
1071                            );
1072                        let res = grpc.unary(method, req).await;
1073                        Ok(res)
1074                    };
1075                    Box::pin(fut)
1076                }
1077                "/datastore.StoreService/BatchDelete" => {
1078                    #[allow(non_camel_case_types)]
1079                    struct BatchDeleteSvc<T: StoreService>(pub Arc<T>);
1080                    impl<
1081                        T: StoreService,
1082                    > tonic::server::UnaryService<super::BatchDeleteRequest>
1083                    for BatchDeleteSvc<T> {
1084                        type Response = super::Response;
1085                        type Future = BoxFuture<
1086                            tonic::Response<Self::Response>,
1087                            tonic::Status,
1088                        >;
1089                        fn call(
1090                            &mut self,
1091                            request: tonic::Request<super::BatchDeleteRequest>,
1092                        ) -> Self::Future {
1093                            let inner = Arc::clone(&self.0);
1094                            let fut = async move {
1095                                <T as StoreService>::batch_delete(&inner, request).await
1096                            };
1097                            Box::pin(fut)
1098                        }
1099                    }
1100                    let accept_compression_encodings = self.accept_compression_encodings;
1101                    let send_compression_encodings = self.send_compression_encodings;
1102                    let max_decoding_message_size = self.max_decoding_message_size;
1103                    let max_encoding_message_size = self.max_encoding_message_size;
1104                    let inner = self.inner.clone();
1105                    let fut = async move {
1106                        let method = BatchDeleteSvc(inner);
1107                        let codec = tonic::codec::ProstCodec::default();
1108                        let mut grpc = tonic::server::Grpc::new(codec)
1109                            .apply_compression_config(
1110                                accept_compression_encodings,
1111                                send_compression_encodings,
1112                            )
1113                            .apply_max_message_size_config(
1114                                max_decoding_message_size,
1115                                max_encoding_message_size,
1116                            );
1117                        let res = grpc.unary(method, req).await;
1118                        Ok(res)
1119                    };
1120                    Box::pin(fut)
1121                }
1122                "/datastore.StoreService/Login" => {
1123                    #[allow(non_camel_case_types)]
1124                    struct LoginSvc<T: StoreService>(pub Arc<T>);
1125                    impl<
1126                        T: StoreService,
1127                    > tonic::server::UnaryService<super::LoginRequest> for LoginSvc<T> {
1128                        type Response = super::LoginResponse;
1129                        type Future = BoxFuture<
1130                            tonic::Response<Self::Response>,
1131                            tonic::Status,
1132                        >;
1133                        fn call(
1134                            &mut self,
1135                            request: tonic::Request<super::LoginRequest>,
1136                        ) -> Self::Future {
1137                            let inner = Arc::clone(&self.0);
1138                            let fut = async move {
1139                                <T as StoreService>::login(&inner, request).await
1140                            };
1141                            Box::pin(fut)
1142                        }
1143                    }
1144                    let accept_compression_encodings = self.accept_compression_encodings;
1145                    let send_compression_encodings = self.send_compression_encodings;
1146                    let max_decoding_message_size = self.max_decoding_message_size;
1147                    let max_encoding_message_size = self.max_encoding_message_size;
1148                    let inner = self.inner.clone();
1149                    let fut = async move {
1150                        let method = LoginSvc(inner);
1151                        let codec = tonic::codec::ProstCodec::default();
1152                        let mut grpc = tonic::server::Grpc::new(codec)
1153                            .apply_compression_config(
1154                                accept_compression_encodings,
1155                                send_compression_encodings,
1156                            )
1157                            .apply_max_message_size_config(
1158                                max_decoding_message_size,
1159                                max_encoding_message_size,
1160                            );
1161                        let res = grpc.unary(method, req).await;
1162                        Ok(res)
1163                    };
1164                    Box::pin(fut)
1165                }
1166                _ => {
1167                    Box::pin(async move {
1168                        let mut response = http::Response::new(empty_body());
1169                        let headers = response.headers_mut();
1170                        headers
1171                            .insert(
1172                                tonic::Status::GRPC_STATUS,
1173                                (tonic::Code::Unimplemented as i32).into(),
1174                            );
1175                        headers
1176                            .insert(
1177                                http::header::CONTENT_TYPE,
1178                                tonic::metadata::GRPC_CONTENT_TYPE,
1179                            );
1180                        Ok(response)
1181                    })
1182                }
1183            }
1184        }
1185    }
1186    impl<T> Clone for StoreServiceServer<T> {
1187        fn clone(&self) -> Self {
1188            let inner = self.inner.clone();
1189            Self {
1190                inner,
1191                accept_compression_encodings: self.accept_compression_encodings,
1192                send_compression_encodings: self.send_compression_encodings,
1193                max_decoding_message_size: self.max_decoding_message_size,
1194                max_encoding_message_size: self.max_encoding_message_size,
1195            }
1196        }
1197    }
1198    /// Generated gRPC service name
1199    pub const SERVICE_NAME: &str = "datastore.StoreService";
1200    impl<T> tonic::server::NamedService for StoreServiceServer<T> {
1201        const NAME: &'static str = SERVICE_NAME;
1202    }
1203}