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