1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct GetAccessTokenFromApiKeyRequest {
4 #[prost(string, tag = "1")]
5 pub api_key_value: ::prost::alloc::string::String,
6}
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct GetAccessTokenFromApiKeyResponse {
9 #[prost(string, tag = "1")]
10 pub access_token: ::prost::alloc::string::String,
11 #[prost(int64, tag = "2")]
12 pub expires_at_seconds: i64,
13 #[prost(string, tag = "3")]
14 pub user_uuid: ::prost::alloc::string::String,
15 #[prost(string, tag = "4")]
16 pub org_uuid: ::prost::alloc::string::String,
17 #[prost(bool, tag = "5")]
18 pub is_guest: bool,
19}
20#[derive(Clone, PartialEq, ::prost::Message)]
21pub struct IssueSandboxTokenRequest {
22 #[prost(int64, optional, tag = "1")]
23 pub requested_ttl_seconds: ::core::option::Option<i64>,
24 #[prost(string, optional, tag = "2")]
25 pub shared_secret: ::core::option::Option<::prost::alloc::string::String>,
26 #[prost(enumeration = "SandboxWorkspace", tag = "3")]
27 pub sandbox_workspace: i32,
28}
29#[derive(Clone, PartialEq, ::prost::Message)]
30pub struct IssueSandboxTokenResponse {
31 #[prost(string, tag = "1")]
32 pub access_token: ::prost::alloc::string::String,
33 #[prost(int64, tag = "2")]
34 pub expires_at_seconds: i64,
35 #[prost(string, tag = "3")]
36 pub user_uuid: ::prost::alloc::string::String,
37 #[prost(string, tag = "4")]
38 pub org_uuid: ::prost::alloc::string::String,
39 #[prost(string, tag = "5")]
40 pub workspace_rid: ::prost::alloc::string::String,
41}
42#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
43#[repr(i32)]
44pub enum SandboxWorkspace {
45 Unspecified = 0,
46 Primary = 1,
47 Secondary = 2,
48}
49impl SandboxWorkspace {
50 pub fn as_str_name(&self) -> &'static str {
55 match self {
56 Self::Unspecified => "SANDBOX_WORKSPACE_UNSPECIFIED",
57 Self::Primary => "SANDBOX_WORKSPACE_PRIMARY",
58 Self::Secondary => "SANDBOX_WORKSPACE_SECONDARY",
59 }
60 }
61 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
63 match value {
64 "SANDBOX_WORKSPACE_UNSPECIFIED" => Some(Self::Unspecified),
65 "SANDBOX_WORKSPACE_PRIMARY" => Some(Self::Primary),
66 "SANDBOX_WORKSPACE_SECONDARY" => Some(Self::Secondary),
67 _ => None,
68 }
69 }
70}
71#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
72#[repr(i32)]
73pub enum InternalApiKeyError {
74 ApiKeyNotFound = 0,
75}
76impl InternalApiKeyError {
77 pub fn as_str_name(&self) -> &'static str {
82 match self {
83 Self::ApiKeyNotFound => "INTERNAL_API_KEY_ERROR_API_KEY_NOT_FOUND",
84 }
85 }
86 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
88 match value {
89 "INTERNAL_API_KEY_ERROR_API_KEY_NOT_FOUND" => Some(Self::ApiKeyNotFound),
90 _ => None,
91 }
92 }
93}
94#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
95#[repr(i32)]
96pub enum InternalSandboxTokenError {
97 SandboxTokenUnavailable = 0,
98}
99impl InternalSandboxTokenError {
100 pub fn as_str_name(&self) -> &'static str {
105 match self {
106 Self::SandboxTokenUnavailable => {
107 "INTERNAL_SANDBOX_TOKEN_ERROR_SANDBOX_TOKEN_UNAVAILABLE"
108 }
109 }
110 }
111 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
113 match value {
114 "INTERNAL_SANDBOX_TOKEN_ERROR_SANDBOX_TOKEN_UNAVAILABLE" => {
115 Some(Self::SandboxTokenUnavailable)
116 }
117 _ => None,
118 }
119 }
120}
121pub mod internal_api_key_service_client {
123 #![allow(
124 unused_variables,
125 dead_code,
126 missing_docs,
127 clippy::wildcard_imports,
128 clippy::let_unit_value,
129 )]
130 use tonic::codegen::*;
131 use tonic::codegen::http::Uri;
132 #[derive(Debug, Clone)]
133 pub struct InternalApiKeyServiceClient<T> {
134 inner: tonic::client::Grpc<T>,
135 }
136 impl InternalApiKeyServiceClient<tonic::transport::Channel> {
137 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
139 where
140 D: TryInto<tonic::transport::Endpoint>,
141 D::Error: Into<StdError>,
142 {
143 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
144 Ok(Self::new(conn))
145 }
146 }
147 impl<T> InternalApiKeyServiceClient<T>
148 where
149 T: tonic::client::GrpcService<tonic::body::Body>,
150 T::Error: Into<StdError>,
151 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
152 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
153 {
154 pub fn new(inner: T) -> Self {
155 let inner = tonic::client::Grpc::new(inner);
156 Self { inner }
157 }
158 pub fn with_origin(inner: T, origin: Uri) -> Self {
159 let inner = tonic::client::Grpc::with_origin(inner, origin);
160 Self { inner }
161 }
162 pub fn with_interceptor<F>(
163 inner: T,
164 interceptor: F,
165 ) -> InternalApiKeyServiceClient<InterceptedService<T, F>>
166 where
167 F: tonic::service::Interceptor,
168 T::ResponseBody: Default,
169 T: tonic::codegen::Service<
170 http::Request<tonic::body::Body>,
171 Response = http::Response<
172 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
173 >,
174 >,
175 <T as tonic::codegen::Service<
176 http::Request<tonic::body::Body>,
177 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
178 {
179 InternalApiKeyServiceClient::new(InterceptedService::new(inner, interceptor))
180 }
181 #[must_use]
186 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
187 self.inner = self.inner.send_compressed(encoding);
188 self
189 }
190 #[must_use]
192 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
193 self.inner = self.inner.accept_compressed(encoding);
194 self
195 }
196 #[must_use]
200 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
201 self.inner = self.inner.max_decoding_message_size(limit);
202 self
203 }
204 #[must_use]
208 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
209 self.inner = self.inner.max_encoding_message_size(limit);
210 self
211 }
212 pub async fn get_access_token_from_api_key_value(
213 &mut self,
214 request: impl tonic::IntoRequest<super::GetAccessTokenFromApiKeyRequest>,
215 ) -> std::result::Result<
216 tonic::Response<super::GetAccessTokenFromApiKeyResponse>,
217 tonic::Status,
218 > {
219 self.inner
220 .ready()
221 .await
222 .map_err(|e| {
223 tonic::Status::unknown(
224 format!("Service was not ready: {}", e.into()),
225 )
226 })?;
227 let codec = tonic::codec::ProstCodec::default();
228 let path = http::uri::PathAndQuery::from_static(
229 "/nominal.internalauthorization.v1.InternalApiKeyService/GetAccessTokenFromApiKeyValue",
230 );
231 let mut req = request.into_request();
232 req.extensions_mut()
233 .insert(
234 GrpcMethod::new(
235 "nominal.internalauthorization.v1.InternalApiKeyService",
236 "GetAccessTokenFromApiKeyValue",
237 ),
238 );
239 self.inner.unary(req, path, codec).await
240 }
241 }
242}
243pub mod internal_sandbox_token_service_client {
245 #![allow(
246 unused_variables,
247 dead_code,
248 missing_docs,
249 clippy::wildcard_imports,
250 clippy::let_unit_value,
251 )]
252 use tonic::codegen::*;
253 use tonic::codegen::http::Uri;
254 #[derive(Debug, Clone)]
255 pub struct InternalSandboxTokenServiceClient<T> {
256 inner: tonic::client::Grpc<T>,
257 }
258 impl InternalSandboxTokenServiceClient<tonic::transport::Channel> {
259 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
261 where
262 D: TryInto<tonic::transport::Endpoint>,
263 D::Error: Into<StdError>,
264 {
265 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
266 Ok(Self::new(conn))
267 }
268 }
269 impl<T> InternalSandboxTokenServiceClient<T>
270 where
271 T: tonic::client::GrpcService<tonic::body::Body>,
272 T::Error: Into<StdError>,
273 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
274 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
275 {
276 pub fn new(inner: T) -> Self {
277 let inner = tonic::client::Grpc::new(inner);
278 Self { inner }
279 }
280 pub fn with_origin(inner: T, origin: Uri) -> Self {
281 let inner = tonic::client::Grpc::with_origin(inner, origin);
282 Self { inner }
283 }
284 pub fn with_interceptor<F>(
285 inner: T,
286 interceptor: F,
287 ) -> InternalSandboxTokenServiceClient<InterceptedService<T, F>>
288 where
289 F: tonic::service::Interceptor,
290 T::ResponseBody: Default,
291 T: tonic::codegen::Service<
292 http::Request<tonic::body::Body>,
293 Response = http::Response<
294 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
295 >,
296 >,
297 <T as tonic::codegen::Service<
298 http::Request<tonic::body::Body>,
299 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
300 {
301 InternalSandboxTokenServiceClient::new(
302 InterceptedService::new(inner, interceptor),
303 )
304 }
305 #[must_use]
310 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
311 self.inner = self.inner.send_compressed(encoding);
312 self
313 }
314 #[must_use]
316 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
317 self.inner = self.inner.accept_compressed(encoding);
318 self
319 }
320 #[must_use]
324 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
325 self.inner = self.inner.max_decoding_message_size(limit);
326 self
327 }
328 #[must_use]
332 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
333 self.inner = self.inner.max_encoding_message_size(limit);
334 self
335 }
336 pub async fn issue_sandbox_token(
337 &mut self,
338 request: impl tonic::IntoRequest<super::IssueSandboxTokenRequest>,
339 ) -> std::result::Result<
340 tonic::Response<super::IssueSandboxTokenResponse>,
341 tonic::Status,
342 > {
343 self.inner
344 .ready()
345 .await
346 .map_err(|e| {
347 tonic::Status::unknown(
348 format!("Service was not ready: {}", e.into()),
349 )
350 })?;
351 let codec = tonic::codec::ProstCodec::default();
352 let path = http::uri::PathAndQuery::from_static(
353 "/nominal.internalauthorization.v1.InternalSandboxTokenService/IssueSandboxToken",
354 );
355 let mut req = request.into_request();
356 req.extensions_mut()
357 .insert(
358 GrpcMethod::new(
359 "nominal.internalauthorization.v1.InternalSandboxTokenService",
360 "IssueSandboxToken",
361 ),
362 );
363 self.inner.unary(req, path, codec).await
364 }
365 }
366}
367#[derive(Clone, Copy, PartialEq, ::prost::Message)]
368pub struct GetSystemWorkspaceRidRequest {}
369#[derive(Clone, PartialEq, ::prost::Message)]
370pub struct GetSystemWorkspaceRidResponse {
371 #[prost(string, optional, tag = "1")]
372 pub workspace_rid: ::core::option::Option<::prost::alloc::string::String>,
373 #[prost(string, optional, tag = "2")]
374 pub service_user_rid: ::core::option::Option<::prost::alloc::string::String>,
375 #[prost(string, optional, tag = "3")]
376 pub org_rid: ::core::option::Option<::prost::alloc::string::String>,
377}
378#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
379#[repr(i32)]
380pub enum InternalSystemWorkspaceError {
381 SystemWorkspaceUnavailable = 0,
382}
383impl InternalSystemWorkspaceError {
384 pub fn as_str_name(&self) -> &'static str {
389 match self {
390 Self::SystemWorkspaceUnavailable => {
391 "INTERNAL_SYSTEM_WORKSPACE_ERROR_SYSTEM_WORKSPACE_UNAVAILABLE"
392 }
393 }
394 }
395 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
397 match value {
398 "INTERNAL_SYSTEM_WORKSPACE_ERROR_SYSTEM_WORKSPACE_UNAVAILABLE" => {
399 Some(Self::SystemWorkspaceUnavailable)
400 }
401 _ => None,
402 }
403 }
404}
405pub mod internal_system_workspace_service_client {
407 #![allow(
408 unused_variables,
409 dead_code,
410 missing_docs,
411 clippy::wildcard_imports,
412 clippy::let_unit_value,
413 )]
414 use tonic::codegen::*;
415 use tonic::codegen::http::Uri;
416 #[derive(Debug, Clone)]
417 pub struct InternalSystemWorkspaceServiceClient<T> {
418 inner: tonic::client::Grpc<T>,
419 }
420 impl InternalSystemWorkspaceServiceClient<tonic::transport::Channel> {
421 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
423 where
424 D: TryInto<tonic::transport::Endpoint>,
425 D::Error: Into<StdError>,
426 {
427 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
428 Ok(Self::new(conn))
429 }
430 }
431 impl<T> InternalSystemWorkspaceServiceClient<T>
432 where
433 T: tonic::client::GrpcService<tonic::body::Body>,
434 T::Error: Into<StdError>,
435 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
436 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
437 {
438 pub fn new(inner: T) -> Self {
439 let inner = tonic::client::Grpc::new(inner);
440 Self { inner }
441 }
442 pub fn with_origin(inner: T, origin: Uri) -> Self {
443 let inner = tonic::client::Grpc::with_origin(inner, origin);
444 Self { inner }
445 }
446 pub fn with_interceptor<F>(
447 inner: T,
448 interceptor: F,
449 ) -> InternalSystemWorkspaceServiceClient<InterceptedService<T, F>>
450 where
451 F: tonic::service::Interceptor,
452 T::ResponseBody: Default,
453 T: tonic::codegen::Service<
454 http::Request<tonic::body::Body>,
455 Response = http::Response<
456 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
457 >,
458 >,
459 <T as tonic::codegen::Service<
460 http::Request<tonic::body::Body>,
461 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
462 {
463 InternalSystemWorkspaceServiceClient::new(
464 InterceptedService::new(inner, interceptor),
465 )
466 }
467 #[must_use]
472 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
473 self.inner = self.inner.send_compressed(encoding);
474 self
475 }
476 #[must_use]
478 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
479 self.inner = self.inner.accept_compressed(encoding);
480 self
481 }
482 #[must_use]
486 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
487 self.inner = self.inner.max_decoding_message_size(limit);
488 self
489 }
490 #[must_use]
494 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
495 self.inner = self.inner.max_encoding_message_size(limit);
496 self
497 }
498 pub async fn get_system_workspace_rid(
499 &mut self,
500 request: impl tonic::IntoRequest<super::GetSystemWorkspaceRidRequest>,
501 ) -> std::result::Result<
502 tonic::Response<super::GetSystemWorkspaceRidResponse>,
503 tonic::Status,
504 > {
505 self.inner
506 .ready()
507 .await
508 .map_err(|e| {
509 tonic::Status::unknown(
510 format!("Service was not ready: {}", e.into()),
511 )
512 })?;
513 let codec = tonic::codec::ProstCodec::default();
514 let path = http::uri::PathAndQuery::from_static(
515 "/nominal.internalauthorization.v1.InternalSystemWorkspaceService/GetSystemWorkspaceRid",
516 );
517 let mut req = request.into_request();
518 req.extensions_mut()
519 .insert(
520 GrpcMethod::new(
521 "nominal.internalauthorization.v1.InternalSystemWorkspaceService",
522 "GetSystemWorkspaceRid",
523 ),
524 );
525 self.inner.unary(req, path, codec).await
526 }
527 }
528}