#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchQuery {
#[prost(message, optional, tag = "9")]
pub relation: ::core::option::Option<SearchRelation>,
#[prost(message, optional, tag = "1")]
pub sort: ::core::option::Option<SearchSortOption>,
#[prost(int32, tag = "3")]
pub offset: i32,
#[prost(int32, tag = "4")]
pub length: i32,
#[prost(int32, tag = "5")]
pub page: i32,
#[prost(message, optional, tag = "6")]
pub filter: ::core::option::Option<SearchFilter>,
#[prost(bool, tag = "7")]
pub find_one: bool,
#[prost(bool, tag = "8")]
pub find_all: bool,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchRelation {
#[prost(int32, repeated, tag = "1")]
pub parent_ids: ::prost::alloc::vec::Vec<i32>,
#[prost(string, repeated, tag = "2")]
pub child_type: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchFilter {
#[prost(message, repeated, tag = "1")]
pub must: ::prost::alloc::vec::Vec<SearchCondition>,
#[prost(message, repeated, tag = "2")]
pub any: ::prost::alloc::vec::Vec<SearchCondition>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchCondition {
#[prost(string, tag = "1")]
pub field: ::prost::alloc::string::String,
#[prost(enumeration = "SearchOperator", tag = "2")]
pub operator: i32,
#[prost(float, optional, tag = "5")]
pub threshold: ::core::option::Option<f32>,
#[prost(string, optional, tag = "3")]
pub value: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "6")]
pub value_to: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "4")]
pub value_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchResultMetadata {
#[prost(int32, tag = "1")]
pub result_items: i32,
#[prost(int32, tag = "2")]
pub offset: i32,
#[prost(int32, tag = "3")]
pub length: i32,
#[prost(int32, tag = "4")]
pub page: i32,
#[prost(int32, tag = "5")]
pub result_total_pages: i32,
#[prost(int32, tag = "6")]
pub result_total_items: i32,
#[prost(message, optional, tag = "7")]
pub query: ::core::option::Option<SearchQuery>,
#[prost(int32, optional, tag = "9")]
pub filter_count: ::core::option::Option<i32>,
#[prost(string, optional, tag = "10")]
pub filter_reason: ::core::option::Option<::prost::alloc::string::String>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SearchSortOption {
#[prost(string, tag = "1")]
pub field: ::prost::alloc::string::String,
#[prost(enumeration = "SortDirection", tag = "2")]
pub order: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SearchOperator {
Unspecified = 0,
Like = 21,
NotLike = 22,
Ilike = 23,
NotIlike = 24,
Similar = 27,
Equals = 1,
NotEquals = 2,
GreaterThan = 3,
GreaterThanOrEquals = 4,
LessThan = 5,
LessThanOrEquals = 6,
In = 7,
NotIn = 8,
Contains = 9,
NotContains = 10,
StartsWith = 11,
NotStartsWith = 12,
EndsWith = 13,
NotEndsWith = 14,
Exists = 15,
NotExists = 16,
IsNull = 17,
IsNotNull = 18,
IsTrue = 19,
IsFalse = 20,
Between = 25,
NotBetween = 26,
}
impl SearchOperator {
pub fn as_str_name(&self) -> &'static str {
match self {
SearchOperator::Unspecified => "SEARCH_OPERATOR_UNSPECIFIED",
SearchOperator::Like => "SEARCH_OPERATOR_LIKE",
SearchOperator::NotLike => "SEARCH_OPERATOR_NOT_LIKE",
SearchOperator::Ilike => "SEARCH_OPERATOR_ILIKE",
SearchOperator::NotIlike => "SEARCH_OPERATOR_NOT_ILIKE",
SearchOperator::Similar => "SEARCH_OPERATOR_SIMILAR",
SearchOperator::Equals => "SEARCH_OPERATOR_EQUALS",
SearchOperator::NotEquals => "SEARCH_OPERATOR_NOT_EQUALS",
SearchOperator::GreaterThan => "SEARCH_OPERATOR_GREATER_THAN",
SearchOperator::GreaterThanOrEquals => {
"SEARCH_OPERATOR_GREATER_THAN_OR_EQUALS"
}
SearchOperator::LessThan => "SEARCH_OPERATOR_LESS_THAN",
SearchOperator::LessThanOrEquals => "SEARCH_OPERATOR_LESS_THAN_OR_EQUALS",
SearchOperator::In => "SEARCH_OPERATOR_IN",
SearchOperator::NotIn => "SEARCH_OPERATOR_NOT_IN",
SearchOperator::Contains => "SEARCH_OPERATOR_CONTAINS",
SearchOperator::NotContains => "SEARCH_OPERATOR_NOT_CONTAINS",
SearchOperator::StartsWith => "SEARCH_OPERATOR_STARTS_WITH",
SearchOperator::NotStartsWith => "SEARCH_OPERATOR_NOT_STARTS_WITH",
SearchOperator::EndsWith => "SEARCH_OPERATOR_ENDS_WITH",
SearchOperator::NotEndsWith => "SEARCH_OPERATOR_NOT_ENDS_WITH",
SearchOperator::Exists => "SEARCH_OPERATOR_EXISTS",
SearchOperator::NotExists => "SEARCH_OPERATOR_NOT_EXISTS",
SearchOperator::IsNull => "SEARCH_OPERATOR_IS_NULL",
SearchOperator::IsNotNull => "SEARCH_OPERATOR_IS_NOT_NULL",
SearchOperator::IsTrue => "SEARCH_OPERATOR_IS_TRUE",
SearchOperator::IsFalse => "SEARCH_OPERATOR_IS_FALSE",
SearchOperator::Between => "SEARCH_OPERATOR_BETWEEN",
SearchOperator::NotBetween => "SEARCH_OPERATOR_NOT_BETWEEN",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SEARCH_OPERATOR_UNSPECIFIED" => Some(Self::Unspecified),
"SEARCH_OPERATOR_LIKE" => Some(Self::Like),
"SEARCH_OPERATOR_NOT_LIKE" => Some(Self::NotLike),
"SEARCH_OPERATOR_ILIKE" => Some(Self::Ilike),
"SEARCH_OPERATOR_NOT_ILIKE" => Some(Self::NotIlike),
"SEARCH_OPERATOR_SIMILAR" => Some(Self::Similar),
"SEARCH_OPERATOR_EQUALS" => Some(Self::Equals),
"SEARCH_OPERATOR_NOT_EQUALS" => Some(Self::NotEquals),
"SEARCH_OPERATOR_GREATER_THAN" => Some(Self::GreaterThan),
"SEARCH_OPERATOR_GREATER_THAN_OR_EQUALS" => Some(Self::GreaterThanOrEquals),
"SEARCH_OPERATOR_LESS_THAN" => Some(Self::LessThan),
"SEARCH_OPERATOR_LESS_THAN_OR_EQUALS" => Some(Self::LessThanOrEquals),
"SEARCH_OPERATOR_IN" => Some(Self::In),
"SEARCH_OPERATOR_NOT_IN" => Some(Self::NotIn),
"SEARCH_OPERATOR_CONTAINS" => Some(Self::Contains),
"SEARCH_OPERATOR_NOT_CONTAINS" => Some(Self::NotContains),
"SEARCH_OPERATOR_STARTS_WITH" => Some(Self::StartsWith),
"SEARCH_OPERATOR_NOT_STARTS_WITH" => Some(Self::NotStartsWith),
"SEARCH_OPERATOR_ENDS_WITH" => Some(Self::EndsWith),
"SEARCH_OPERATOR_NOT_ENDS_WITH" => Some(Self::NotEndsWith),
"SEARCH_OPERATOR_EXISTS" => Some(Self::Exists),
"SEARCH_OPERATOR_NOT_EXISTS" => Some(Self::NotExists),
"SEARCH_OPERATOR_IS_NULL" => Some(Self::IsNull),
"SEARCH_OPERATOR_IS_NOT_NULL" => Some(Self::IsNotNull),
"SEARCH_OPERATOR_IS_TRUE" => Some(Self::IsTrue),
"SEARCH_OPERATOR_IS_FALSE" => Some(Self::IsFalse),
"SEARCH_OPERATOR_BETWEEN" => Some(Self::Between),
"SEARCH_OPERATOR_NOT_BETWEEN" => Some(Self::NotBetween),
_ => None,
}
}
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum SortDirection {
Unspecified = 0,
Asc = 1,
Desc = 2,
}
impl SortDirection {
pub fn as_str_name(&self) -> &'static str {
match self {
SortDirection::Unspecified => "SORT_DIRECTION_UNSPECIFIED",
SortDirection::Asc => "SORT_DIRECTION_ASC",
SortDirection::Desc => "SORT_DIRECTION_DESC",
}
}
pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
match value {
"SORT_DIRECTION_UNSPECIFIED" => Some(Self::Unspecified),
"SORT_DIRECTION_ASC" => Some(Self::Asc),
"SORT_DIRECTION_DESC" => Some(Self::Desc),
_ => None,
}
}
}