// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindSimilarLabelMatchesRequest {
    #[prost(enumeration = "ResourceType", repeated, tag = "1")]
    pub resource_types: ::prost::alloc::vec::Vec<i32>,
    #[prost(string, repeated, tag = "2")]
    pub workspaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "3")]
    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindSimilarLabelMatchesResponse {
    #[prost(map = "string, message", tag = "1")]
    pub matches: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        find_similar_label_matches_response::FindSimilarLabelMatchesResponseMatchesWrapper,
    >,
}
/// Nested message and enum types in `FindSimilarLabelMatchesResponse`.
pub mod find_similar_label_matches_response {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct FindSimilarLabelMatchesResponseMatchesWrapper {
        #[prost(message, repeated, tag = "1")]
        pub value: ::prost::alloc::vec::Vec<super::MatchCount>,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindSimilarPropertyKeyMatchesRequest {
    #[prost(enumeration = "ResourceType", repeated, tag = "1")]
    pub resource_types: ::prost::alloc::vec::Vec<i32>,
    #[prost(string, repeated, tag = "2")]
    pub workspaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "3")]
    pub property_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FindSimilarPropertyKeyMatchesResponse {
    #[prost(map = "string, message", tag = "1")]
    pub key_matches: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        find_similar_property_key_matches_response::FindSimilarPropertyKeyMatchesResponseKeyMatchesWrapper,
    >,
}
/// Nested message and enum types in `FindSimilarPropertyKeyMatchesResponse`.
pub mod find_similar_property_key_matches_response {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct FindSimilarPropertyKeyMatchesResponseKeyMatchesWrapper {
        #[prost(message, repeated, tag = "1")]
        pub value: ::prost::alloc::vec::Vec<super::MatchCount>,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetMetadataUsageCountRequest {
    #[prost(message, optional, tag = "1")]
    pub query: ::core::option::Option<MetadataUsageQuery>,
    #[prost(enumeration = "ResourceType", repeated, tag = "2")]
    pub resource_types: ::prost::alloc::vec::Vec<i32>,
    #[prost(string, repeated, tag = "3")]
    pub workspaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct GetMetadataUsageCountResponse {
    #[prost(int32, tag = "1")]
    pub count: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct LabelWithCount {
    #[prost(string, tag = "1")]
    pub label: ::prost::alloc::string::String,
    #[prost(int32, tag = "2")]
    pub document_count: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPropertiesAndLabelsRequest {
    #[prost(enumeration = "ResourceType", repeated, tag = "1")]
    pub resource_types: ::prost::alloc::vec::Vec<i32>,
    #[prost(string, repeated, tag = "2")]
    pub workspaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListPropertiesAndLabelsResponse {
    #[prost(map = "string, message", tag = "1")]
    pub properties: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        list_properties_and_labels_response::ListPropertiesAndLabelsResponsePropertiesWrapper,
    >,
    #[prost(string, repeated, tag = "2")]
    pub labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Nested message and enum types in `ListPropertiesAndLabelsResponse`.
pub mod list_properties_and_labels_response {
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ListPropertiesAndLabelsResponsePropertiesWrapper {
        #[prost(string, repeated, tag = "1")]
        pub value: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MatchCount {
    #[prost(string, tag = "1")]
    pub value: ::prost::alloc::string::String,
    #[prost(int32, tag = "2")]
    pub document_count: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MetadataUsageQuery {
    #[prost(oneof = "metadata_usage_query::MetadataUsageQuery", tags = "1, 2, 3")]
    pub metadata_usage_query: ::core::option::Option<
        metadata_usage_query::MetadataUsageQuery,
    >,
}
/// Nested message and enum types in `MetadataUsageQuery`.
pub mod metadata_usage_query {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum MetadataUsageQuery {
        #[prost(string, tag = "1")]
        Label(::prost::alloc::string::String),
        #[prost(string, tag = "2")]
        PropertyName(::prost::alloc::string::String),
        #[prost(message, tag = "3")]
        Property(super::super::super::types::Property),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PropertyKeyWithCount {
    #[prost(string, tag = "1")]
    pub property_key: ::prost::alloc::string::String,
    #[prost(int32, tag = "2")]
    pub document_count: i32,
    #[prost(int32, tag = "3")]
    pub value_count: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PropertyValueWithCount {
    #[prost(string, tag = "1")]
    pub property_value: ::prost::alloc::string::String,
    #[prost(int32, tag = "2")]
    pub document_count: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchLabelsResponse {
    #[prost(message, repeated, tag = "1")]
    pub labels: ::prost::alloc::vec::Vec<LabelWithCount>,
    #[prost(string, optional, tag = "2")]
    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchMetadataRequest {
    #[prost(enumeration = "ResourceType", repeated, tag = "1")]
    pub resource_types: ::prost::alloc::vec::Vec<i32>,
    #[prost(string, repeated, tag = "2")]
    pub workspaces: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, optional, tag = "3")]
    pub search_text: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(int32, optional, tag = "4")]
    pub page_size: ::core::option::Option<i32>,
    #[prost(string, optional, tag = "5")]
    pub page_token: ::core::option::Option<::prost::alloc::string::String>,
    #[prost(enumeration = "MetadataSortField", tag = "6")]
    pub sort_by: i32,
    #[prost(bool, optional, tag = "7")]
    pub descending: ::core::option::Option<bool>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchPropertyKeysResponse {
    #[prost(message, repeated, tag = "1")]
    pub property_keys: ::prost::alloc::vec::Vec<PropertyKeyWithCount>,
    #[prost(string, optional, tag = "2")]
    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchPropertyValuesRequest {
    #[prost(message, optional, tag = "1")]
    pub search: ::core::option::Option<SearchMetadataRequest>,
    #[prost(string, tag = "2")]
    pub property_key: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchPropertyValuesResponse {
    #[prost(message, repeated, tag = "1")]
    pub property_values: ::prost::alloc::vec::Vec<PropertyValueWithCount>,
    #[prost(string, optional, tag = "2")]
    pub next_page_token: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MetadataSortField {
    Unspecified = 0,
    Alphabetical = 1,
    UsageCount = 2,
    PropertyValueCount = 3,
}
impl MetadataSortField {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "METADATA_SORT_FIELD_UNSPECIFIED",
            Self::Alphabetical => "ALPHABETICAL",
            Self::UsageCount => "USAGE_COUNT",
            Self::PropertyValueCount => "PROPERTY_VALUE_COUNT",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "METADATA_SORT_FIELD_UNSPECIFIED" => Some(Self::Unspecified),
            "ALPHABETICAL" => Some(Self::Alphabetical),
            "USAGE_COUNT" => Some(Self::UsageCount),
            "PROPERTY_VALUE_COUNT" => Some(Self::PropertyValueCount),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum ResourceType {
    Unspecified = 0,
    Run = 1,
    Video = 2,
    Asset = 3,
    Event = 4,
    Dataset = 5,
    Module = 6,
    ProcedureExecution = 7,
    Procedure = 8,
    SavedView = 9,
}
impl ResourceType {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::Unspecified => "RESOURCE_TYPE_UNSPECIFIED",
            Self::Run => "RUN",
            Self::Video => "VIDEO",
            Self::Asset => "ASSET",
            Self::Event => "EVENT",
            Self::Dataset => "DATASET",
            Self::Module => "MODULE",
            Self::ProcedureExecution => "PROCEDURE_EXECUTION",
            Self::Procedure => "PROCEDURE",
            Self::SavedView => "SAVED_VIEW",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "RESOURCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "RUN" => Some(Self::Run),
            "VIDEO" => Some(Self::Video),
            "ASSET" => Some(Self::Asset),
            "EVENT" => Some(Self::Event),
            "DATASET" => Some(Self::Dataset),
            "MODULE" => Some(Self::Module),
            "PROCEDURE_EXECUTION" => Some(Self::ProcedureExecution),
            "PROCEDURE" => Some(Self::Procedure),
            "SAVED_VIEW" => Some(Self::SavedView),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum MetadataError {
    InvalidMetadataRequest = 0,
}
impl MetadataError {
    /// String value of the enum field names used in the ProtoBuf definition.
    ///
    /// The values are not transformed in any way and thus are considered stable
    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
    pub fn as_str_name(&self) -> &'static str {
        match self {
            Self::InvalidMetadataRequest => "METADATA_ERROR_INVALID_METADATA_REQUEST",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "METADATA_ERROR_INVALID_METADATA_REQUEST" => {
                Some(Self::InvalidMetadataRequest)
            }
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod resource_metadata_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    #[derive(Debug, Clone)]
    pub struct ResourceMetadataServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl ResourceMetadataServiceClient<tonic::transport::Channel> {
        /// Attempt to create a new client by connecting to a given endpoint.
        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
        where
            D: TryInto<tonic::transport::Endpoint>,
            D::Error: Into<StdError>,
        {
            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
            Ok(Self::new(conn))
        }
    }
    impl<T> ResourceMetadataServiceClient<T>
    where
        T: tonic::client::GrpcService<tonic::body::Body>,
        T::Error: Into<StdError>,
        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
    {
        pub fn new(inner: T) -> Self {
            let inner = tonic::client::Grpc::new(inner);
            Self { inner }
        }
        pub fn with_origin(inner: T, origin: Uri) -> Self {
            let inner = tonic::client::Grpc::with_origin(inner, origin);
            Self { inner }
        }
        pub fn with_interceptor<F>(
            inner: T,
            interceptor: F,
        ) -> ResourceMetadataServiceClient<InterceptedService<T, F>>
        where
            F: tonic::service::Interceptor,
            T::ResponseBody: Default,
            T: tonic::codegen::Service<
                http::Request<tonic::body::Body>,
                Response = http::Response<
                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
                >,
            >,
            <T as tonic::codegen::Service<
                http::Request<tonic::body::Body>,
            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
        {
            ResourceMetadataServiceClient::new(
                InterceptedService::new(inner, interceptor),
            )
        }
        /// Compress requests with the given encoding.
        ///
        /// This requires the server to support it otherwise it might respond with an
        /// error.
        #[must_use]
        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.send_compressed(encoding);
            self
        }
        /// Enable decompressing responses.
        #[must_use]
        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
            self.inner = self.inner.accept_compressed(encoding);
            self
        }
        /// Limits the maximum size of a decoded message.
        ///
        /// Default: `4MB`
        #[must_use]
        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_decoding_message_size(limit);
            self
        }
        /// Limits the maximum size of an encoded message.
        ///
        /// Default: `usize::MAX`
        #[must_use]
        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
            self.inner = self.inner.max_encoding_message_size(limit);
            self
        }
        pub async fn list_properties_and_labels(
            &mut self,
            request: impl tonic::IntoRequest<super::ListPropertiesAndLabelsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListPropertiesAndLabelsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.metadata.v1.ResourceMetadataService/ListPropertiesAndLabels",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.metadata.v1.ResourceMetadataService",
                        "ListPropertiesAndLabels",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn get_metadata_usage_count(
            &mut self,
            request: impl tonic::IntoRequest<super::GetMetadataUsageCountRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetMetadataUsageCountResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.metadata.v1.ResourceMetadataService/GetMetadataUsageCount",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.metadata.v1.ResourceMetadataService",
                        "GetMetadataUsageCount",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn find_similar_label_matches(
            &mut self,
            request: impl tonic::IntoRequest<super::FindSimilarLabelMatchesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::FindSimilarLabelMatchesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.metadata.v1.ResourceMetadataService/FindSimilarLabelMatches",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.metadata.v1.ResourceMetadataService",
                        "FindSimilarLabelMatches",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn find_similar_property_key_matches(
            &mut self,
            request: impl tonic::IntoRequest<super::FindSimilarPropertyKeyMatchesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::FindSimilarPropertyKeyMatchesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.metadata.v1.ResourceMetadataService/FindSimilarPropertyKeyMatches",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.metadata.v1.ResourceMetadataService",
                        "FindSimilarPropertyKeyMatches",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn search_labels(
            &mut self,
            request: impl tonic::IntoRequest<super::SearchMetadataRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SearchLabelsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.metadata.v1.ResourceMetadataService/SearchLabels",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.metadata.v1.ResourceMetadataService",
                        "SearchLabels",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn search_property_keys(
            &mut self,
            request: impl tonic::IntoRequest<super::SearchMetadataRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SearchPropertyKeysResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.metadata.v1.ResourceMetadataService/SearchPropertyKeys",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.metadata.v1.ResourceMetadataService",
                        "SearchPropertyKeys",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        pub async fn search_property_values(
            &mut self,
            request: impl tonic::IntoRequest<super::SearchPropertyValuesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::SearchPropertyValuesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic::codec::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/nominal.metadata.v1.ResourceMetadataService/SearchPropertyValues",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "nominal.metadata.v1.ResourceMetadataService",
                        "SearchPropertyValues",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
