nominal_api_proto/proto/
nominal.authentication.temporary_credentials.v1.rs1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct CreateTemporaryCredentialsRequest {
4 #[prost(string, tag = "1")]
5 pub email: ::prost::alloc::string::String,
6}
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct CreateTemporaryCredentialsResponse {
9 #[prost(string, tag = "1")]
10 pub user_rid: ::prost::alloc::string::String,
11}
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
13#[repr(i32)]
14pub enum TemporaryCredentialsError {
15 Unspecified = 0,
16 TemporaryCredentialsUnavailable = 1,
17 GuestEmailNotAllowed = 2,
18}
19impl TemporaryCredentialsError {
20 pub fn as_str_name(&self) -> &'static str {
25 match self {
26 Self::Unspecified => "TEMPORARY_CREDENTIALS_ERROR_UNSPECIFIED",
27 Self::TemporaryCredentialsUnavailable => {
28 "TEMPORARY_CREDENTIALS_ERROR_TEMPORARY_CREDENTIALS_UNAVAILABLE"
29 }
30 Self::GuestEmailNotAllowed => {
31 "TEMPORARY_CREDENTIALS_ERROR_GUEST_EMAIL_NOT_ALLOWED"
32 }
33 }
34 }
35 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
37 match value {
38 "TEMPORARY_CREDENTIALS_ERROR_UNSPECIFIED" => Some(Self::Unspecified),
39 "TEMPORARY_CREDENTIALS_ERROR_TEMPORARY_CREDENTIALS_UNAVAILABLE" => {
40 Some(Self::TemporaryCredentialsUnavailable)
41 }
42 "TEMPORARY_CREDENTIALS_ERROR_GUEST_EMAIL_NOT_ALLOWED" => {
43 Some(Self::GuestEmailNotAllowed)
44 }
45 _ => None,
46 }
47 }
48}
49pub mod temporary_credentials_service_client {
51 #![allow(
52 unused_variables,
53 dead_code,
54 missing_docs,
55 clippy::wildcard_imports,
56 clippy::let_unit_value,
57 )]
58 use tonic::codegen::*;
59 use tonic::codegen::http::Uri;
60 #[derive(Debug, Clone)]
61 pub struct TemporaryCredentialsServiceClient<T> {
62 inner: tonic::client::Grpc<T>,
63 }
64 impl TemporaryCredentialsServiceClient<tonic::transport::Channel> {
65 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
67 where
68 D: TryInto<tonic::transport::Endpoint>,
69 D::Error: Into<StdError>,
70 {
71 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
72 Ok(Self::new(conn))
73 }
74 }
75 impl<T> TemporaryCredentialsServiceClient<T>
76 where
77 T: tonic::client::GrpcService<tonic::body::Body>,
78 T::Error: Into<StdError>,
79 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
80 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
81 {
82 pub fn new(inner: T) -> Self {
83 let inner = tonic::client::Grpc::new(inner);
84 Self { inner }
85 }
86 pub fn with_origin(inner: T, origin: Uri) -> Self {
87 let inner = tonic::client::Grpc::with_origin(inner, origin);
88 Self { inner }
89 }
90 pub fn with_interceptor<F>(
91 inner: T,
92 interceptor: F,
93 ) -> TemporaryCredentialsServiceClient<InterceptedService<T, F>>
94 where
95 F: tonic::service::Interceptor,
96 T::ResponseBody: Default,
97 T: tonic::codegen::Service<
98 http::Request<tonic::body::Body>,
99 Response = http::Response<
100 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
101 >,
102 >,
103 <T as tonic::codegen::Service<
104 http::Request<tonic::body::Body>,
105 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
106 {
107 TemporaryCredentialsServiceClient::new(
108 InterceptedService::new(inner, interceptor),
109 )
110 }
111 #[must_use]
116 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
117 self.inner = self.inner.send_compressed(encoding);
118 self
119 }
120 #[must_use]
122 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
123 self.inner = self.inner.accept_compressed(encoding);
124 self
125 }
126 #[must_use]
130 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
131 self.inner = self.inner.max_decoding_message_size(limit);
132 self
133 }
134 #[must_use]
138 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
139 self.inner = self.inner.max_encoding_message_size(limit);
140 self
141 }
142 pub async fn create_temporary_credentials(
143 &mut self,
144 request: impl tonic::IntoRequest<super::CreateTemporaryCredentialsRequest>,
145 ) -> std::result::Result<
146 tonic::Response<super::CreateTemporaryCredentialsResponse>,
147 tonic::Status,
148 > {
149 self.inner
150 .ready()
151 .await
152 .map_err(|e| {
153 tonic::Status::unknown(
154 format!("Service was not ready: {}", e.into()),
155 )
156 })?;
157 let codec = tonic::codec::ProstCodec::default();
158 let path = http::uri::PathAndQuery::from_static(
159 "/nominal.authentication.temporary_credentials.v1.TemporaryCredentialsService/CreateTemporaryCredentials",
160 );
161 let mut req = request.into_request();
162 req.extensions_mut()
163 .insert(
164 GrpcMethod::new(
165 "nominal.authentication.temporary_credentials.v1.TemporaryCredentialsService",
166 "CreateTemporaryCredentials",
167 ),
168 );
169 self.inner.unary(req, path, codec).await
170 }
171 }
172}