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#[derive(Clone, PartialEq, ::prost::Message)]
265pub struct GetWorkspacesResponse {
266    #[prost(message, repeated, tag = "1")]
267    pub workspaces: ::prost::alloc::vec::Vec<Workspace>,
268}
269#[derive(Clone, PartialEq, ::prost::Message)]
270pub struct GetWorkspaceRequest {
271    #[prost(string, tag = "1")]
272    pub workspace_rid: ::prost::alloc::string::String,
273}
274#[derive(Clone, PartialEq, ::prost::Message)]
275pub struct GetWorkspaceResponse {
276    #[prost(message, optional, tag = "1")]
277    pub workspace: ::core::option::Option<Workspace>,
278}
279#[derive(Clone, PartialEq, ::prost::Message)]
280pub struct UpdateWorkspaceRequestWrapper {
281    #[prost(string, tag = "1")]
282    pub rid: ::prost::alloc::string::String,
283    #[prost(message, optional, tag = "2")]
284    pub request: ::core::option::Option<UpdateWorkspaceRequest>,
285}
286#[derive(Clone, PartialEq, ::prost::Message)]
287pub struct UpdateWorkspaceResponse {
288    #[prost(message, optional, tag = "1")]
289    pub workspace: ::core::option::Option<Workspace>,
290}
291#[derive(Clone, Copy, PartialEq, ::prost::Message)]
292pub struct GetDefaultWorkspaceRequest {}
293#[derive(Clone, PartialEq, ::prost::Message)]
294pub struct GetDefaultWorkspaceResponse {
295    #[prost(message, optional, tag = "1")]
296    pub workspace: ::core::option::Option<Workspace>,
297}
298#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
299#[repr(i32)]
300pub enum SecurityError {
301    ForbiddenCrossWorkspaceOperation = 0,
302    WorkspaceNotFound = 1,
303    WorkspaceNotSpecified = 2,
304}
305impl SecurityError {
306    /// String value of the enum field names used in the ProtoBuf definition.
307    ///
308    /// The values are not transformed in any way and thus are considered stable
309    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
310    pub fn as_str_name(&self) -> &'static str {
311        match self {
312            Self::ForbiddenCrossWorkspaceOperation => {
313                "SECURITY_ERROR_FORBIDDEN_CROSS_WORKSPACE_OPERATION"
314            }
315            Self::WorkspaceNotFound => "SECURITY_ERROR_WORKSPACE_NOT_FOUND",
316            Self::WorkspaceNotSpecified => "SECURITY_ERROR_WORKSPACE_NOT_SPECIFIED",
317        }
318    }
319    /// Creates an enum from field names used in the ProtoBuf definition.
320    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
321        match value {
322            "SECURITY_ERROR_FORBIDDEN_CROSS_WORKSPACE_OPERATION" => {
323                Some(Self::ForbiddenCrossWorkspaceOperation)
324            }
325            "SECURITY_ERROR_WORKSPACE_NOT_FOUND" => Some(Self::WorkspaceNotFound),
326            "SECURITY_ERROR_WORKSPACE_NOT_SPECIFIED" => Some(Self::WorkspaceNotSpecified),
327            _ => None,
328        }
329    }
330}
331/// Generated client implementations.
332pub mod workspace_service_client {
333    #![allow(
334        unused_variables,
335        dead_code,
336        missing_docs,
337        clippy::wildcard_imports,
338        clippy::let_unit_value,
339    )]
340    use tonic::codegen::*;
341    use tonic::codegen::http::Uri;
342    #[derive(Debug, Clone)]
343    pub struct WorkspaceServiceClient<T> {
344        inner: tonic::client::Grpc<T>,
345    }
346    impl WorkspaceServiceClient<tonic::transport::Channel> {
347        /// Attempt to create a new client by connecting to a given endpoint.
348        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
349        where
350            D: TryInto<tonic::transport::Endpoint>,
351            D::Error: Into<StdError>,
352        {
353            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
354            Ok(Self::new(conn))
355        }
356    }
357    impl<T> WorkspaceServiceClient<T>
358    where
359        T: tonic::client::GrpcService<tonic::body::Body>,
360        T::Error: Into<StdError>,
361        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
362        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
363    {
364        pub fn new(inner: T) -> Self {
365            let inner = tonic::client::Grpc::new(inner);
366            Self { inner }
367        }
368        pub fn with_origin(inner: T, origin: Uri) -> Self {
369            let inner = tonic::client::Grpc::with_origin(inner, origin);
370            Self { inner }
371        }
372        pub fn with_interceptor<F>(
373            inner: T,
374            interceptor: F,
375        ) -> WorkspaceServiceClient<InterceptedService<T, F>>
376        where
377            F: tonic::service::Interceptor,
378            T::ResponseBody: Default,
379            T: tonic::codegen::Service<
380                http::Request<tonic::body::Body>,
381                Response = http::Response<
382                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
383                >,
384            >,
385            <T as tonic::codegen::Service<
386                http::Request<tonic::body::Body>,
387            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
388        {
389            WorkspaceServiceClient::new(InterceptedService::new(inner, interceptor))
390        }
391        /// Compress requests with the given encoding.
392        ///
393        /// This requires the server to support it otherwise it might respond with an
394        /// error.
395        #[must_use]
396        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
397            self.inner = self.inner.send_compressed(encoding);
398            self
399        }
400        /// Enable decompressing responses.
401        #[must_use]
402        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
403            self.inner = self.inner.accept_compressed(encoding);
404            self
405        }
406        /// Limits the maximum size of a decoded message.
407        ///
408        /// Default: `4MB`
409        #[must_use]
410        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
411            self.inner = self.inner.max_decoding_message_size(limit);
412            self
413        }
414        /// Limits the maximum size of an encoded message.
415        ///
416        /// Default: `usize::MAX`
417        #[must_use]
418        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
419            self.inner = self.inner.max_encoding_message_size(limit);
420            self
421        }
422        pub async fn get_workspaces(
423            &mut self,
424            request: impl tonic::IntoRequest<super::GetWorkspacesRequest>,
425        ) -> std::result::Result<
426            tonic::Response<super::GetWorkspacesResponse>,
427            tonic::Status,
428        > {
429            self.inner
430                .ready()
431                .await
432                .map_err(|e| {
433                    tonic::Status::unknown(
434                        format!("Service was not ready: {}", e.into()),
435                    )
436                })?;
437            let codec = tonic::codec::ProstCodec::default();
438            let path = http::uri::PathAndQuery::from_static(
439                "/nominal.workspaces.v1.WorkspaceService/GetWorkspaces",
440            );
441            let mut req = request.into_request();
442            req.extensions_mut()
443                .insert(
444                    GrpcMethod::new(
445                        "nominal.workspaces.v1.WorkspaceService",
446                        "GetWorkspaces",
447                    ),
448                );
449            self.inner.unary(req, path, codec).await
450        }
451        pub async fn get_workspace(
452            &mut self,
453            request: impl tonic::IntoRequest<super::GetWorkspaceRequest>,
454        ) -> std::result::Result<
455            tonic::Response<super::GetWorkspaceResponse>,
456            tonic::Status,
457        > {
458            self.inner
459                .ready()
460                .await
461                .map_err(|e| {
462                    tonic::Status::unknown(
463                        format!("Service was not ready: {}", e.into()),
464                    )
465                })?;
466            let codec = tonic::codec::ProstCodec::default();
467            let path = http::uri::PathAndQuery::from_static(
468                "/nominal.workspaces.v1.WorkspaceService/GetWorkspace",
469            );
470            let mut req = request.into_request();
471            req.extensions_mut()
472                .insert(
473                    GrpcMethod::new(
474                        "nominal.workspaces.v1.WorkspaceService",
475                        "GetWorkspace",
476                    ),
477                );
478            self.inner.unary(req, path, codec).await
479        }
480        pub async fn update_workspace(
481            &mut self,
482            request: impl tonic::IntoRequest<super::UpdateWorkspaceRequestWrapper>,
483        ) -> std::result::Result<
484            tonic::Response<super::UpdateWorkspaceResponse>,
485            tonic::Status,
486        > {
487            self.inner
488                .ready()
489                .await
490                .map_err(|e| {
491                    tonic::Status::unknown(
492                        format!("Service was not ready: {}", e.into()),
493                    )
494                })?;
495            let codec = tonic::codec::ProstCodec::default();
496            let path = http::uri::PathAndQuery::from_static(
497                "/nominal.workspaces.v1.WorkspaceService/UpdateWorkspace",
498            );
499            let mut req = request.into_request();
500            req.extensions_mut()
501                .insert(
502                    GrpcMethod::new(
503                        "nominal.workspaces.v1.WorkspaceService",
504                        "UpdateWorkspace",
505                    ),
506                );
507            self.inner.unary(req, path, codec).await
508        }
509        pub async fn get_default_workspace(
510            &mut self,
511            request: impl tonic::IntoRequest<super::GetDefaultWorkspaceRequest>,
512        ) -> std::result::Result<
513            tonic::Response<super::GetDefaultWorkspaceResponse>,
514            tonic::Status,
515        > {
516            self.inner
517                .ready()
518                .await
519                .map_err(|e| {
520                    tonic::Status::unknown(
521                        format!("Service was not ready: {}", e.into()),
522                    )
523                })?;
524            let codec = tonic::codec::ProstCodec::default();
525            let path = http::uri::PathAndQuery::from_static(
526                "/nominal.workspaces.v1.WorkspaceService/GetDefaultWorkspace",
527            );
528            let mut req = request.into_request();
529            req.extensions_mut()
530                .insert(
531                    GrpcMethod::new(
532                        "nominal.workspaces.v1.WorkspaceService",
533                        "GetDefaultWorkspace",
534                    ),
535                );
536            self.inner.unary(req, path, codec).await
537        }
538    }
539}