Skip to main content

nominal_api_proto/proto/
nominal.workspaces.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct PreferredRefNameConfiguration {
4    #[prost(message, repeated, tag = "1")]
5    pub v1: ::prost::alloc::vec::Vec<super::super::types::RefNameAndType>,
6}
7#[derive(Clone, PartialEq, ::prost::Message)]
8pub struct ProcedureSettings {
9    #[prost(oneof = "procedure_settings::ProcedureSettings", tags = "1")]
10    pub procedure_settings: ::core::option::Option<
11        procedure_settings::ProcedureSettings,
12    >,
13}
14/// Nested message and enum types in `ProcedureSettings`.
15pub mod procedure_settings {
16    #[derive(Clone, PartialEq, ::prost::Oneof)]
17    pub enum ProcedureSettings {
18        #[prost(message, tag = "1")]
19        V1(super::ProcedureSettingsV1),
20    }
21}
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct ProcedureSettingsV1 {
24    #[prost(string, repeated, tag = "1")]
25    pub workspace_procedures: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
26}
27#[derive(Clone, Copy, PartialEq, ::prost::Message)]
28pub struct RemoveType {}
29#[derive(Clone, PartialEq, ::prost::Message)]
30pub struct UpdateOrRemoveWorkspaceDisplayName {
31    #[prost(
32        oneof = "update_or_remove_workspace_display_name::UpdateOrRemoveWorkspaceDisplayName",
33        tags = "1, 2"
34    )]
35    pub update_or_remove_workspace_display_name: ::core::option::Option<
36        update_or_remove_workspace_display_name::UpdateOrRemoveWorkspaceDisplayName,
37    >,
38}
39/// Nested message and enum types in `UpdateOrRemoveWorkspaceDisplayName`.
40pub mod update_or_remove_workspace_display_name {
41    #[derive(Clone, PartialEq, ::prost::Oneof)]
42    pub enum UpdateOrRemoveWorkspaceDisplayName {
43        #[prost(string, tag = "1")]
44        DisplayName(::prost::alloc::string::String),
45        #[prost(message, tag = "2")]
46        RemoveType(super::RemoveType),
47    }
48}
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct UpdateOrRemoveWorkspaceSymbol {
51    #[prost(
52        oneof = "update_or_remove_workspace_symbol::UpdateOrRemoveWorkspaceSymbol",
53        tags = "1, 2"
54    )]
55    pub update_or_remove_workspace_symbol: ::core::option::Option<
56        update_or_remove_workspace_symbol::UpdateOrRemoveWorkspaceSymbol,
57    >,
58}
59/// Nested message and enum types in `UpdateOrRemoveWorkspaceSymbol`.
60pub mod update_or_remove_workspace_symbol {
61    #[derive(Clone, PartialEq, ::prost::Oneof)]
62    pub enum UpdateOrRemoveWorkspaceSymbol {
63        #[prost(message, tag = "1")]
64        Symbol(super::WorkspaceSymbol),
65        #[prost(message, tag = "2")]
66        RemoveType(super::RemoveType),
67    }
68}
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct UpdateWorkspaceRequest {
71    #[prost(message, optional, tag = "1")]
72    pub display_name: ::core::option::Option<UpdateOrRemoveWorkspaceDisplayName>,
73    #[prost(message, optional, tag = "2")]
74    pub symbol: ::core::option::Option<UpdateOrRemoveWorkspaceSymbol>,
75    #[prost(message, optional, tag = "3")]
76    pub settings: ::core::option::Option<WorkspaceSettings>,
77}
78#[derive(Clone, PartialEq, ::prost::Message)]
79pub struct Workspace {
80    #[prost(string, tag = "1")]
81    pub id: ::prost::alloc::string::String,
82    #[prost(string, tag = "2")]
83    pub rid: ::prost::alloc::string::String,
84    #[prost(string, tag = "3")]
85    pub org: ::prost::alloc::string::String,
86    #[prost(string, optional, tag = "4")]
87    pub display_name: ::core::option::Option<::prost::alloc::string::String>,
88    #[prost(message, optional, tag = "5")]
89    pub symbol: ::core::option::Option<WorkspaceSymbol>,
90    #[prost(message, optional, tag = "6")]
91    pub settings: ::core::option::Option<WorkspaceSettings>,
92}
93#[derive(Clone, PartialEq, ::prost::Message)]
94pub struct WorkspaceSettings {
95    #[prost(message, optional, tag = "1")]
96    pub ref_names: ::core::option::Option<PreferredRefNameConfiguration>,
97    #[prost(message, optional, tag = "2")]
98    pub procedures: ::core::option::Option<ProcedureSettings>,
99}
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct WorkspaceSymbol {
102    #[prost(oneof = "workspace_symbol::WorkspaceSymbol", tags = "1, 2, 3")]
103    pub workspace_symbol: ::core::option::Option<workspace_symbol::WorkspaceSymbol>,
104}
105/// Nested message and enum types in `WorkspaceSymbol`.
106pub mod workspace_symbol {
107    #[derive(Clone, PartialEq, ::prost::Oneof)]
108    pub enum WorkspaceSymbol {
109        #[prost(string, tag = "1")]
110        Icon(::prost::alloc::string::String),
111        #[prost(string, tag = "2")]
112        Emoji(::prost::alloc::string::String),
113        #[prost(string, tag = "3")]
114        Image(::prost::alloc::string::String),
115    }
116}
117#[derive(Clone, Copy, PartialEq, ::prost::Message)]
118pub struct GetWorkspacesRequest {
119    #[prost(bool, optional, tag = "1")]
120    pub filter_by_session_org: ::core::option::Option<bool>,
121    #[prost(bool, optional, tag = "2")]
122    pub include_guest_workspaces: ::core::option::Option<bool>,
123    #[prost(bool, optional, tag = "3")]
124    pub include_role_bound_workspaces: ::core::option::Option<bool>,
125}
126#[derive(Clone, PartialEq, ::prost::Message)]
127pub struct GetWorkspacesResponse {
128    #[prost(message, repeated, tag = "1")]
129    pub workspaces: ::prost::alloc::vec::Vec<Workspace>,
130}
131#[derive(Clone, PartialEq, ::prost::Message)]
132pub struct GetWorkspaceRequest {
133    #[prost(string, tag = "1")]
134    pub workspace_rid: ::prost::alloc::string::String,
135}
136#[derive(Clone, PartialEq, ::prost::Message)]
137pub struct GetWorkspaceResponse {
138    #[prost(message, optional, tag = "1")]
139    pub workspace: ::core::option::Option<Workspace>,
140}
141#[derive(Clone, PartialEq, ::prost::Message)]
142pub struct UpdateWorkspaceRequestWrapper {
143    #[prost(string, tag = "1")]
144    pub rid: ::prost::alloc::string::String,
145    #[prost(message, optional, tag = "2")]
146    pub request: ::core::option::Option<UpdateWorkspaceRequest>,
147}
148#[derive(Clone, PartialEq, ::prost::Message)]
149pub struct UpdateWorkspaceResponse {
150    #[prost(message, optional, tag = "1")]
151    pub workspace: ::core::option::Option<Workspace>,
152}
153#[derive(Clone, Copy, PartialEq, ::prost::Message)]
154pub struct GetDefaultWorkspaceRequest {}
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct GetDefaultWorkspaceResponse {
157    #[prost(message, optional, tag = "1")]
158    pub workspace: ::core::option::Option<Workspace>,
159}
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct GetWorkspaceBannerRequest {
162    #[prost(string, tag = "1")]
163    pub workspace_rid: ::prost::alloc::string::String,
164}
165#[derive(Clone, Copy, PartialEq, ::prost::Message)]
166pub struct GetWorkspaceBannerResponse {
167    #[prost(message, optional, tag = "1")]
168    pub banner_config: ::core::option::Option<BannerConfig>,
169}
170#[derive(Clone, Copy, PartialEq, ::prost::Message)]
171pub struct BannerConfig {
172    #[prost(oneof = "banner_config::BannerConfig", tags = "1, 2, 3")]
173    pub banner_config: ::core::option::Option<banner_config::BannerConfig>,
174}
175/// Nested message and enum types in `BannerConfig`.
176pub mod banner_config {
177    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
178    pub enum BannerConfig {
179        #[prost(message, tag = "1")]
180        Cui(super::CuiBannerConfig),
181        #[prost(message, tag = "2")]
182        NoItar(super::NoItarBannerConfig),
183        #[prost(message, tag = "3")]
184        Secret(super::SecretBannerConfig),
185    }
186}
187#[derive(Clone, Copy, PartialEq, ::prost::Message)]
188pub struct CuiBannerConfig {}
189#[derive(Clone, Copy, PartialEq, ::prost::Message)]
190pub struct NoItarBannerConfig {}
191#[derive(Clone, Copy, PartialEq, ::prost::Message)]
192pub struct SecretBannerConfig {}
193#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
194#[repr(i32)]
195pub enum SecurityError {
196    ForbiddenCrossWorkspaceOperation = 0,
197    WorkspaceNotFound = 1,
198    WorkspaceNotSpecified = 2,
199}
200impl SecurityError {
201    /// String value of the enum field names used in the ProtoBuf definition.
202    ///
203    /// The values are not transformed in any way and thus are considered stable
204    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
205    pub fn as_str_name(&self) -> &'static str {
206        match self {
207            Self::ForbiddenCrossWorkspaceOperation => {
208                "SECURITY_ERROR_FORBIDDEN_CROSS_WORKSPACE_OPERATION"
209            }
210            Self::WorkspaceNotFound => "SECURITY_ERROR_WORKSPACE_NOT_FOUND",
211            Self::WorkspaceNotSpecified => "SECURITY_ERROR_WORKSPACE_NOT_SPECIFIED",
212        }
213    }
214    /// Creates an enum from field names used in the ProtoBuf definition.
215    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
216        match value {
217            "SECURITY_ERROR_FORBIDDEN_CROSS_WORKSPACE_OPERATION" => {
218                Some(Self::ForbiddenCrossWorkspaceOperation)
219            }
220            "SECURITY_ERROR_WORKSPACE_NOT_FOUND" => Some(Self::WorkspaceNotFound),
221            "SECURITY_ERROR_WORKSPACE_NOT_SPECIFIED" => Some(Self::WorkspaceNotSpecified),
222            _ => None,
223        }
224    }
225}
226/// Generated client implementations.
227pub mod workspace_service_client {
228    #![allow(
229        unused_variables,
230        dead_code,
231        missing_docs,
232        clippy::wildcard_imports,
233        clippy::let_unit_value,
234    )]
235    use tonic::codegen::*;
236    use tonic::codegen::http::Uri;
237    #[derive(Debug, Clone)]
238    pub struct WorkspaceServiceClient<T> {
239        inner: tonic::client::Grpc<T>,
240    }
241    impl WorkspaceServiceClient<tonic::transport::Channel> {
242        /// Attempt to create a new client by connecting to a given endpoint.
243        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
244        where
245            D: TryInto<tonic::transport::Endpoint>,
246            D::Error: Into<StdError>,
247        {
248            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
249            Ok(Self::new(conn))
250        }
251    }
252    impl<T> WorkspaceServiceClient<T>
253    where
254        T: tonic::client::GrpcService<tonic::body::Body>,
255        T::Error: Into<StdError>,
256        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
257        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
258    {
259        pub fn new(inner: T) -> Self {
260            let inner = tonic::client::Grpc::new(inner);
261            Self { inner }
262        }
263        pub fn with_origin(inner: T, origin: Uri) -> Self {
264            let inner = tonic::client::Grpc::with_origin(inner, origin);
265            Self { inner }
266        }
267        pub fn with_interceptor<F>(
268            inner: T,
269            interceptor: F,
270        ) -> WorkspaceServiceClient<InterceptedService<T, F>>
271        where
272            F: tonic::service::Interceptor,
273            T::ResponseBody: Default,
274            T: tonic::codegen::Service<
275                http::Request<tonic::body::Body>,
276                Response = http::Response<
277                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
278                >,
279            >,
280            <T as tonic::codegen::Service<
281                http::Request<tonic::body::Body>,
282            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
283        {
284            WorkspaceServiceClient::new(InterceptedService::new(inner, interceptor))
285        }
286        /// Compress requests with the given encoding.
287        ///
288        /// This requires the server to support it otherwise it might respond with an
289        /// error.
290        #[must_use]
291        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
292            self.inner = self.inner.send_compressed(encoding);
293            self
294        }
295        /// Enable decompressing responses.
296        #[must_use]
297        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
298            self.inner = self.inner.accept_compressed(encoding);
299            self
300        }
301        /// Limits the maximum size of a decoded message.
302        ///
303        /// Default: `4MB`
304        #[must_use]
305        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
306            self.inner = self.inner.max_decoding_message_size(limit);
307            self
308        }
309        /// Limits the maximum size of an encoded message.
310        ///
311        /// Default: `usize::MAX`
312        #[must_use]
313        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
314            self.inner = self.inner.max_encoding_message_size(limit);
315            self
316        }
317        pub async fn get_workspaces(
318            &mut self,
319            request: impl tonic::IntoRequest<super::GetWorkspacesRequest>,
320        ) -> std::result::Result<
321            tonic::Response<super::GetWorkspacesResponse>,
322            tonic::Status,
323        > {
324            self.inner
325                .ready()
326                .await
327                .map_err(|e| {
328                    tonic::Status::unknown(
329                        format!("Service was not ready: {}", e.into()),
330                    )
331                })?;
332            let codec = tonic::codec::ProstCodec::default();
333            let path = http::uri::PathAndQuery::from_static(
334                "/nominal.workspaces.v1.WorkspaceService/GetWorkspaces",
335            );
336            let mut req = request.into_request();
337            req.extensions_mut()
338                .insert(
339                    GrpcMethod::new(
340                        "nominal.workspaces.v1.WorkspaceService",
341                        "GetWorkspaces",
342                    ),
343                );
344            self.inner.unary(req, path, codec).await
345        }
346        pub async fn get_workspace(
347            &mut self,
348            request: impl tonic::IntoRequest<super::GetWorkspaceRequest>,
349        ) -> std::result::Result<
350            tonic::Response<super::GetWorkspaceResponse>,
351            tonic::Status,
352        > {
353            self.inner
354                .ready()
355                .await
356                .map_err(|e| {
357                    tonic::Status::unknown(
358                        format!("Service was not ready: {}", e.into()),
359                    )
360                })?;
361            let codec = tonic::codec::ProstCodec::default();
362            let path = http::uri::PathAndQuery::from_static(
363                "/nominal.workspaces.v1.WorkspaceService/GetWorkspace",
364            );
365            let mut req = request.into_request();
366            req.extensions_mut()
367                .insert(
368                    GrpcMethod::new(
369                        "nominal.workspaces.v1.WorkspaceService",
370                        "GetWorkspace",
371                    ),
372                );
373            self.inner.unary(req, path, codec).await
374        }
375        pub async fn update_workspace(
376            &mut self,
377            request: impl tonic::IntoRequest<super::UpdateWorkspaceRequestWrapper>,
378        ) -> std::result::Result<
379            tonic::Response<super::UpdateWorkspaceResponse>,
380            tonic::Status,
381        > {
382            self.inner
383                .ready()
384                .await
385                .map_err(|e| {
386                    tonic::Status::unknown(
387                        format!("Service was not ready: {}", e.into()),
388                    )
389                })?;
390            let codec = tonic::codec::ProstCodec::default();
391            let path = http::uri::PathAndQuery::from_static(
392                "/nominal.workspaces.v1.WorkspaceService/UpdateWorkspace",
393            );
394            let mut req = request.into_request();
395            req.extensions_mut()
396                .insert(
397                    GrpcMethod::new(
398                        "nominal.workspaces.v1.WorkspaceService",
399                        "UpdateWorkspace",
400                    ),
401                );
402            self.inner.unary(req, path, codec).await
403        }
404        pub async fn get_default_workspace(
405            &mut self,
406            request: impl tonic::IntoRequest<super::GetDefaultWorkspaceRequest>,
407        ) -> std::result::Result<
408            tonic::Response<super::GetDefaultWorkspaceResponse>,
409            tonic::Status,
410        > {
411            self.inner
412                .ready()
413                .await
414                .map_err(|e| {
415                    tonic::Status::unknown(
416                        format!("Service was not ready: {}", e.into()),
417                    )
418                })?;
419            let codec = tonic::codec::ProstCodec::default();
420            let path = http::uri::PathAndQuery::from_static(
421                "/nominal.workspaces.v1.WorkspaceService/GetDefaultWorkspace",
422            );
423            let mut req = request.into_request();
424            req.extensions_mut()
425                .insert(
426                    GrpcMethod::new(
427                        "nominal.workspaces.v1.WorkspaceService",
428                        "GetDefaultWorkspace",
429                    ),
430                );
431            self.inner.unary(req, path, codec).await
432        }
433        pub async fn get_workspace_banner(
434            &mut self,
435            request: impl tonic::IntoRequest<super::GetWorkspaceBannerRequest>,
436        ) -> std::result::Result<
437            tonic::Response<super::GetWorkspaceBannerResponse>,
438            tonic::Status,
439        > {
440            self.inner
441                .ready()
442                .await
443                .map_err(|e| {
444                    tonic::Status::unknown(
445                        format!("Service was not ready: {}", e.into()),
446                    )
447                })?;
448            let codec = tonic::codec::ProstCodec::default();
449            let path = http::uri::PathAndQuery::from_static(
450                "/nominal.workspaces.v1.WorkspaceService/GetWorkspaceBanner",
451            );
452            let mut req = request.into_request();
453            req.extensions_mut()
454                .insert(
455                    GrpcMethod::new(
456                        "nominal.workspaces.v1.WorkspaceService",
457                        "GetWorkspaceBanner",
458                    ),
459                );
460            self.inner.unary(req, path, codec).await
461        }
462    }
463}