gimpey_db_gateway/generated/
account.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct Account {
4    #[prost(string, tag = "1")]
5    pub id: ::prost::alloc::string::String,
6    #[prost(uint64, tag = "2")]
7    pub external_id: u64,
8    #[prost(string, tag = "3")]
9    pub email: ::prost::alloc::string::String,
10    #[prost(string, tag = "4")]
11    pub username: ::prost::alloc::string::String,
12    #[prost(string, tag = "5")]
13    pub password: ::prost::alloc::string::String,
14    #[prost(uint64, tag = "6")]
15    pub created_at: u64,
16    #[prost(string, optional, tag = "7")]
17    pub password_reset_token: ::core::option::Option<::prost::alloc::string::String>,
18    #[prost(bool, tag = "8")]
19    pub is_email_verified: bool,
20    #[prost(string, optional, tag = "9")]
21    pub referral_code: ::core::option::Option<::prost::alloc::string::String>,
22    #[prost(string, optional, tag = "10")]
23    pub beta_code: ::core::option::Option<::prost::alloc::string::String>,
24    #[prost(uint64, tag = "11")]
25    pub totp_nonce: u64,
26    #[prost(uint64, tag = "12")]
27    pub permissions: u64,
28    #[prost(uint64, tag = "13")]
29    pub profile_assets_nonces: u64,
30}
31#[derive(Clone, PartialEq, ::prost::Message)]
32pub struct PublicAccount {
33    #[prost(string, tag = "1")]
34    pub id: ::prost::alloc::string::String,
35    #[prost(string, tag = "2")]
36    pub email: ::prost::alloc::string::String,
37    #[prost(string, tag = "3")]
38    pub username: ::prost::alloc::string::String,
39    #[prost(uint64, tag = "4")]
40    pub created_at: u64,
41    #[prost(uint64, tag = "5")]
42    pub permissions: u64,
43}
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct GetAccountsRequest {
46    #[prost(uint32, optional, tag = "1")]
47    pub limit: ::core::option::Option<u32>,
48    #[prost(string, optional, tag = "2")]
49    pub cursor: ::core::option::Option<::prost::alloc::string::String>,
50    #[prost(enumeration = "AccountsSortBy", optional, tag = "3")]
51    pub sort_by: ::core::option::Option<i32>,
52    #[prost(string, optional, tag = "4")]
53    pub order: ::core::option::Option<::prost::alloc::string::String>,
54    #[prost(string, optional, tag = "5")]
55    pub search: ::core::option::Option<::prost::alloc::string::String>,
56}
57#[derive(Clone, PartialEq, ::prost::Message)]
58pub struct GetAccountsResponse {
59    #[prost(message, repeated, tag = "1")]
60    pub accounts: ::prost::alloc::vec::Vec<PublicAccount>,
61    #[prost(message, optional, tag = "2")]
62    pub pagination: ::core::option::Option<super::pagination::Pagination>,
63}
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct CreateAccountRequest {
66    #[prost(string, tag = "1")]
67    pub email: ::prost::alloc::string::String,
68    #[prost(string, tag = "2")]
69    pub username: ::prost::alloc::string::String,
70    #[prost(string, tag = "3")]
71    pub password: ::prost::alloc::string::String,
72    #[prost(string, optional, tag = "4")]
73    pub beta_code: ::core::option::Option<::prost::alloc::string::String>,
74    #[prost(string, optional, tag = "5")]
75    pub referral_code: ::core::option::Option<::prost::alloc::string::String>,
76}
77#[derive(Clone, PartialEq, ::prost::Message)]
78pub struct CreateAccountResponse {
79    #[prost(message, optional, tag = "1")]
80    pub account: ::core::option::Option<PublicAccount>,
81}
82#[derive(Clone, PartialEq, ::prost::Message)]
83pub struct GetAccountRequest {
84    #[prost(string, tag = "1")]
85    pub identifier: ::prost::alloc::string::String,
86}
87#[derive(Clone, PartialEq, ::prost::Message)]
88pub struct GetAccountResponse {
89    #[prost(message, optional, tag = "1")]
90    pub account: ::core::option::Option<Account>,
91}
92#[derive(Clone, PartialEq, ::prost::Message)]
93pub struct DeleteAccountRequest {
94    #[prost(string, tag = "1")]
95    pub id: ::prost::alloc::string::String,
96    #[prost(string, tag = "2")]
97    pub email: ::prost::alloc::string::String,
98    #[prost(string, tag = "3")]
99    pub username: ::prost::alloc::string::String,
100}
101#[derive(Clone, Copy, PartialEq, ::prost::Message)]
102pub struct DeleteAccountResponse {
103    #[prost(bool, tag = "1")]
104    pub success: bool,
105}
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct UpdateAccountRequest {
108    #[prost(string, tag = "1")]
109    pub id: ::prost::alloc::string::String,
110    #[prost(string, tag = "2")]
111    pub email: ::prost::alloc::string::String,
112    #[prost(string, tag = "3")]
113    pub username: ::prost::alloc::string::String,
114    #[prost(string, tag = "4")]
115    pub password: ::prost::alloc::string::String,
116}
117#[derive(Clone, PartialEq, ::prost::Message)]
118pub struct UpdateAccountResponse {
119    #[prost(message, optional, tag = "1")]
120    pub account: ::core::option::Option<PublicAccount>,
121}
122#[derive(Clone, PartialEq, ::prost::Message)]
123pub struct GetAccountWithFamiliesRequest {
124    #[prost(string, tag = "1")]
125    pub account_id: ::prost::alloc::string::String,
126}
127#[derive(Clone, PartialEq, ::prost::Message)]
128pub struct GetAccountWithFamiliesResponse {
129    #[prost(message, optional, tag = "1")]
130    pub account: ::core::option::Option<Account>,
131    #[prost(message, repeated, tag = "2")]
132    pub families: ::prost::alloc::vec::Vec<super::family::Family>,
133}
134#[derive(Clone, PartialEq, ::prost::Message)]
135pub struct IncrementNonceRequest {
136    #[prost(string, tag = "1")]
137    pub id: ::prost::alloc::string::String,
138}
139#[derive(Clone, Copy, PartialEq, ::prost::Message)]
140pub struct IncrementNonceResponse {
141    #[prost(uint64, tag = "1")]
142    pub nonce: u64,
143}
144#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
145#[repr(i32)]
146pub enum AccountsSortBy {
147    CreatedAt = 0,
148}
149impl AccountsSortBy {
150    /// String value of the enum field names used in the ProtoBuf definition.
151    ///
152    /// The values are not transformed in any way and thus are considered stable
153    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
154    pub fn as_str_name(&self) -> &'static str {
155        match self {
156            Self::CreatedAt => "CREATED_AT",
157        }
158    }
159    /// Creates an enum from field names used in the ProtoBuf definition.
160    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
161        match value {
162            "CREATED_AT" => Some(Self::CreatedAt),
163            _ => None,
164        }
165    }
166}
167/// Generated client implementations.
168pub mod account_service_client {
169    #![allow(
170        unused_variables,
171        dead_code,
172        missing_docs,
173        clippy::wildcard_imports,
174        clippy::let_unit_value,
175    )]
176    use tonic::codegen::*;
177    use tonic::codegen::http::Uri;
178    #[derive(Debug, Clone)]
179    pub struct AccountServiceClient<T> {
180        inner: tonic::client::Grpc<T>,
181    }
182    impl AccountServiceClient<tonic::transport::Channel> {
183        /// Attempt to create a new client by connecting to a given endpoint.
184        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
185        where
186            D: TryInto<tonic::transport::Endpoint>,
187            D::Error: Into<StdError>,
188        {
189            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
190            Ok(Self::new(conn))
191        }
192    }
193    impl<T> AccountServiceClient<T>
194    where
195        T: tonic::client::GrpcService<tonic::body::Body>,
196        T::Error: Into<StdError>,
197        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
198        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
199    {
200        pub fn new(inner: T) -> Self {
201            let inner = tonic::client::Grpc::new(inner);
202            Self { inner }
203        }
204        pub fn with_origin(inner: T, origin: Uri) -> Self {
205            let inner = tonic::client::Grpc::with_origin(inner, origin);
206            Self { inner }
207        }
208        pub fn with_interceptor<F>(
209            inner: T,
210            interceptor: F,
211        ) -> AccountServiceClient<InterceptedService<T, F>>
212        where
213            F: tonic::service::Interceptor,
214            T::ResponseBody: Default,
215            T: tonic::codegen::Service<
216                http::Request<tonic::body::Body>,
217                Response = http::Response<
218                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
219                >,
220            >,
221            <T as tonic::codegen::Service<
222                http::Request<tonic::body::Body>,
223            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
224        {
225            AccountServiceClient::new(InterceptedService::new(inner, interceptor))
226        }
227        /// Compress requests with the given encoding.
228        ///
229        /// This requires the server to support it otherwise it might respond with an
230        /// error.
231        #[must_use]
232        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
233            self.inner = self.inner.send_compressed(encoding);
234            self
235        }
236        /// Enable decompressing responses.
237        #[must_use]
238        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
239            self.inner = self.inner.accept_compressed(encoding);
240            self
241        }
242        /// Limits the maximum size of a decoded message.
243        ///
244        /// Default: `4MB`
245        #[must_use]
246        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
247            self.inner = self.inner.max_decoding_message_size(limit);
248            self
249        }
250        /// Limits the maximum size of an encoded message.
251        ///
252        /// Default: `usize::MAX`
253        #[must_use]
254        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
255            self.inner = self.inner.max_encoding_message_size(limit);
256            self
257        }
258        /// `GET`
259        pub async fn get_account(
260            &mut self,
261            request: impl tonic::IntoRequest<super::GetAccountRequest>,
262        ) -> std::result::Result<
263            tonic::Response<super::GetAccountResponse>,
264            tonic::Status,
265        > {
266            self.inner
267                .ready()
268                .await
269                .map_err(|e| {
270                    tonic::Status::unknown(
271                        format!("Service was not ready: {}", e.into()),
272                    )
273                })?;
274            let codec = tonic::codec::ProstCodec::default();
275            let path = http::uri::PathAndQuery::from_static(
276                "/account.AccountService/GetAccount",
277            );
278            let mut req = request.into_request();
279            req.extensions_mut()
280                .insert(GrpcMethod::new("account.AccountService", "GetAccount"));
281            self.inner.unary(req, path, codec).await
282        }
283        pub async fn get_accounts(
284            &mut self,
285            request: impl tonic::IntoRequest<super::GetAccountsRequest>,
286        ) -> std::result::Result<
287            tonic::Response<super::GetAccountsResponse>,
288            tonic::Status,
289        > {
290            self.inner
291                .ready()
292                .await
293                .map_err(|e| {
294                    tonic::Status::unknown(
295                        format!("Service was not ready: {}", e.into()),
296                    )
297                })?;
298            let codec = tonic::codec::ProstCodec::default();
299            let path = http::uri::PathAndQuery::from_static(
300                "/account.AccountService/GetAccounts",
301            );
302            let mut req = request.into_request();
303            req.extensions_mut()
304                .insert(GrpcMethod::new("account.AccountService", "GetAccounts"));
305            self.inner.unary(req, path, codec).await
306        }
307        /// `PATCH`
308        pub async fn increment_avatar_nonce(
309            &mut self,
310            request: impl tonic::IntoRequest<super::IncrementNonceRequest>,
311        ) -> std::result::Result<
312            tonic::Response<super::IncrementNonceResponse>,
313            tonic::Status,
314        > {
315            self.inner
316                .ready()
317                .await
318                .map_err(|e| {
319                    tonic::Status::unknown(
320                        format!("Service was not ready: {}", e.into()),
321                    )
322                })?;
323            let codec = tonic::codec::ProstCodec::default();
324            let path = http::uri::PathAndQuery::from_static(
325                "/account.AccountService/IncrementAvatarNonce",
326            );
327            let mut req = request.into_request();
328            req.extensions_mut()
329                .insert(
330                    GrpcMethod::new("account.AccountService", "IncrementAvatarNonce"),
331                );
332            self.inner.unary(req, path, codec).await
333        }
334        pub async fn increment_banner_nonce(
335            &mut self,
336            request: impl tonic::IntoRequest<super::IncrementNonceRequest>,
337        ) -> std::result::Result<
338            tonic::Response<super::IncrementNonceResponse>,
339            tonic::Status,
340        > {
341            self.inner
342                .ready()
343                .await
344                .map_err(|e| {
345                    tonic::Status::unknown(
346                        format!("Service was not ready: {}", e.into()),
347                    )
348                })?;
349            let codec = tonic::codec::ProstCodec::default();
350            let path = http::uri::PathAndQuery::from_static(
351                "/account.AccountService/IncrementBannerNonce",
352            );
353            let mut req = request.into_request();
354            req.extensions_mut()
355                .insert(
356                    GrpcMethod::new("account.AccountService", "IncrementBannerNonce"),
357                );
358            self.inner.unary(req, path, codec).await
359        }
360        pub async fn increment_totp_nonce(
361            &mut self,
362            request: impl tonic::IntoRequest<super::IncrementNonceRequest>,
363        ) -> std::result::Result<
364            tonic::Response<super::IncrementNonceResponse>,
365            tonic::Status,
366        > {
367            self.inner
368                .ready()
369                .await
370                .map_err(|e| {
371                    tonic::Status::unknown(
372                        format!("Service was not ready: {}", e.into()),
373                    )
374                })?;
375            let codec = tonic::codec::ProstCodec::default();
376            let path = http::uri::PathAndQuery::from_static(
377                "/account.AccountService/IncrementTotpNonce",
378            );
379            let mut req = request.into_request();
380            req.extensions_mut()
381                .insert(GrpcMethod::new("account.AccountService", "IncrementTotpNonce"));
382            self.inner.unary(req, path, codec).await
383        }
384        pub async fn update_account(
385            &mut self,
386            request: impl tonic::IntoRequest<super::UpdateAccountRequest>,
387        ) -> std::result::Result<
388            tonic::Response<super::UpdateAccountResponse>,
389            tonic::Status,
390        > {
391            self.inner
392                .ready()
393                .await
394                .map_err(|e| {
395                    tonic::Status::unknown(
396                        format!("Service was not ready: {}", e.into()),
397                    )
398                })?;
399            let codec = tonic::codec::ProstCodec::default();
400            let path = http::uri::PathAndQuery::from_static(
401                "/account.AccountService/UpdateAccount",
402            );
403            let mut req = request.into_request();
404            req.extensions_mut()
405                .insert(GrpcMethod::new("account.AccountService", "UpdateAccount"));
406            self.inner.unary(req, path, codec).await
407        }
408        pub async fn create_account(
409            &mut self,
410            request: impl tonic::IntoRequest<super::CreateAccountRequest>,
411        ) -> std::result::Result<
412            tonic::Response<super::CreateAccountResponse>,
413            tonic::Status,
414        > {
415            self.inner
416                .ready()
417                .await
418                .map_err(|e| {
419                    tonic::Status::unknown(
420                        format!("Service was not ready: {}", e.into()),
421                    )
422                })?;
423            let codec = tonic::codec::ProstCodec::default();
424            let path = http::uri::PathAndQuery::from_static(
425                "/account.AccountService/CreateAccount",
426            );
427            let mut req = request.into_request();
428            req.extensions_mut()
429                .insert(GrpcMethod::new("account.AccountService", "CreateAccount"));
430            self.inner.unary(req, path, codec).await
431        }
432        pub async fn delete_account(
433            &mut self,
434            request: impl tonic::IntoRequest<super::DeleteAccountRequest>,
435        ) -> std::result::Result<
436            tonic::Response<super::DeleteAccountResponse>,
437            tonic::Status,
438        > {
439            self.inner
440                .ready()
441                .await
442                .map_err(|e| {
443                    tonic::Status::unknown(
444                        format!("Service was not ready: {}", e.into()),
445                    )
446                })?;
447            let codec = tonic::codec::ProstCodec::default();
448            let path = http::uri::PathAndQuery::from_static(
449                "/account.AccountService/DeleteAccount",
450            );
451            let mut req = request.into_request();
452            req.extensions_mut()
453                .insert(GrpcMethod::new("account.AccountService", "DeleteAccount"));
454            self.inner.unary(req, path, codec).await
455        }
456        pub async fn get_account_with_families(
457            &mut self,
458            request: impl tonic::IntoRequest<super::GetAccountWithFamiliesRequest>,
459        ) -> std::result::Result<
460            tonic::Response<super::GetAccountWithFamiliesResponse>,
461            tonic::Status,
462        > {
463            self.inner
464                .ready()
465                .await
466                .map_err(|e| {
467                    tonic::Status::unknown(
468                        format!("Service was not ready: {}", e.into()),
469                    )
470                })?;
471            let codec = tonic::codec::ProstCodec::default();
472            let path = http::uri::PathAndQuery::from_static(
473                "/account.AccountService/GetAccountWithFamilies",
474            );
475            let mut req = request.into_request();
476            req.extensions_mut()
477                .insert(
478                    GrpcMethod::new("account.AccountService", "GetAccountWithFamilies"),
479                );
480            self.inner.unary(req, path, codec).await
481        }
482    }
483}