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