1#[derive(Clone, PartialEq, ::prost::Message)]
3pub struct MatchCount {
4 #[prost(string, tag = "1")]
5 pub value: ::prost::alloc::string::String,
6 #[prost(int32, tag = "2")]
7 pub document_count: i32,
8}
9#[derive(Clone, PartialEq, ::prost::Message)]
10pub struct LabelWithCount {
11 #[prost(string, tag = "1")]
12 pub label: ::prost::alloc::string::String,
13 #[prost(int32, tag = "2")]
14 pub document_count: i32,
15}
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct PropertyKeyWithCount {
18 #[prost(string, tag = "1")]
19 pub property_key: ::prost::alloc::string::String,
20 #[prost(int32, tag = "2")]
21 pub document_count: i32,
22 #[prost(int32, tag = "3")]
23 pub value_count: i32,
24}
25#[derive(Clone, PartialEq, ::prost::Message)]
26pub struct PropertyValueWithCount {
27 #[prost(string, tag = "1")]
28 pub property_value: ::prost::alloc::string::String,
29 #[prost(int32, tag = "2")]
30 pub document_count: i32,
31}
32#[derive(Clone, PartialEq, ::prost::Message)]
33pub struct ListPropertiesAndLabelsRequest {
34 #[prost(enumeration = "ResourceType", repeated, tag = "1")]
35 pub resource_types: ::prost::alloc::vec::Vec<i32>,
36 #[prost(string, repeated, tag = "2")]
37 pub workspaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
38}
39#[derive(Clone, PartialEq, ::prost::Message)]
40pub struct ListPropertiesAndLabelsResponse {
41 #[prost(map = "string, message", tag = "1")]
42 pub properties: ::std::collections::HashMap<
43 ::prost::alloc::string::String,
44 list_properties_and_labels_response::PropertyValues,
45 >,
46 #[prost(string, repeated, tag = "2")]
47 pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
48}
49pub mod list_properties_and_labels_response {
51 #[derive(Clone, PartialEq, ::prost::Message)]
52 pub struct PropertyValues {
53 #[prost(string, repeated, tag = "1")]
54 pub value: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
55 }
56}
57#[derive(Clone, PartialEq, ::prost::Message)]
58pub struct MetadataUsageQuery {
59 #[prost(oneof = "metadata_usage_query::MetadataUsageQuery", tags = "1, 2, 3")]
60 pub metadata_usage_query: ::core::option::Option<
61 metadata_usage_query::MetadataUsageQuery,
62 >,
63}
64pub mod metadata_usage_query {
66 #[derive(Clone, PartialEq, ::prost::Oneof)]
67 pub enum MetadataUsageQuery {
68 #[prost(string, tag = "1")]
69 Label(::prost::alloc::string::String),
70 #[prost(string, tag = "2")]
71 PropertyName(::prost::alloc::string::String),
72 #[prost(message, tag = "3")]
73 Property(super::super::super::types::Property),
74 }
75}
76#[derive(Clone, PartialEq, ::prost::Message)]
77pub struct GetMetadataUsageCountRequest {
78 #[prost(message, optional, tag = "1")]
79 pub query: ::core::option::Option<MetadataUsageQuery>,
80 #[prost(enumeration = "ResourceType", repeated, tag = "2")]
81 pub resource_types: ::prost::alloc::vec::Vec<i32>,
82 #[prost(string, repeated, tag = "3")]
83 pub workspaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
84}
85#[derive(Clone, Copy, PartialEq, ::prost::Message)]
86pub struct GetMetadataUsageCountResponse {
87 #[prost(int32, tag = "1")]
88 pub count: i32,
89}
90#[derive(Clone, PartialEq, ::prost::Message)]
91pub struct FindSimilarLabelMatchesRequest {
92 #[prost(enumeration = "ResourceType", repeated, tag = "1")]
93 pub resource_types: ::prost::alloc::vec::Vec<i32>,
94 #[prost(string, repeated, tag = "2")]
95 pub workspaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
96 #[prost(string, repeated, tag = "3")]
97 pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
98}
99#[derive(Clone, PartialEq, ::prost::Message)]
100pub struct FindSimilarLabelMatchesResponse {
101 #[prost(map = "string, message", tag = "1")]
102 pub matches: ::std::collections::HashMap<
103 ::prost::alloc::string::String,
104 find_similar_label_matches_response::Matches,
105 >,
106}
107pub mod find_similar_label_matches_response {
109 #[derive(Clone, PartialEq, ::prost::Message)]
110 pub struct Matches {
111 #[prost(message, repeated, tag = "1")]
112 pub value: ::prost::alloc::vec::Vec<super::MatchCount>,
113 }
114}
115#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct FindSimilarPropertyKeyMatchesRequest {
117 #[prost(enumeration = "ResourceType", repeated, tag = "1")]
118 pub resource_types: ::prost::alloc::vec::Vec<i32>,
119 #[prost(string, repeated, tag = "2")]
120 pub workspaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
121 #[prost(string, repeated, tag = "3")]
122 pub property_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
123}
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct FindSimilarPropertyKeyMatchesResponse {
126 #[prost(map = "string, message", tag = "1")]
127 pub key_matches: ::std::collections::HashMap<
128 ::prost::alloc::string::String,
129 find_similar_property_key_matches_response::Matches,
130 >,
131}
132pub mod find_similar_property_key_matches_response {
134 #[derive(Clone, PartialEq, ::prost::Message)]
135 pub struct Matches {
136 #[prost(message, repeated, tag = "1")]
137 pub value: ::prost::alloc::vec::Vec<super::MatchCount>,
138 }
139}
140#[derive(Clone, PartialEq, ::prost::Message)]
141pub struct MetadataSearchParams {
142 #[prost(enumeration = "ResourceType", repeated, tag = "1")]
143 pub resource_types: ::prost::alloc::vec::Vec<i32>,
144 #[prost(string, repeated, tag = "2")]
145 pub workspaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
146 #[prost(string, optional, tag = "3")]
147 pub search_text: ::core::option::Option<::prost::alloc::string::String>,
148 #[prost(int32, optional, tag = "4")]
149 pub page_size: ::core::option::Option<i32>,
150 #[prost(string, optional, tag = "5")]
151 pub page_token: ::core::option::Option<::prost::alloc::string::String>,
152 #[prost(enumeration = "MetadataSortField", tag = "6")]
153 pub sort_by: i32,
154 #[prost(bool, optional, tag = "7")]
155 pub descending: ::core::option::Option<bool>,
156}
157#[derive(Clone, PartialEq, ::prost::Message)]
158pub struct SearchLabelsRequest {
159 #[prost(message, optional, tag = "1")]
160 pub params: ::core::option::Option<MetadataSearchParams>,
161}
162#[derive(Clone, PartialEq, ::prost::Message)]
163pub struct SearchLabelsResponse {
164 #[prost(message, repeated, tag = "1")]
165 pub labels: ::prost::alloc::vec::Vec<LabelWithCount>,
166 #[prost(string, optional, tag = "2")]
167 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
168}
169#[derive(Clone, PartialEq, ::prost::Message)]
170pub struct SearchPropertyKeysRequest {
171 #[prost(message, optional, tag = "1")]
172 pub params: ::core::option::Option<MetadataSearchParams>,
173}
174#[derive(Clone, PartialEq, ::prost::Message)]
175pub struct SearchPropertyKeysResponse {
176 #[prost(message, repeated, tag = "1")]
177 pub property_keys: ::prost::alloc::vec::Vec<PropertyKeyWithCount>,
178 #[prost(string, optional, tag = "2")]
179 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
180}
181#[derive(Clone, PartialEq, ::prost::Message)]
182pub struct SearchPropertyValuesRequest {
183 #[prost(message, optional, tag = "1")]
184 pub params: ::core::option::Option<MetadataSearchParams>,
185 #[prost(string, tag = "2")]
186 pub property_key: ::prost::alloc::string::String,
187}
188#[derive(Clone, PartialEq, ::prost::Message)]
189pub struct SearchPropertyValuesResponse {
190 #[prost(message, repeated, tag = "1")]
191 pub property_values: ::prost::alloc::vec::Vec<PropertyValueWithCount>,
192 #[prost(string, optional, tag = "2")]
193 pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
194}
195#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
196#[repr(i32)]
197pub enum ResourceType {
198 Unspecified = 0,
199 Run = 1,
200 Video = 2,
201 Asset = 3,
202 Event = 4,
203 Dataset = 5,
204 Module = 6,
205 ProcedureExecution = 7,
206 Procedure = 8,
207 SavedView = 9,
208}
209impl ResourceType {
210 pub fn as_str_name(&self) -> &'static str {
215 match self {
216 Self::Unspecified => "RESOURCE_TYPE_UNSPECIFIED",
217 Self::Run => "RUN",
218 Self::Video => "VIDEO",
219 Self::Asset => "ASSET",
220 Self::Event => "EVENT",
221 Self::Dataset => "DATASET",
222 Self::Module => "MODULE",
223 Self::ProcedureExecution => "PROCEDURE_EXECUTION",
224 Self::Procedure => "PROCEDURE",
225 Self::SavedView => "SAVED_VIEW",
226 }
227 }
228 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
230 match value {
231 "RESOURCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
232 "RUN" => Some(Self::Run),
233 "VIDEO" => Some(Self::Video),
234 "ASSET" => Some(Self::Asset),
235 "EVENT" => Some(Self::Event),
236 "DATASET" => Some(Self::Dataset),
237 "MODULE" => Some(Self::Module),
238 "PROCEDURE_EXECUTION" => Some(Self::ProcedureExecution),
239 "PROCEDURE" => Some(Self::Procedure),
240 "SAVED_VIEW" => Some(Self::SavedView),
241 _ => None,
242 }
243 }
244}
245#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
246#[repr(i32)]
247pub enum MetadataSortField {
248 Unspecified = 0,
249 Alphabetical = 1,
250 UsageCount = 2,
251 PropertyValueCount = 3,
252}
253impl MetadataSortField {
254 pub fn as_str_name(&self) -> &'static str {
259 match self {
260 Self::Unspecified => "METADATA_SORT_FIELD_UNSPECIFIED",
261 Self::Alphabetical => "ALPHABETICAL",
262 Self::UsageCount => "USAGE_COUNT",
263 Self::PropertyValueCount => "PROPERTY_VALUE_COUNT",
264 }
265 }
266 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
268 match value {
269 "METADATA_SORT_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
270 "ALPHABETICAL" => Some(Self::Alphabetical),
271 "USAGE_COUNT" => Some(Self::UsageCount),
272 "PROPERTY_VALUE_COUNT" => Some(Self::PropertyValueCount),
273 _ => None,
274 }
275 }
276}
277#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
278#[repr(i32)]
279pub enum MetadataError {
280 InvalidMetadataRequest = 0,
281}
282impl MetadataError {
283 pub fn as_str_name(&self) -> &'static str {
288 match self {
289 Self::InvalidMetadataRequest => "METADATA_ERROR_INVALID_METADATA_REQUEST",
290 }
291 }
292 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
294 match value {
295 "METADATA_ERROR_INVALID_METADATA_REQUEST" => {
296 Some(Self::InvalidMetadataRequest)
297 }
298 _ => None,
299 }
300 }
301}
302pub mod resource_metadata_service_client {
304 #![allow(
305 unused_variables,
306 dead_code,
307 missing_docs,
308 clippy::wildcard_imports,
309 clippy::let_unit_value,
310 )]
311 use tonic::codegen::*;
312 use tonic::codegen::http::Uri;
313 #[derive(Debug, Clone)]
314 pub struct ResourceMetadataServiceClient<T> {
315 inner: tonic::client::Grpc<T>,
316 }
317 impl ResourceMetadataServiceClient<tonic::transport::Channel> {
318 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
320 where
321 D: TryInto<tonic::transport::Endpoint>,
322 D::Error: Into<StdError>,
323 {
324 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
325 Ok(Self::new(conn))
326 }
327 }
328 impl<T> ResourceMetadataServiceClient<T>
329 where
330 T: tonic::client::GrpcService<tonic::body::Body>,
331 T::Error: Into<StdError>,
332 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
333 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
334 {
335 pub fn new(inner: T) -> Self {
336 let inner = tonic::client::Grpc::new(inner);
337 Self { inner }
338 }
339 pub fn with_origin(inner: T, origin: Uri) -> Self {
340 let inner = tonic::client::Grpc::with_origin(inner, origin);
341 Self { inner }
342 }
343 pub fn with_interceptor<F>(
344 inner: T,
345 interceptor: F,
346 ) -> ResourceMetadataServiceClient<InterceptedService<T, F>>
347 where
348 F: tonic::service::Interceptor,
349 T::ResponseBody: Default,
350 T: tonic::codegen::Service<
351 http::Request<tonic::body::Body>,
352 Response = http::Response<
353 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
354 >,
355 >,
356 <T as tonic::codegen::Service<
357 http::Request<tonic::body::Body>,
358 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
359 {
360 ResourceMetadataServiceClient::new(
361 InterceptedService::new(inner, interceptor),
362 )
363 }
364 #[must_use]
369 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
370 self.inner = self.inner.send_compressed(encoding);
371 self
372 }
373 #[must_use]
375 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
376 self.inner = self.inner.accept_compressed(encoding);
377 self
378 }
379 #[must_use]
383 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
384 self.inner = self.inner.max_decoding_message_size(limit);
385 self
386 }
387 #[must_use]
391 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
392 self.inner = self.inner.max_encoding_message_size(limit);
393 self
394 }
395 pub async fn list_properties_and_labels(
396 &mut self,
397 request: impl tonic::IntoRequest<super::ListPropertiesAndLabelsRequest>,
398 ) -> std::result::Result<
399 tonic::Response<super::ListPropertiesAndLabelsResponse>,
400 tonic::Status,
401 > {
402 self.inner
403 .ready()
404 .await
405 .map_err(|e| {
406 tonic::Status::unknown(
407 format!("Service was not ready: {}", e.into()),
408 )
409 })?;
410 let codec = tonic::codec::ProstCodec::default();
411 let path = http::uri::PathAndQuery::from_static(
412 "/nominal.metadata.v2.ResourceMetadataService/ListPropertiesAndLabels",
413 );
414 let mut req = request.into_request();
415 req.extensions_mut()
416 .insert(
417 GrpcMethod::new(
418 "nominal.metadata.v2.ResourceMetadataService",
419 "ListPropertiesAndLabels",
420 ),
421 );
422 self.inner.unary(req, path, codec).await
423 }
424 pub async fn get_metadata_usage_count(
425 &mut self,
426 request: impl tonic::IntoRequest<super::GetMetadataUsageCountRequest>,
427 ) -> std::result::Result<
428 tonic::Response<super::GetMetadataUsageCountResponse>,
429 tonic::Status,
430 > {
431 self.inner
432 .ready()
433 .await
434 .map_err(|e| {
435 tonic::Status::unknown(
436 format!("Service was not ready: {}", e.into()),
437 )
438 })?;
439 let codec = tonic::codec::ProstCodec::default();
440 let path = http::uri::PathAndQuery::from_static(
441 "/nominal.metadata.v2.ResourceMetadataService/GetMetadataUsageCount",
442 );
443 let mut req = request.into_request();
444 req.extensions_mut()
445 .insert(
446 GrpcMethod::new(
447 "nominal.metadata.v2.ResourceMetadataService",
448 "GetMetadataUsageCount",
449 ),
450 );
451 self.inner.unary(req, path, codec).await
452 }
453 pub async fn find_similar_label_matches(
454 &mut self,
455 request: impl tonic::IntoRequest<super::FindSimilarLabelMatchesRequest>,
456 ) -> std::result::Result<
457 tonic::Response<super::FindSimilarLabelMatchesResponse>,
458 tonic::Status,
459 > {
460 self.inner
461 .ready()
462 .await
463 .map_err(|e| {
464 tonic::Status::unknown(
465 format!("Service was not ready: {}", e.into()),
466 )
467 })?;
468 let codec = tonic::codec::ProstCodec::default();
469 let path = http::uri::PathAndQuery::from_static(
470 "/nominal.metadata.v2.ResourceMetadataService/FindSimilarLabelMatches",
471 );
472 let mut req = request.into_request();
473 req.extensions_mut()
474 .insert(
475 GrpcMethod::new(
476 "nominal.metadata.v2.ResourceMetadataService",
477 "FindSimilarLabelMatches",
478 ),
479 );
480 self.inner.unary(req, path, codec).await
481 }
482 pub async fn find_similar_property_key_matches(
483 &mut self,
484 request: impl tonic::IntoRequest<super::FindSimilarPropertyKeyMatchesRequest>,
485 ) -> std::result::Result<
486 tonic::Response<super::FindSimilarPropertyKeyMatchesResponse>,
487 tonic::Status,
488 > {
489 self.inner
490 .ready()
491 .await
492 .map_err(|e| {
493 tonic::Status::unknown(
494 format!("Service was not ready: {}", e.into()),
495 )
496 })?;
497 let codec = tonic::codec::ProstCodec::default();
498 let path = http::uri::PathAndQuery::from_static(
499 "/nominal.metadata.v2.ResourceMetadataService/FindSimilarPropertyKeyMatches",
500 );
501 let mut req = request.into_request();
502 req.extensions_mut()
503 .insert(
504 GrpcMethod::new(
505 "nominal.metadata.v2.ResourceMetadataService",
506 "FindSimilarPropertyKeyMatches",
507 ),
508 );
509 self.inner.unary(req, path, codec).await
510 }
511 pub async fn search_labels(
512 &mut self,
513 request: impl tonic::IntoRequest<super::SearchLabelsRequest>,
514 ) -> std::result::Result<
515 tonic::Response<super::SearchLabelsResponse>,
516 tonic::Status,
517 > {
518 self.inner
519 .ready()
520 .await
521 .map_err(|e| {
522 tonic::Status::unknown(
523 format!("Service was not ready: {}", e.into()),
524 )
525 })?;
526 let codec = tonic::codec::ProstCodec::default();
527 let path = http::uri::PathAndQuery::from_static(
528 "/nominal.metadata.v2.ResourceMetadataService/SearchLabels",
529 );
530 let mut req = request.into_request();
531 req.extensions_mut()
532 .insert(
533 GrpcMethod::new(
534 "nominal.metadata.v2.ResourceMetadataService",
535 "SearchLabels",
536 ),
537 );
538 self.inner.unary(req, path, codec).await
539 }
540 pub async fn search_property_keys(
541 &mut self,
542 request: impl tonic::IntoRequest<super::SearchPropertyKeysRequest>,
543 ) -> std::result::Result<
544 tonic::Response<super::SearchPropertyKeysResponse>,
545 tonic::Status,
546 > {
547 self.inner
548 .ready()
549 .await
550 .map_err(|e| {
551 tonic::Status::unknown(
552 format!("Service was not ready: {}", e.into()),
553 )
554 })?;
555 let codec = tonic::codec::ProstCodec::default();
556 let path = http::uri::PathAndQuery::from_static(
557 "/nominal.metadata.v2.ResourceMetadataService/SearchPropertyKeys",
558 );
559 let mut req = request.into_request();
560 req.extensions_mut()
561 .insert(
562 GrpcMethod::new(
563 "nominal.metadata.v2.ResourceMetadataService",
564 "SearchPropertyKeys",
565 ),
566 );
567 self.inner.unary(req, path, codec).await
568 }
569 pub async fn search_property_values(
570 &mut self,
571 request: impl tonic::IntoRequest<super::SearchPropertyValuesRequest>,
572 ) -> std::result::Result<
573 tonic::Response<super::SearchPropertyValuesResponse>,
574 tonic::Status,
575 > {
576 self.inner
577 .ready()
578 .await
579 .map_err(|e| {
580 tonic::Status::unknown(
581 format!("Service was not ready: {}", e.into()),
582 )
583 })?;
584 let codec = tonic::codec::ProstCodec::default();
585 let path = http::uri::PathAndQuery::from_static(
586 "/nominal.metadata.v2.ResourceMetadataService/SearchPropertyValues",
587 );
588 let mut req = request.into_request();
589 req.extensions_mut()
590 .insert(
591 GrpcMethod::new(
592 "nominal.metadata.v2.ResourceMetadataService",
593 "SearchPropertyValues",
594 ),
595 );
596 self.inner.unary(req, path, codec).await
597 }
598 }
599}