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