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