1#[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}
14pub 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")]
28 pub workspace_procedures: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
29}
30#[derive(Clone, Copy, PartialEq, ::prost::Message)]
32pub struct RemoveType {}
33#[derive(Clone, PartialEq, ::prost::Message)]
37pub struct UpdateOrRemoveWorkspaceDisplayName {
38 #[prost(
42 oneof = "update_or_remove_workspace_display_name::UpdateOrRemoveWorkspaceDisplayName",
43 tags = "1, 2"
44 )]
45 pub update_or_remove_workspace_display_name: ::core::option::Option<
46 update_or_remove_workspace_display_name::UpdateOrRemoveWorkspaceDisplayName,
47 >,
48}
49pub mod update_or_remove_workspace_display_name {
51 #[derive(Clone, PartialEq, ::prost::Oneof)]
55 pub enum UpdateOrRemoveWorkspaceDisplayName {
56 #[prost(string, tag = "1")]
57 DisplayName(::prost::alloc::string::String),
58 #[prost(message, tag = "2")]
59 RemoveType(super::RemoveType),
60 }
61}
62#[derive(Clone, PartialEq, ::prost::Message)]
66pub struct UpdateOrRemoveWorkspaceSymbol {
67 #[prost(
71 oneof = "update_or_remove_workspace_symbol::UpdateOrRemoveWorkspaceSymbol",
72 tags = "1, 2"
73 )]
74 pub update_or_remove_workspace_symbol: ::core::option::Option<
75 update_or_remove_workspace_symbol::UpdateOrRemoveWorkspaceSymbol,
76 >,
77}
78pub mod update_or_remove_workspace_symbol {
80 #[derive(Clone, PartialEq, ::prost::Oneof)]
84 pub enum UpdateOrRemoveWorkspaceSymbol {
85 #[prost(message, tag = "1")]
86 Symbol(super::WorkspaceSymbol),
87 #[prost(message, tag = "2")]
88 RemoveType(super::RemoveType),
89 }
90}
91#[derive(Clone, PartialEq, ::prost::Message)]
92pub struct UpdateWorkspaceRequest {
93 #[prost(message, optional, tag = "1")]
94 pub display_name: ::core::option::Option<UpdateOrRemoveWorkspaceDisplayName>,
95 #[prost(message, optional, tag = "2")]
96 pub symbol: ::core::option::Option<UpdateOrRemoveWorkspaceSymbol>,
97 #[prost(message, optional, tag = "3")]
98 pub settings: ::core::option::Option<WorkspaceSettings>,
99}
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct Workspace {
102 #[prost(string, tag = "1")]
104 pub id: ::prost::alloc::string::String,
105 #[prost(string, tag = "2")]
106 pub rid: ::prost::alloc::string::String,
107 #[prost(string, tag = "3")]
108 pub org: ::prost::alloc::string::String,
109 #[prost(string, optional, tag = "4")]
110 pub display_name: ::core::option::Option<::prost::alloc::string::String>,
111 #[prost(message, optional, tag = "5")]
112 pub symbol: ::core::option::Option<WorkspaceSymbol>,
113 #[prost(message, optional, tag = "6")]
114 pub settings: ::core::option::Option<WorkspaceSettings>,
115}
116#[derive(Clone, PartialEq, ::prost::Message)]
117pub struct WorkspaceSettings {
118 #[prost(message, optional, tag = "1")]
119 pub ref_names: ::core::option::Option<PreferredRefNameConfiguration>,
120 #[prost(message, optional, tag = "2")]
121 pub procedures: ::core::option::Option<ProcedureSettings>,
122}
123#[derive(Clone, PartialEq, ::prost::Message)]
124pub struct WorkspaceSymbol {
125 #[prost(oneof = "workspace_symbol::WorkspaceSymbol", tags = "1, 2, 3")]
126 pub workspace_symbol: ::core::option::Option<workspace_symbol::WorkspaceSymbol>,
127}
128pub mod workspace_symbol {
130 #[derive(Clone, PartialEq, ::prost::Oneof)]
131 pub enum WorkspaceSymbol {
132 #[prost(string, tag = "1")]
134 Icon(::prost::alloc::string::String),
135 #[prost(string, tag = "2")]
137 Emoji(::prost::alloc::string::String),
138 #[prost(string, tag = "3")]
140 Image(::prost::alloc::string::String),
141 }
142}
143#[derive(Clone, Copy, PartialEq, ::prost::Message)]
144pub struct GetWorkspacesRequest {}
145#[derive(Clone, PartialEq, ::prost::Message)]
146pub struct GetWorkspacesResponse {
147 #[prost(message, repeated, tag = "1")]
148 pub workspaces: ::prost::alloc::vec::Vec<Workspace>,
149}
150#[derive(Clone, PartialEq, ::prost::Message)]
151pub struct GetWorkspaceRequest {
152 #[prost(string, tag = "1")]
153 pub workspace_rid: ::prost::alloc::string::String,
154}
155#[derive(Clone, PartialEq, ::prost::Message)]
156pub struct GetWorkspaceResponse {
157 #[prost(message, optional, tag = "1")]
158 pub workspace: ::core::option::Option<Workspace>,
159}
160#[derive(Clone, PartialEq, ::prost::Message)]
161pub struct UpdateWorkspaceRequestWrapper {
162 #[prost(string, tag = "1")]
163 pub rid: ::prost::alloc::string::String,
164 #[prost(message, optional, tag = "2")]
165 pub request: ::core::option::Option<UpdateWorkspaceRequest>,
166}
167#[derive(Clone, PartialEq, ::prost::Message)]
168pub struct UpdateWorkspaceResponse {
169 #[prost(message, optional, tag = "1")]
170 pub workspace: ::core::option::Option<Workspace>,
171}
172#[derive(Clone, Copy, PartialEq, ::prost::Message)]
173pub struct GetDefaultWorkspaceRequest {}
174#[derive(Clone, PartialEq, ::prost::Message)]
175pub struct GetDefaultWorkspaceResponse {
176 #[prost(message, optional, tag = "1")]
177 pub workspace: ::core::option::Option<Workspace>,
178}
179#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
181#[repr(i32)]
182pub enum SecurityError {
183 ForbiddenCrossWorkspaceOperation = 0,
185 WorkspaceNotFound = 1,
187 WorkspaceNotSpecified = 2,
189}
190impl SecurityError {
191 pub fn as_str_name(&self) -> &'static str {
196 match self {
197 Self::ForbiddenCrossWorkspaceOperation => {
198 "SECURITY_ERROR_FORBIDDEN_CROSS_WORKSPACE_OPERATION"
199 }
200 Self::WorkspaceNotFound => "SECURITY_ERROR_WORKSPACE_NOT_FOUND",
201 Self::WorkspaceNotSpecified => "SECURITY_ERROR_WORKSPACE_NOT_SPECIFIED",
202 }
203 }
204 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
206 match value {
207 "SECURITY_ERROR_FORBIDDEN_CROSS_WORKSPACE_OPERATION" => {
208 Some(Self::ForbiddenCrossWorkspaceOperation)
209 }
210 "SECURITY_ERROR_WORKSPACE_NOT_FOUND" => Some(Self::WorkspaceNotFound),
211 "SECURITY_ERROR_WORKSPACE_NOT_SPECIFIED" => Some(Self::WorkspaceNotSpecified),
212 _ => None,
213 }
214 }
215}
216pub mod workspace_service_client {
218 #![allow(
219 unused_variables,
220 dead_code,
221 missing_docs,
222 clippy::wildcard_imports,
223 clippy::let_unit_value,
224 )]
225 use tonic::codegen::*;
226 use tonic::codegen::http::Uri;
227 #[derive(Debug, Clone)]
230 pub struct WorkspaceServiceClient<T> {
231 inner: tonic::client::Grpc<T>,
232 }
233 impl WorkspaceServiceClient<tonic::transport::Channel> {
234 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
236 where
237 D: TryInto<tonic::transport::Endpoint>,
238 D::Error: Into<StdError>,
239 {
240 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
241 Ok(Self::new(conn))
242 }
243 }
244 impl<T> WorkspaceServiceClient<T>
245 where
246 T: tonic::client::GrpcService<tonic::body::Body>,
247 T::Error: Into<StdError>,
248 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
249 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
250 {
251 pub fn new(inner: T) -> Self {
252 let inner = tonic::client::Grpc::new(inner);
253 Self { inner }
254 }
255 pub fn with_origin(inner: T, origin: Uri) -> Self {
256 let inner = tonic::client::Grpc::with_origin(inner, origin);
257 Self { inner }
258 }
259 pub fn with_interceptor<F>(
260 inner: T,
261 interceptor: F,
262 ) -> WorkspaceServiceClient<InterceptedService<T, F>>
263 where
264 F: tonic::service::Interceptor,
265 T::ResponseBody: Default,
266 T: tonic::codegen::Service<
267 http::Request<tonic::body::Body>,
268 Response = http::Response<
269 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
270 >,
271 >,
272 <T as tonic::codegen::Service<
273 http::Request<tonic::body::Body>,
274 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
275 {
276 WorkspaceServiceClient::new(InterceptedService::new(inner, interceptor))
277 }
278 #[must_use]
283 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
284 self.inner = self.inner.send_compressed(encoding);
285 self
286 }
287 #[must_use]
289 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
290 self.inner = self.inner.accept_compressed(encoding);
291 self
292 }
293 #[must_use]
297 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
298 self.inner = self.inner.max_decoding_message_size(limit);
299 self
300 }
301 #[must_use]
305 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
306 self.inner = self.inner.max_encoding_message_size(limit);
307 self
308 }
309 pub async fn get_workspaces(
311 &mut self,
312 request: impl tonic::IntoRequest<super::GetWorkspacesRequest>,
313 ) -> std::result::Result<
314 tonic::Response<super::GetWorkspacesResponse>,
315 tonic::Status,
316 > {
317 self.inner
318 .ready()
319 .await
320 .map_err(|e| {
321 tonic::Status::unknown(
322 format!("Service was not ready: {}", e.into()),
323 )
324 })?;
325 let codec = tonic::codec::ProstCodec::default();
326 let path = http::uri::PathAndQuery::from_static(
327 "/nominal.workspaces.v1.WorkspaceService/GetWorkspaces",
328 );
329 let mut req = request.into_request();
330 req.extensions_mut()
331 .insert(
332 GrpcMethod::new(
333 "nominal.workspaces.v1.WorkspaceService",
334 "GetWorkspaces",
335 ),
336 );
337 self.inner.unary(req, path, codec).await
338 }
339 pub async fn get_workspace(
341 &mut self,
342 request: impl tonic::IntoRequest<super::GetWorkspaceRequest>,
343 ) -> std::result::Result<
344 tonic::Response<super::GetWorkspaceResponse>,
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/GetWorkspace",
358 );
359 let mut req = request.into_request();
360 req.extensions_mut()
361 .insert(
362 GrpcMethod::new(
363 "nominal.workspaces.v1.WorkspaceService",
364 "GetWorkspace",
365 ),
366 );
367 self.inner.unary(req, path, codec).await
368 }
369 pub async fn update_workspace(
372 &mut self,
373 request: impl tonic::IntoRequest<super::UpdateWorkspaceRequestWrapper>,
374 ) -> std::result::Result<
375 tonic::Response<super::UpdateWorkspaceResponse>,
376 tonic::Status,
377 > {
378 self.inner
379 .ready()
380 .await
381 .map_err(|e| {
382 tonic::Status::unknown(
383 format!("Service was not ready: {}", e.into()),
384 )
385 })?;
386 let codec = tonic::codec::ProstCodec::default();
387 let path = http::uri::PathAndQuery::from_static(
388 "/nominal.workspaces.v1.WorkspaceService/UpdateWorkspace",
389 );
390 let mut req = request.into_request();
391 req.extensions_mut()
392 .insert(
393 GrpcMethod::new(
394 "nominal.workspaces.v1.WorkspaceService",
395 "UpdateWorkspace",
396 ),
397 );
398 self.inner.unary(req, path, codec).await
399 }
400 pub async fn get_default_workspace(
404 &mut self,
405 request: impl tonic::IntoRequest<super::GetDefaultWorkspaceRequest>,
406 ) -> std::result::Result<
407 tonic::Response<super::GetDefaultWorkspaceResponse>,
408 tonic::Status,
409 > {
410 self.inner
411 .ready()
412 .await
413 .map_err(|e| {
414 tonic::Status::unknown(
415 format!("Service was not ready: {}", e.into()),
416 )
417 })?;
418 let codec = tonic::codec::ProstCodec::default();
419 let path = http::uri::PathAndQuery::from_static(
420 "/nominal.workspaces.v1.WorkspaceService/GetDefaultWorkspace",
421 );
422 let mut req = request.into_request();
423 req.extensions_mut()
424 .insert(
425 GrpcMethod::new(
426 "nominal.workspaces.v1.WorkspaceService",
427 "GetDefaultWorkspace",
428 ),
429 );
430 self.inner.unary(req, path, codec).await
431 }
432 }
433}