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