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