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