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