Skip to main content

nominal_api_proto/proto/
nominal.nova.v1.rs

1// This file is @generated by prost-build.
2#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct App {
4    #[prost(string, tag = "1")]
5    pub rid: ::prost::alloc::string::String,
6    #[prost(string, tag = "2")]
7    pub workspace_rid: ::prost::alloc::string::String,
8    #[prost(string, tag = "3")]
9    pub name: ::prost::alloc::string::String,
10    #[prost(string, tag = "4")]
11    pub title: ::prost::alloc::string::String,
12    #[prost(string, tag = "5")]
13    pub description: ::prost::alloc::string::String,
14    #[prost(string, repeated, tag = "6")]
15    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
16    #[prost(map = "string, string", tag = "7")]
17    pub properties: ::std::collections::HashMap<
18        ::prost::alloc::string::String,
19        ::prost::alloc::string::String,
20    >,
21    #[prost(string, tag = "8")]
22    pub created_by_user_rid: ::prost::alloc::string::String,
23    #[prost(message, optional, tag = "9")]
24    pub created_at: ::core::option::Option<
25        super::super::super::google::protobuf::Timestamp,
26    >,
27    #[prost(message, optional, tag = "10")]
28    pub updated_at: ::core::option::Option<
29        super::super::super::google::protobuf::Timestamp,
30    >,
31    #[prost(bool, optional, tag = "11")]
32    pub is_archived: ::core::option::Option<bool>,
33    #[prost(string, optional, tag = "12")]
34    pub embed_path: ::core::option::Option<::prost::alloc::string::String>,
35    #[prost(string, optional, tag = "13")]
36    pub archive_sha256: ::core::option::Option<::prost::alloc::string::String>,
37}
38#[derive(Clone, PartialEq, ::prost::Message)]
39pub struct BundleSignature {
40    #[prost(string, tag = "1")]
41    pub key_id: ::prost::alloc::string::String,
42    #[prost(bytes = "vec", tag = "2")]
43    pub signature: ::prost::alloc::vec::Vec<u8>,
44}
45#[derive(Clone, PartialEq, ::prost::Message)]
46pub struct SignedAppBundle {
47    #[prost(string, tag = "1")]
48    pub upload_object_key: ::prost::alloc::string::String,
49    #[prost(message, optional, tag = "2")]
50    pub signature: ::core::option::Option<BundleSignature>,
51}
52#[derive(Clone, PartialEq, ::prost::Message)]
53pub struct CreateAppRequest {
54    #[prost(message, optional, tag = "1")]
55    pub app: ::core::option::Option<App>,
56    #[prost(message, optional, tag = "2")]
57    pub signed_bundle: ::core::option::Option<SignedAppBundle>,
58}
59#[derive(Clone, PartialEq, ::prost::Message)]
60pub struct CreateAppResponse {
61    #[prost(message, optional, tag = "1")]
62    pub app: ::core::option::Option<App>,
63}
64#[derive(Clone, PartialEq, ::prost::Message)]
65pub struct GetAppRequest {
66    #[prost(string, tag = "1")]
67    pub app_rid: ::prost::alloc::string::String,
68}
69#[derive(Clone, PartialEq, ::prost::Message)]
70pub struct GetAppResponse {
71    #[prost(message, optional, tag = "1")]
72    pub app: ::core::option::Option<App>,
73}
74#[derive(Clone, PartialEq, ::prost::Message)]
75pub struct UpdateAppRequest {
76    #[prost(string, tag = "1")]
77    pub app_rid: ::prost::alloc::string::String,
78    #[prost(message, optional, tag = "2")]
79    pub app: ::core::option::Option<App>,
80    #[prost(message, optional, tag = "3")]
81    pub signed_bundle: ::core::option::Option<SignedAppBundle>,
82}
83#[derive(Clone, PartialEq, ::prost::Message)]
84pub struct UpdateAppResponse {
85    #[prost(message, optional, tag = "1")]
86    pub app: ::core::option::Option<App>,
87}
88#[derive(Clone, PartialEq, ::prost::Message)]
89pub struct DeleteAppRequest {
90    #[prost(string, tag = "1")]
91    pub app_rid: ::prost::alloc::string::String,
92}
93#[derive(Clone, Copy, PartialEq, ::prost::Message)]
94pub struct DeleteAppResponse {}
95#[derive(Clone, PartialEq, ::prost::Message)]
96pub struct AppSearchFilter {
97    #[prost(string, optional, tag = "1")]
98    pub name_contains: ::core::option::Option<::prost::alloc::string::String>,
99    #[prost(bool, optional, tag = "2")]
100    pub include_archived: ::core::option::Option<bool>,
101    #[prost(string, repeated, tag = "3")]
102    pub created_by_user_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
103    #[prost(string, repeated, tag = "4")]
104    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
105}
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct SearchAppsRequest {
108    #[prost(string, tag = "1")]
109    pub workspace_rid: ::prost::alloc::string::String,
110    #[prost(message, optional, tag = "2")]
111    pub filter: ::core::option::Option<AppSearchFilter>,
112    #[prost(enumeration = "SearchAppsSortField", tag = "3")]
113    pub sort_field: i32,
114    #[prost(bool, tag = "4")]
115    pub descending: bool,
116    #[prost(int32, optional, tag = "5")]
117    pub page_size: ::core::option::Option<i32>,
118    #[prost(string, optional, tag = "6")]
119    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
120}
121#[derive(Clone, PartialEq, ::prost::Message)]
122pub struct SearchAppsResponse {
123    #[prost(message, repeated, tag = "1")]
124    pub apps: ::prost::alloc::vec::Vec<App>,
125    #[prost(string, optional, tag = "2")]
126    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
127}
128#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct SearchAppLabelsRequest {
130    #[prost(string, tag = "1")]
131    pub workspace_rid: ::prost::alloc::string::String,
132    #[prost(int32, optional, tag = "2")]
133    pub page_size: ::core::option::Option<i32>,
134    #[prost(string, optional, tag = "3")]
135    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
136}
137#[derive(Clone, PartialEq, ::prost::Message)]
138pub struct SearchAppLabelsResponse {
139    #[prost(string, repeated, tag = "1")]
140    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
141    #[prost(string, optional, tag = "2")]
142    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
143}
144#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
145#[repr(i32)]
146pub enum NovaError {
147    AppNotFound = 0,
148    AppNameTaken = 1,
149    AppNameImmutable = 2,
150    ServerAssignedFieldSet = 3,
151    InvalidPageToken = 4,
152    InvalidBundle = 5,
153    BundleVerificationFailed = 6,
154    AppUpdateConflict = 7,
155}
156impl NovaError {
157    /// String value of the enum field names used in the ProtoBuf definition.
158    ///
159    /// The values are not transformed in any way and thus are considered stable
160    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
161    pub fn as_str_name(&self) -> &'static str {
162        match self {
163            Self::AppNotFound => "NOVA_ERROR_APP_NOT_FOUND",
164            Self::AppNameTaken => "NOVA_ERROR_APP_NAME_TAKEN",
165            Self::AppNameImmutable => "NOVA_ERROR_APP_NAME_IMMUTABLE",
166            Self::ServerAssignedFieldSet => "NOVA_ERROR_SERVER_ASSIGNED_FIELD_SET",
167            Self::InvalidPageToken => "NOVA_ERROR_INVALID_PAGE_TOKEN",
168            Self::InvalidBundle => "NOVA_ERROR_INVALID_BUNDLE",
169            Self::BundleVerificationFailed => "NOVA_ERROR_BUNDLE_VERIFICATION_FAILED",
170            Self::AppUpdateConflict => "NOVA_ERROR_APP_UPDATE_CONFLICT",
171        }
172    }
173    /// Creates an enum from field names used in the ProtoBuf definition.
174    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
175        match value {
176            "NOVA_ERROR_APP_NOT_FOUND" => Some(Self::AppNotFound),
177            "NOVA_ERROR_APP_NAME_TAKEN" => Some(Self::AppNameTaken),
178            "NOVA_ERROR_APP_NAME_IMMUTABLE" => Some(Self::AppNameImmutable),
179            "NOVA_ERROR_SERVER_ASSIGNED_FIELD_SET" => Some(Self::ServerAssignedFieldSet),
180            "NOVA_ERROR_INVALID_PAGE_TOKEN" => Some(Self::InvalidPageToken),
181            "NOVA_ERROR_INVALID_BUNDLE" => Some(Self::InvalidBundle),
182            "NOVA_ERROR_BUNDLE_VERIFICATION_FAILED" => {
183                Some(Self::BundleVerificationFailed)
184            }
185            "NOVA_ERROR_APP_UPDATE_CONFLICT" => Some(Self::AppUpdateConflict),
186            _ => None,
187        }
188    }
189}
190#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
191#[repr(i32)]
192pub enum SearchAppsSortField {
193    Unspecified = 0,
194    Title = 1,
195    CreatedAt = 2,
196    UpdatedAt = 3,
197}
198impl SearchAppsSortField {
199    /// String value of the enum field names used in the ProtoBuf definition.
200    ///
201    /// The values are not transformed in any way and thus are considered stable
202    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
203    pub fn as_str_name(&self) -> &'static str {
204        match self {
205            Self::Unspecified => "SEARCH_APPS_SORT_FIELD_UNSPECIFIED",
206            Self::Title => "SEARCH_APPS_SORT_FIELD_TITLE",
207            Self::CreatedAt => "SEARCH_APPS_SORT_FIELD_CREATED_AT",
208            Self::UpdatedAt => "SEARCH_APPS_SORT_FIELD_UPDATED_AT",
209        }
210    }
211    /// Creates an enum from field names used in the ProtoBuf definition.
212    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
213        match value {
214            "SEARCH_APPS_SORT_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
215            "SEARCH_APPS_SORT_FIELD_TITLE" => Some(Self::Title),
216            "SEARCH_APPS_SORT_FIELD_CREATED_AT" => Some(Self::CreatedAt),
217            "SEARCH_APPS_SORT_FIELD_UPDATED_AT" => Some(Self::UpdatedAt),
218            _ => None,
219        }
220    }
221}
222/// Generated client implementations.
223pub mod nova_service_client {
224    #![allow(
225        unused_variables,
226        dead_code,
227        missing_docs,
228        clippy::wildcard_imports,
229        clippy::let_unit_value,
230    )]
231    use tonic::codegen::*;
232    use tonic::codegen::http::Uri;
233    #[derive(Debug, Clone)]
234    pub struct NovaServiceClient<T> {
235        inner: tonic::client::Grpc<T>,
236    }
237    impl NovaServiceClient<tonic::transport::Channel> {
238        /// Attempt to create a new client by connecting to a given endpoint.
239        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
240        where
241            D: TryInto<tonic::transport::Endpoint>,
242            D::Error: Into<StdError>,
243        {
244            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
245            Ok(Self::new(conn))
246        }
247    }
248    impl<T> NovaServiceClient<T>
249    where
250        T: tonic::client::GrpcService<tonic::body::Body>,
251        T::Error: Into<StdError>,
252        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
253        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
254    {
255        pub fn new(inner: T) -> Self {
256            let inner = tonic::client::Grpc::new(inner);
257            Self { inner }
258        }
259        pub fn with_origin(inner: T, origin: Uri) -> Self {
260            let inner = tonic::client::Grpc::with_origin(inner, origin);
261            Self { inner }
262        }
263        pub fn with_interceptor<F>(
264            inner: T,
265            interceptor: F,
266        ) -> NovaServiceClient<InterceptedService<T, F>>
267        where
268            F: tonic::service::Interceptor,
269            T::ResponseBody: Default,
270            T: tonic::codegen::Service<
271                http::Request<tonic::body::Body>,
272                Response = http::Response<
273                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
274                >,
275            >,
276            <T as tonic::codegen::Service<
277                http::Request<tonic::body::Body>,
278            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
279        {
280            NovaServiceClient::new(InterceptedService::new(inner, interceptor))
281        }
282        /// Compress requests with the given encoding.
283        ///
284        /// This requires the server to support it otherwise it might respond with an
285        /// error.
286        #[must_use]
287        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
288            self.inner = self.inner.send_compressed(encoding);
289            self
290        }
291        /// Enable decompressing responses.
292        #[must_use]
293        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
294            self.inner = self.inner.accept_compressed(encoding);
295            self
296        }
297        /// Limits the maximum size of a decoded message.
298        ///
299        /// Default: `4MB`
300        #[must_use]
301        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
302            self.inner = self.inner.max_decoding_message_size(limit);
303            self
304        }
305        /// Limits the maximum size of an encoded message.
306        ///
307        /// Default: `usize::MAX`
308        #[must_use]
309        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
310            self.inner = self.inner.max_encoding_message_size(limit);
311            self
312        }
313        pub async fn create_app(
314            &mut self,
315            request: impl tonic::IntoRequest<super::CreateAppRequest>,
316        ) -> std::result::Result<
317            tonic::Response<super::CreateAppResponse>,
318            tonic::Status,
319        > {
320            self.inner
321                .ready()
322                .await
323                .map_err(|e| {
324                    tonic::Status::unknown(
325                        format!("Service was not ready: {}", e.into()),
326                    )
327                })?;
328            let codec = tonic::codec::ProstCodec::default();
329            let path = http::uri::PathAndQuery::from_static(
330                "/nominal.nova.v1.NovaService/CreateApp",
331            );
332            let mut req = request.into_request();
333            req.extensions_mut()
334                .insert(GrpcMethod::new("nominal.nova.v1.NovaService", "CreateApp"));
335            self.inner.unary(req, path, codec).await
336        }
337        pub async fn get_app(
338            &mut self,
339            request: impl tonic::IntoRequest<super::GetAppRequest>,
340        ) -> std::result::Result<tonic::Response<super::GetAppResponse>, tonic::Status> {
341            self.inner
342                .ready()
343                .await
344                .map_err(|e| {
345                    tonic::Status::unknown(
346                        format!("Service was not ready: {}", e.into()),
347                    )
348                })?;
349            let codec = tonic::codec::ProstCodec::default();
350            let path = http::uri::PathAndQuery::from_static(
351                "/nominal.nova.v1.NovaService/GetApp",
352            );
353            let mut req = request.into_request();
354            req.extensions_mut()
355                .insert(GrpcMethod::new("nominal.nova.v1.NovaService", "GetApp"));
356            self.inner.unary(req, path, codec).await
357        }
358        pub async fn update_app(
359            &mut self,
360            request: impl tonic::IntoRequest<super::UpdateAppRequest>,
361        ) -> std::result::Result<
362            tonic::Response<super::UpdateAppResponse>,
363            tonic::Status,
364        > {
365            self.inner
366                .ready()
367                .await
368                .map_err(|e| {
369                    tonic::Status::unknown(
370                        format!("Service was not ready: {}", e.into()),
371                    )
372                })?;
373            let codec = tonic::codec::ProstCodec::default();
374            let path = http::uri::PathAndQuery::from_static(
375                "/nominal.nova.v1.NovaService/UpdateApp",
376            );
377            let mut req = request.into_request();
378            req.extensions_mut()
379                .insert(GrpcMethod::new("nominal.nova.v1.NovaService", "UpdateApp"));
380            self.inner.unary(req, path, codec).await
381        }
382        pub async fn delete_app(
383            &mut self,
384            request: impl tonic::IntoRequest<super::DeleteAppRequest>,
385        ) -> std::result::Result<
386            tonic::Response<super::DeleteAppResponse>,
387            tonic::Status,
388        > {
389            self.inner
390                .ready()
391                .await
392                .map_err(|e| {
393                    tonic::Status::unknown(
394                        format!("Service was not ready: {}", e.into()),
395                    )
396                })?;
397            let codec = tonic::codec::ProstCodec::default();
398            let path = http::uri::PathAndQuery::from_static(
399                "/nominal.nova.v1.NovaService/DeleteApp",
400            );
401            let mut req = request.into_request();
402            req.extensions_mut()
403                .insert(GrpcMethod::new("nominal.nova.v1.NovaService", "DeleteApp"));
404            self.inner.unary(req, path, codec).await
405        }
406        pub async fn search_apps(
407            &mut self,
408            request: impl tonic::IntoRequest<super::SearchAppsRequest>,
409        ) -> std::result::Result<
410            tonic::Response<super::SearchAppsResponse>,
411            tonic::Status,
412        > {
413            self.inner
414                .ready()
415                .await
416                .map_err(|e| {
417                    tonic::Status::unknown(
418                        format!("Service was not ready: {}", e.into()),
419                    )
420                })?;
421            let codec = tonic::codec::ProstCodec::default();
422            let path = http::uri::PathAndQuery::from_static(
423                "/nominal.nova.v1.NovaService/SearchApps",
424            );
425            let mut req = request.into_request();
426            req.extensions_mut()
427                .insert(GrpcMethod::new("nominal.nova.v1.NovaService", "SearchApps"));
428            self.inner.unary(req, path, codec).await
429        }
430        pub async fn search_app_labels(
431            &mut self,
432            request: impl tonic::IntoRequest<super::SearchAppLabelsRequest>,
433        ) -> std::result::Result<
434            tonic::Response<super::SearchAppLabelsResponse>,
435            tonic::Status,
436        > {
437            self.inner
438                .ready()
439                .await
440                .map_err(|e| {
441                    tonic::Status::unknown(
442                        format!("Service was not ready: {}", e.into()),
443                    )
444                })?;
445            let codec = tonic::codec::ProstCodec::default();
446            let path = http::uri::PathAndQuery::from_static(
447                "/nominal.nova.v1.NovaService/SearchAppLabels",
448            );
449            let mut req = request.into_request();
450            req.extensions_mut()
451                .insert(
452                    GrpcMethod::new("nominal.nova.v1.NovaService", "SearchAppLabels"),
453                );
454            self.inner.unary(req, path, codec).await
455        }
456    }
457}