nominal_api_proto/proto/
nominal.user_creation.v1.rs1#[derive(Clone, Copy, PartialEq, ::prost::Message)]
3pub struct EnsureDatabaseUserExistsRequest {}
4#[derive(Clone, Copy, PartialEq, ::prost::Message)]
5pub struct EnsureDatabaseUserExistsResponse {}
6pub mod internal_user_creation_service_client {
8 #![allow(
9 unused_variables,
10 dead_code,
11 missing_docs,
12 clippy::wildcard_imports,
13 clippy::let_unit_value,
14 )]
15 use tonic::codegen::*;
16 use tonic::codegen::http::Uri;
17 #[derive(Debug, Clone)]
18 pub struct InternalUserCreationServiceClient<T> {
19 inner: tonic::client::Grpc<T>,
20 }
21 impl InternalUserCreationServiceClient<tonic::transport::Channel> {
22 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
24 where
25 D: TryInto<tonic::transport::Endpoint>,
26 D::Error: Into<StdError>,
27 {
28 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
29 Ok(Self::new(conn))
30 }
31 }
32 impl<T> InternalUserCreationServiceClient<T>
33 where
34 T: tonic::client::GrpcService<tonic::body::Body>,
35 T::Error: Into<StdError>,
36 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
37 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
38 {
39 pub fn new(inner: T) -> Self {
40 let inner = tonic::client::Grpc::new(inner);
41 Self { inner }
42 }
43 pub fn with_origin(inner: T, origin: Uri) -> Self {
44 let inner = tonic::client::Grpc::with_origin(inner, origin);
45 Self { inner }
46 }
47 pub fn with_interceptor<F>(
48 inner: T,
49 interceptor: F,
50 ) -> InternalUserCreationServiceClient<InterceptedService<T, F>>
51 where
52 F: tonic::service::Interceptor,
53 T::ResponseBody: Default,
54 T: tonic::codegen::Service<
55 http::Request<tonic::body::Body>,
56 Response = http::Response<
57 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
58 >,
59 >,
60 <T as tonic::codegen::Service<
61 http::Request<tonic::body::Body>,
62 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
63 {
64 InternalUserCreationServiceClient::new(
65 InterceptedService::new(inner, interceptor),
66 )
67 }
68 #[must_use]
73 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
74 self.inner = self.inner.send_compressed(encoding);
75 self
76 }
77 #[must_use]
79 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
80 self.inner = self.inner.accept_compressed(encoding);
81 self
82 }
83 #[must_use]
87 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
88 self.inner = self.inner.max_decoding_message_size(limit);
89 self
90 }
91 #[must_use]
95 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
96 self.inner = self.inner.max_encoding_message_size(limit);
97 self
98 }
99 pub async fn ensure_database_user_exists(
100 &mut self,
101 request: impl tonic::IntoRequest<super::EnsureDatabaseUserExistsRequest>,
102 ) -> std::result::Result<
103 tonic::Response<super::EnsureDatabaseUserExistsResponse>,
104 tonic::Status,
105 > {
106 self.inner
107 .ready()
108 .await
109 .map_err(|e| {
110 tonic::Status::unknown(
111 format!("Service was not ready: {}", e.into()),
112 )
113 })?;
114 let codec = tonic::codec::ProstCodec::default();
115 let path = http::uri::PathAndQuery::from_static(
116 "/nominal.user_creation.v1.InternalUserCreationService/EnsureDatabaseUserExists",
117 );
118 let mut req = request.into_request();
119 req.extensions_mut()
120 .insert(
121 GrpcMethod::new(
122 "nominal.user_creation.v1.InternalUserCreationService",
123 "EnsureDatabaseUserExists",
124 ),
125 );
126 self.inner.unary(req, path, codec).await
127 }
128 }
129}