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}
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct GetWorkspacesResponse {
126    #[prost(message, repeated, tag = "1")]
127    pub workspaces: ::prost::alloc::vec::Vec<Workspace>,
128}
129#[derive(Clone, PartialEq, ::prost::Message)]
130pub struct GetWorkspaceRequest {
131    #[prost(string, tag = "1")]
132    pub workspace_rid: ::prost::alloc::string::String,
133}
134#[derive(Clone, PartialEq, ::prost::Message)]
135pub struct GetWorkspaceResponse {
136    #[prost(message, optional, tag = "1")]
137    pub workspace: ::core::option::Option<Workspace>,
138}
139#[derive(Clone, PartialEq, ::prost::Message)]
140pub struct UpdateWorkspaceRequestWrapper {
141    #[prost(string, tag = "1")]
142    pub rid: ::prost::alloc::string::String,
143    #[prost(message, optional, tag = "2")]
144    pub request: ::core::option::Option<UpdateWorkspaceRequest>,
145}
146#[derive(Clone, PartialEq, ::prost::Message)]
147pub struct UpdateWorkspaceResponse {
148    #[prost(message, optional, tag = "1")]
149    pub workspace: ::core::option::Option<Workspace>,
150}
151#[derive(Clone, Copy, PartialEq, ::prost::Message)]
152pub struct GetDefaultWorkspaceRequest {}
153#[derive(Clone, PartialEq, ::prost::Message)]
154pub struct GetDefaultWorkspaceResponse {
155    #[prost(message, optional, tag = "1")]
156    pub workspace: ::core::option::Option<Workspace>,
157}
158#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
159#[repr(i32)]
160pub enum SecurityError {
161    ForbiddenCrossWorkspaceOperation = 0,
162    WorkspaceNotFound = 1,
163    WorkspaceNotSpecified = 2,
164}
165impl SecurityError {
166    /// String value of the enum field names used in the ProtoBuf definition.
167    ///
168    /// The values are not transformed in any way and thus are considered stable
169    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
170    pub fn as_str_name(&self) -> &'static str {
171        match self {
172            Self::ForbiddenCrossWorkspaceOperation => {
173                "SECURITY_ERROR_FORBIDDEN_CROSS_WORKSPACE_OPERATION"
174            }
175            Self::WorkspaceNotFound => "SECURITY_ERROR_WORKSPACE_NOT_FOUND",
176            Self::WorkspaceNotSpecified => "SECURITY_ERROR_WORKSPACE_NOT_SPECIFIED",
177        }
178    }
179    /// Creates an enum from field names used in the ProtoBuf definition.
180    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
181        match value {
182            "SECURITY_ERROR_FORBIDDEN_CROSS_WORKSPACE_OPERATION" => {
183                Some(Self::ForbiddenCrossWorkspaceOperation)
184            }
185            "SECURITY_ERROR_WORKSPACE_NOT_FOUND" => Some(Self::WorkspaceNotFound),
186            "SECURITY_ERROR_WORKSPACE_NOT_SPECIFIED" => Some(Self::WorkspaceNotSpecified),
187            _ => None,
188        }
189    }
190}
191/// Generated client implementations.
192pub mod workspace_service_client {
193    #![allow(
194        unused_variables,
195        dead_code,
196        missing_docs,
197        clippy::wildcard_imports,
198        clippy::let_unit_value,
199    )]
200    use tonic::codegen::*;
201    use tonic::codegen::http::Uri;
202    #[derive(Debug, Clone)]
203    pub struct WorkspaceServiceClient<T> {
204        inner: tonic::client::Grpc<T>,
205    }
206    impl WorkspaceServiceClient<tonic::transport::Channel> {
207        /// Attempt to create a new client by connecting to a given endpoint.
208        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
209        where
210            D: TryInto<tonic::transport::Endpoint>,
211            D::Error: Into<StdError>,
212        {
213            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
214            Ok(Self::new(conn))
215        }
216    }
217    impl<T> WorkspaceServiceClient<T>
218    where
219        T: tonic::client::GrpcService<tonic::body::Body>,
220        T::Error: Into<StdError>,
221        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
222        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
223    {
224        pub fn new(inner: T) -> Self {
225            let inner = tonic::client::Grpc::new(inner);
226            Self { inner }
227        }
228        pub fn with_origin(inner: T, origin: Uri) -> Self {
229            let inner = tonic::client::Grpc::with_origin(inner, origin);
230            Self { inner }
231        }
232        pub fn with_interceptor<F>(
233            inner: T,
234            interceptor: F,
235        ) -> WorkspaceServiceClient<InterceptedService<T, F>>
236        where
237            F: tonic::service::Interceptor,
238            T::ResponseBody: Default,
239            T: tonic::codegen::Service<
240                http::Request<tonic::body::Body>,
241                Response = http::Response<
242                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
243                >,
244            >,
245            <T as tonic::codegen::Service<
246                http::Request<tonic::body::Body>,
247            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
248        {
249            WorkspaceServiceClient::new(InterceptedService::new(inner, interceptor))
250        }
251        /// Compress requests with the given encoding.
252        ///
253        /// This requires the server to support it otherwise it might respond with an
254        /// error.
255        #[must_use]
256        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
257            self.inner = self.inner.send_compressed(encoding);
258            self
259        }
260        /// Enable decompressing responses.
261        #[must_use]
262        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
263            self.inner = self.inner.accept_compressed(encoding);
264            self
265        }
266        /// Limits the maximum size of a decoded message.
267        ///
268        /// Default: `4MB`
269        #[must_use]
270        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
271            self.inner = self.inner.max_decoding_message_size(limit);
272            self
273        }
274        /// Limits the maximum size of an encoded message.
275        ///
276        /// Default: `usize::MAX`
277        #[must_use]
278        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
279            self.inner = self.inner.max_encoding_message_size(limit);
280            self
281        }
282        pub async fn get_workspaces(
283            &mut self,
284            request: impl tonic::IntoRequest<super::GetWorkspacesRequest>,
285        ) -> std::result::Result<
286            tonic::Response<super::GetWorkspacesResponse>,
287            tonic::Status,
288        > {
289            self.inner
290                .ready()
291                .await
292                .map_err(|e| {
293                    tonic::Status::unknown(
294                        format!("Service was not ready: {}", e.into()),
295                    )
296                })?;
297            let codec = tonic::codec::ProstCodec::default();
298            let path = http::uri::PathAndQuery::from_static(
299                "/nominal.workspaces.v1.WorkspaceService/GetWorkspaces",
300            );
301            let mut req = request.into_request();
302            req.extensions_mut()
303                .insert(
304                    GrpcMethod::new(
305                        "nominal.workspaces.v1.WorkspaceService",
306                        "GetWorkspaces",
307                    ),
308                );
309            self.inner.unary(req, path, codec).await
310        }
311        pub async fn get_workspace(
312            &mut self,
313            request: impl tonic::IntoRequest<super::GetWorkspaceRequest>,
314        ) -> std::result::Result<
315            tonic::Response<super::GetWorkspaceResponse>,
316            tonic::Status,
317        > {
318            self.inner
319                .ready()
320                .await
321                .map_err(|e| {
322                    tonic::Status::unknown(
323                        format!("Service was not ready: {}", e.into()),
324                    )
325                })?;
326            let codec = tonic::codec::ProstCodec::default();
327            let path = http::uri::PathAndQuery::from_static(
328                "/nominal.workspaces.v1.WorkspaceService/GetWorkspace",
329            );
330            let mut req = request.into_request();
331            req.extensions_mut()
332                .insert(
333                    GrpcMethod::new(
334                        "nominal.workspaces.v1.WorkspaceService",
335                        "GetWorkspace",
336                    ),
337                );
338            self.inner.unary(req, path, codec).await
339        }
340        pub async fn update_workspace(
341            &mut self,
342            request: impl tonic::IntoRequest<super::UpdateWorkspaceRequestWrapper>,
343        ) -> std::result::Result<
344            tonic::Response<super::UpdateWorkspaceResponse>,
345            tonic::Status,
346        > {
347            self.inner
348                .ready()
349                .await
350                .map_err(|e| {
351                    tonic::Status::unknown(
352                        format!("Service was not ready: {}", e.into()),
353                    )
354                })?;
355            let codec = tonic::codec::ProstCodec::default();
356            let path = http::uri::PathAndQuery::from_static(
357                "/nominal.workspaces.v1.WorkspaceService/UpdateWorkspace",
358            );
359            let mut req = request.into_request();
360            req.extensions_mut()
361                .insert(
362                    GrpcMethod::new(
363                        "nominal.workspaces.v1.WorkspaceService",
364                        "UpdateWorkspace",
365                    ),
366                );
367            self.inner.unary(req, path, codec).await
368        }
369        pub async fn get_default_workspace(
370            &mut self,
371            request: impl tonic::IntoRequest<super::GetDefaultWorkspaceRequest>,
372        ) -> std::result::Result<
373            tonic::Response<super::GetDefaultWorkspaceResponse>,
374            tonic::Status,
375        > {
376            self.inner
377                .ready()
378                .await
379                .map_err(|e| {
380                    tonic::Status::unknown(
381                        format!("Service was not ready: {}", e.into()),
382                    )
383                })?;
384            let codec = tonic::codec::ProstCodec::default();
385            let path = http::uri::PathAndQuery::from_static(
386                "/nominal.workspaces.v1.WorkspaceService/GetDefaultWorkspace",
387            );
388            let mut req = request.into_request();
389            req.extensions_mut()
390                .insert(
391                    GrpcMethod::new(
392                        "nominal.workspaces.v1.WorkspaceService",
393                        "GetDefaultWorkspace",
394                    ),
395                );
396            self.inner.unary(req, path, codec).await
397        }
398    }
399}