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