1#[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}
34#[derive(Clone, PartialEq, ::prost::Message)]
35pub struct CreateAppRequest {
36 #[prost(message, optional, tag = "1")]
37 pub app: ::core::option::Option<App>,
38}
39#[derive(Clone, PartialEq, ::prost::Message)]
40pub struct CreateAppResponse {
41 #[prost(message, optional, tag = "1")]
42 pub app: ::core::option::Option<App>,
43}
44#[derive(Clone, PartialEq, ::prost::Message)]
45pub struct GetAppRequest {
46 #[prost(string, tag = "1")]
47 pub app_rid: ::prost::alloc::string::String,
48}
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct GetAppResponse {
51 #[prost(message, optional, tag = "1")]
52 pub app: ::core::option::Option<App>,
53}
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct UpdateAppRequest {
56 #[prost(string, tag = "1")]
57 pub app_rid: ::prost::alloc::string::String,
58 #[prost(message, optional, tag = "2")]
59 pub app: ::core::option::Option<App>,
60}
61#[derive(Clone, PartialEq, ::prost::Message)]
62pub struct UpdateAppResponse {
63 #[prost(message, optional, tag = "1")]
64 pub app: ::core::option::Option<App>,
65}
66#[derive(Clone, PartialEq, ::prost::Message)]
67pub struct DeleteAppRequest {
68 #[prost(string, tag = "1")]
69 pub app_rid: ::prost::alloc::string::String,
70}
71#[derive(Clone, Copy, PartialEq, ::prost::Message)]
72pub struct DeleteAppResponse {}
73#[derive(Clone, PartialEq, ::prost::Message)]
74pub struct AppSearchFilter {
75 #[prost(string, optional, tag = "1")]
76 pub name_contains: ::core::option::Option<::prost::alloc::string::String>,
77 #[prost(bool, optional, tag = "2")]
78 pub include_archived: ::core::option::Option<bool>,
79 #[prost(string, repeated, tag = "3")]
80 pub created_by_user_rids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
81 #[prost(string, repeated, tag = "4")]
82 pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
83}
84#[derive(Clone, PartialEq, ::prost::Message)]
85pub struct SearchAppsRequest {
86 #[prost(string, tag = "1")]
87 pub workspace_rid: ::prost::alloc::string::String,
88 #[prost(message, optional, tag = "2")]
89 pub filter: ::core::option::Option<AppSearchFilter>,
90 #[prost(enumeration = "SearchAppsSortField", tag = "3")]
91 pub sort_field: i32,
92 #[prost(bool, tag = "4")]
93 pub descending: bool,
94 #[prost(int32, optional, tag = "5")]
95 pub page_size: ::core::option::Option<i32>,
96 #[prost(string, optional, tag = "6")]
97 pub page_token: ::core::option::Option<::prost::alloc::string::String>,
98}
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct SearchAppsResponse {
101 #[prost(message, repeated, tag = "1")]
102 pub apps: ::prost::alloc::vec::Vec<App>,
103 #[prost(string, optional, tag = "2")]
104 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
105}
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct SearchAppLabelsRequest {
108 #[prost(string, tag = "1")]
109 pub workspace_rid: ::prost::alloc::string::String,
110 #[prost(int32, optional, tag = "2")]
111 pub page_size: ::core::option::Option<i32>,
112 #[prost(string, optional, tag = "3")]
113 pub page_token: ::core::option::Option<::prost::alloc::string::String>,
114}
115#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct SearchAppLabelsResponse {
117 #[prost(string, repeated, tag = "1")]
118 pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
119 #[prost(string, optional, tag = "2")]
120 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
121}
122#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
123#[repr(i32)]
124pub enum NovaError {
125 AppNotFound = 0,
126 AppNameTaken = 1,
127 AppNameImmutable = 2,
128 ServerAssignedFieldSet = 3,
129 InvalidPageToken = 4,
130}
131impl NovaError {
132 pub fn as_str_name(&self) -> &'static str {
137 match self {
138 Self::AppNotFound => "NOVA_ERROR_APP_NOT_FOUND",
139 Self::AppNameTaken => "NOVA_ERROR_APP_NAME_TAKEN",
140 Self::AppNameImmutable => "NOVA_ERROR_APP_NAME_IMMUTABLE",
141 Self::ServerAssignedFieldSet => "NOVA_ERROR_SERVER_ASSIGNED_FIELD_SET",
142 Self::InvalidPageToken => "NOVA_ERROR_INVALID_PAGE_TOKEN",
143 }
144 }
145 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
147 match value {
148 "NOVA_ERROR_APP_NOT_FOUND" => Some(Self::AppNotFound),
149 "NOVA_ERROR_APP_NAME_TAKEN" => Some(Self::AppNameTaken),
150 "NOVA_ERROR_APP_NAME_IMMUTABLE" => Some(Self::AppNameImmutable),
151 "NOVA_ERROR_SERVER_ASSIGNED_FIELD_SET" => Some(Self::ServerAssignedFieldSet),
152 "NOVA_ERROR_INVALID_PAGE_TOKEN" => Some(Self::InvalidPageToken),
153 _ => None,
154 }
155 }
156}
157#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
158#[repr(i32)]
159pub enum SearchAppsSortField {
160 Unspecified = 0,
161 Title = 1,
162 CreatedAt = 2,
163 UpdatedAt = 3,
164}
165impl SearchAppsSortField {
166 pub fn as_str_name(&self) -> &'static str {
171 match self {
172 Self::Unspecified => "SEARCH_APPS_SORT_FIELD_UNSPECIFIED",
173 Self::Title => "SEARCH_APPS_SORT_FIELD_TITLE",
174 Self::CreatedAt => "SEARCH_APPS_SORT_FIELD_CREATED_AT",
175 Self::UpdatedAt => "SEARCH_APPS_SORT_FIELD_UPDATED_AT",
176 }
177 }
178 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
180 match value {
181 "SEARCH_APPS_SORT_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
182 "SEARCH_APPS_SORT_FIELD_TITLE" => Some(Self::Title),
183 "SEARCH_APPS_SORT_FIELD_CREATED_AT" => Some(Self::CreatedAt),
184 "SEARCH_APPS_SORT_FIELD_UPDATED_AT" => Some(Self::UpdatedAt),
185 _ => None,
186 }
187 }
188}
189pub mod nova_service_client {
191 #![allow(
192 unused_variables,
193 dead_code,
194 missing_docs,
195 clippy::wildcard_imports,
196 clippy::let_unit_value,
197 )]
198 use tonic::codegen::*;
199 use tonic::codegen::http::Uri;
200 #[derive(Debug, Clone)]
201 pub struct NovaServiceClient<T> {
202 inner: tonic::client::Grpc<T>,
203 }
204 impl NovaServiceClient<tonic::transport::Channel> {
205 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
207 where
208 D: TryInto<tonic::transport::Endpoint>,
209 D::Error: Into<StdError>,
210 {
211 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
212 Ok(Self::new(conn))
213 }
214 }
215 impl<T> NovaServiceClient<T>
216 where
217 T: tonic::client::GrpcService<tonic::body::Body>,
218 T::Error: Into<StdError>,
219 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
220 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
221 {
222 pub fn new(inner: T) -> Self {
223 let inner = tonic::client::Grpc::new(inner);
224 Self { inner }
225 }
226 pub fn with_origin(inner: T, origin: Uri) -> Self {
227 let inner = tonic::client::Grpc::with_origin(inner, origin);
228 Self { inner }
229 }
230 pub fn with_interceptor<F>(
231 inner: T,
232 interceptor: F,
233 ) -> NovaServiceClient<InterceptedService<T, F>>
234 where
235 F: tonic::service::Interceptor,
236 T::ResponseBody: Default,
237 T: tonic::codegen::Service<
238 http::Request<tonic::body::Body>,
239 Response = http::Response<
240 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
241 >,
242 >,
243 <T as tonic::codegen::Service<
244 http::Request<tonic::body::Body>,
245 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
246 {
247 NovaServiceClient::new(InterceptedService::new(inner, interceptor))
248 }
249 #[must_use]
254 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
255 self.inner = self.inner.send_compressed(encoding);
256 self
257 }
258 #[must_use]
260 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
261 self.inner = self.inner.accept_compressed(encoding);
262 self
263 }
264 #[must_use]
268 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
269 self.inner = self.inner.max_decoding_message_size(limit);
270 self
271 }
272 #[must_use]
276 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
277 self.inner = self.inner.max_encoding_message_size(limit);
278 self
279 }
280 pub async fn create_app(
281 &mut self,
282 request: impl tonic::IntoRequest<super::CreateAppRequest>,
283 ) -> std::result::Result<
284 tonic::Response<super::CreateAppResponse>,
285 tonic::Status,
286 > {
287 self.inner
288 .ready()
289 .await
290 .map_err(|e| {
291 tonic::Status::unknown(
292 format!("Service was not ready: {}", e.into()),
293 )
294 })?;
295 let codec = tonic::codec::ProstCodec::default();
296 let path = http::uri::PathAndQuery::from_static(
297 "/nominal.nova.v1.NovaService/CreateApp",
298 );
299 let mut req = request.into_request();
300 req.extensions_mut()
301 .insert(GrpcMethod::new("nominal.nova.v1.NovaService", "CreateApp"));
302 self.inner.unary(req, path, codec).await
303 }
304 pub async fn get_app(
305 &mut self,
306 request: impl tonic::IntoRequest<super::GetAppRequest>,
307 ) -> std::result::Result<tonic::Response<super::GetAppResponse>, tonic::Status> {
308 self.inner
309 .ready()
310 .await
311 .map_err(|e| {
312 tonic::Status::unknown(
313 format!("Service was not ready: {}", e.into()),
314 )
315 })?;
316 let codec = tonic::codec::ProstCodec::default();
317 let path = http::uri::PathAndQuery::from_static(
318 "/nominal.nova.v1.NovaService/GetApp",
319 );
320 let mut req = request.into_request();
321 req.extensions_mut()
322 .insert(GrpcMethod::new("nominal.nova.v1.NovaService", "GetApp"));
323 self.inner.unary(req, path, codec).await
324 }
325 pub async fn update_app(
326 &mut self,
327 request: impl tonic::IntoRequest<super::UpdateAppRequest>,
328 ) -> std::result::Result<
329 tonic::Response<super::UpdateAppResponse>,
330 tonic::Status,
331 > {
332 self.inner
333 .ready()
334 .await
335 .map_err(|e| {
336 tonic::Status::unknown(
337 format!("Service was not ready: {}", e.into()),
338 )
339 })?;
340 let codec = tonic::codec::ProstCodec::default();
341 let path = http::uri::PathAndQuery::from_static(
342 "/nominal.nova.v1.NovaService/UpdateApp",
343 );
344 let mut req = request.into_request();
345 req.extensions_mut()
346 .insert(GrpcMethod::new("nominal.nova.v1.NovaService", "UpdateApp"));
347 self.inner.unary(req, path, codec).await
348 }
349 pub async fn delete_app(
350 &mut self,
351 request: impl tonic::IntoRequest<super::DeleteAppRequest>,
352 ) -> std::result::Result<
353 tonic::Response<super::DeleteAppResponse>,
354 tonic::Status,
355 > {
356 self.inner
357 .ready()
358 .await
359 .map_err(|e| {
360 tonic::Status::unknown(
361 format!("Service was not ready: {}", e.into()),
362 )
363 })?;
364 let codec = tonic::codec::ProstCodec::default();
365 let path = http::uri::PathAndQuery::from_static(
366 "/nominal.nova.v1.NovaService/DeleteApp",
367 );
368 let mut req = request.into_request();
369 req.extensions_mut()
370 .insert(GrpcMethod::new("nominal.nova.v1.NovaService", "DeleteApp"));
371 self.inner.unary(req, path, codec).await
372 }
373 pub async fn search_apps(
374 &mut self,
375 request: impl tonic::IntoRequest<super::SearchAppsRequest>,
376 ) -> std::result::Result<
377 tonic::Response<super::SearchAppsResponse>,
378 tonic::Status,
379 > {
380 self.inner
381 .ready()
382 .await
383 .map_err(|e| {
384 tonic::Status::unknown(
385 format!("Service was not ready: {}", e.into()),
386 )
387 })?;
388 let codec = tonic::codec::ProstCodec::default();
389 let path = http::uri::PathAndQuery::from_static(
390 "/nominal.nova.v1.NovaService/SearchApps",
391 );
392 let mut req = request.into_request();
393 req.extensions_mut()
394 .insert(GrpcMethod::new("nominal.nova.v1.NovaService", "SearchApps"));
395 self.inner.unary(req, path, codec).await
396 }
397 pub async fn search_app_labels(
398 &mut self,
399 request: impl tonic::IntoRequest<super::SearchAppLabelsRequest>,
400 ) -> std::result::Result<
401 tonic::Response<super::SearchAppLabelsResponse>,
402 tonic::Status,
403 > {
404 self.inner
405 .ready()
406 .await
407 .map_err(|e| {
408 tonic::Status::unknown(
409 format!("Service was not ready: {}", e.into()),
410 )
411 })?;
412 let codec = tonic::codec::ProstCodec::default();
413 let path = http::uri::PathAndQuery::from_static(
414 "/nominal.nova.v1.NovaService/SearchAppLabels",
415 );
416 let mut req = request.into_request();
417 req.extensions_mut()
418 .insert(
419 GrpcMethod::new("nominal.nova.v1.NovaService", "SearchAppLabels"),
420 );
421 self.inner.unary(req, path, codec).await
422 }
423 }
424}