Skip to main content

nominal_api_proto/proto/
nominal.internalauthorization.v1.rs

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