// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct SearchNode {
    #[prost(
        oneof = "search_node::Filter",
        tags = "1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21"
    )]
    pub filter: ::core::option::Option<search_node::Filter>,
}
/// Nested message and enum types in `SearchNode`.
pub mod search_node {
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct Dupe {
        #[prost(int64, tag = "1")]
        pub notetype_id: i64,
        #[prost(string, tag = "2")]
        pub first_field: ::prost::alloc::string::String,
    }
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    #[must_use]
pub struct Rated {
        #[prost(uint32, tag = "1")]
        pub days: u32,
        #[prost(enumeration = "Rating", tag = "2")]
        pub rating: i32,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct IdList {
        #[prost(int64, repeated, tag = "1")]
        pub ids: ::prost::alloc::vec::Vec<i64>,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct Group {
        #[prost(message, repeated, tag = "1")]
        pub nodes: ::prost::alloc::vec::Vec<super::SearchNode>,
        #[prost(enumeration = "group::Joiner", tag = "2")]
        pub joiner: i32,
    }
    /// Nested message and enum types in `Group`.
    pub mod group {
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        #[must_use]
pub enum Joiner {
            And = 0,
            Or = 1,
        }
        impl Joiner {
            /// 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::And => "AND",
                    Self::Or => "OR",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "AND" => Some(Self::And),
                    "OR" => Some(Self::Or),
                    _ => None,
                }
            }
        }
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct Field {
        #[prost(string, tag = "1")]
        pub field_name: ::prost::alloc::string::String,
        #[prost(string, tag = "2")]
        pub text: ::prost::alloc::string::String,
        #[prost(enumeration = "FieldSearchMode", tag = "3")]
        pub mode: i32,
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum Flag {
        None = 0,
        Any = 1,
        Red = 2,
        Orange = 3,
        Green = 4,
        Blue = 5,
        Pink = 6,
        Turquoise = 7,
        Purple = 8,
    }
    impl Flag {
        /// 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::None => "FLAG_NONE",
                Self::Any => "FLAG_ANY",
                Self::Red => "FLAG_RED",
                Self::Orange => "FLAG_ORANGE",
                Self::Green => "FLAG_GREEN",
                Self::Blue => "FLAG_BLUE",
                Self::Pink => "FLAG_PINK",
                Self::Turquoise => "FLAG_TURQUOISE",
                Self::Purple => "FLAG_PURPLE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "FLAG_NONE" => Some(Self::None),
                "FLAG_ANY" => Some(Self::Any),
                "FLAG_RED" => Some(Self::Red),
                "FLAG_ORANGE" => Some(Self::Orange),
                "FLAG_GREEN" => Some(Self::Green),
                "FLAG_BLUE" => Some(Self::Blue),
                "FLAG_PINK" => Some(Self::Pink),
                "FLAG_TURQUOISE" => Some(Self::Turquoise),
                "FLAG_PURPLE" => Some(Self::Purple),
                _ => None,
            }
        }
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum Rating {
        Any = 0,
        Again = 1,
        Hard = 2,
        Good = 3,
        Easy = 4,
        ByReschedule = 5,
    }
    impl Rating {
        /// 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::Any => "RATING_ANY",
                Self::Again => "RATING_AGAIN",
                Self::Hard => "RATING_HARD",
                Self::Good => "RATING_GOOD",
                Self::Easy => "RATING_EASY",
                Self::ByReschedule => "RATING_BY_RESCHEDULE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "RATING_ANY" => Some(Self::Any),
                "RATING_AGAIN" => Some(Self::Again),
                "RATING_HARD" => Some(Self::Hard),
                "RATING_GOOD" => Some(Self::Good),
                "RATING_EASY" => Some(Self::Easy),
                "RATING_BY_RESCHEDULE" => Some(Self::ByReschedule),
                _ => None,
            }
        }
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum CardState {
        New = 0,
        Learn = 1,
        Review = 2,
        Due = 3,
        Suspended = 4,
        Buried = 5,
    }
    impl CardState {
        /// 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::New => "CARD_STATE_NEW",
                Self::Learn => "CARD_STATE_LEARN",
                Self::Review => "CARD_STATE_REVIEW",
                Self::Due => "CARD_STATE_DUE",
                Self::Suspended => "CARD_STATE_SUSPENDED",
                Self::Buried => "CARD_STATE_BURIED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "CARD_STATE_NEW" => Some(Self::New),
                "CARD_STATE_LEARN" => Some(Self::Learn),
                "CARD_STATE_REVIEW" => Some(Self::Review),
                "CARD_STATE_DUE" => Some(Self::Due),
                "CARD_STATE_SUSPENDED" => Some(Self::Suspended),
                "CARD_STATE_BURIED" => Some(Self::Buried),
                _ => None,
            }
        }
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum FieldSearchMode {
        Normal = 0,
        Regex = 1,
        Nocombining = 2,
    }
    impl FieldSearchMode {
        /// 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::Normal => "FIELD_SEARCH_MODE_NORMAL",
                Self::Regex => "FIELD_SEARCH_MODE_REGEX",
                Self::Nocombining => "FIELD_SEARCH_MODE_NOCOMBINING",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "FIELD_SEARCH_MODE_NORMAL" => Some(Self::Normal),
                "FIELD_SEARCH_MODE_REGEX" => Some(Self::Regex),
                "FIELD_SEARCH_MODE_NOCOMBINING" => Some(Self::Nocombining),
                _ => None,
            }
        }
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    #[must_use]
pub enum Filter {
        #[prost(message, tag = "1")]
        Group(Group),
        #[prost(message, tag = "2")]
        Negated(::prost::alloc::boxed::Box<super::SearchNode>),
        #[prost(string, tag = "3")]
        ParsableText(::prost::alloc::string::String),
        #[prost(uint32, tag = "4")]
        Template(u32),
        #[prost(int64, tag = "5")]
        Nid(i64),
        #[prost(message, tag = "6")]
        Dupe(Dupe),
        #[prost(string, tag = "7")]
        FieldName(::prost::alloc::string::String),
        #[prost(message, tag = "8")]
        Rated(Rated),
        #[prost(uint32, tag = "9")]
        AddedInDays(u32),
        #[prost(int32, tag = "10")]
        DueInDays(i32),
        #[prost(enumeration = "Flag", tag = "11")]
        Flag(i32),
        #[prost(enumeration = "CardState", tag = "12")]
        CardState(i32),
        #[prost(message, tag = "13")]
        Nids(IdList),
        #[prost(uint32, tag = "14")]
        EditedInDays(u32),
        #[prost(string, tag = "15")]
        Deck(::prost::alloc::string::String),
        #[prost(int32, tag = "16")]
        DueOnDay(i32),
        #[prost(string, tag = "17")]
        Tag(::prost::alloc::string::String),
        #[prost(string, tag = "18")]
        Note(::prost::alloc::string::String),
        #[prost(uint32, tag = "19")]
        IntroducedInDays(u32),
        #[prost(message, tag = "20")]
        Field(Field),
        #[prost(string, tag = "21")]
        LiteralText(::prost::alloc::string::String),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct SearchRequest {
    #[prost(string, tag = "1")]
    pub search: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub order: ::core::option::Option<SortOrder>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct SearchResponse {
    #[prost(int64, repeated, tag = "1")]
    pub ids: ::prost::alloc::vec::Vec<i64>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct SortOrder {
    #[prost(oneof = "sort_order::Value", tags = "1, 2, 3")]
    pub value: ::core::option::Option<sort_order::Value>,
}
/// Nested message and enum types in `SortOrder`.
pub mod sort_order {
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct Builtin {
        #[prost(string, tag = "1")]
        pub column: ::prost::alloc::string::String,
        #[prost(bool, tag = "2")]
        pub reverse: bool,
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    #[must_use]
pub enum Value {
        #[prost(message, tag = "1")]
        None(super::super::generic::Empty),
        #[prost(string, tag = "2")]
        Custom(::prost::alloc::string::String),
        #[prost(message, tag = "3")]
        Builtin(Builtin),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct JoinSearchNodesRequest {
    #[prost(enumeration = "search_node::group::Joiner", tag = "1")]
    pub joiner: i32,
    #[prost(message, optional, tag = "2")]
    pub existing_node: ::core::option::Option<SearchNode>,
    #[prost(message, optional, tag = "3")]
    pub additional_node: ::core::option::Option<SearchNode>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct ReplaceSearchNodeRequest {
    #[prost(message, optional, tag = "1")]
    pub existing_node: ::core::option::Option<SearchNode>,
    #[prost(message, optional, tag = "2")]
    pub replacement_node: ::core::option::Option<SearchNode>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct FindAndReplaceRequest {
    #[prost(int64, repeated, tag = "1")]
    pub nids: ::prost::alloc::vec::Vec<i64>,
    #[prost(string, tag = "2")]
    pub search: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub replacement: ::prost::alloc::string::String,
    #[prost(bool, tag = "4")]
    pub regex: bool,
    #[prost(bool, tag = "5")]
    pub match_case: bool,
    #[prost(string, tag = "6")]
    pub field_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct BrowserColumns {
    #[prost(message, repeated, tag = "1")]
    pub columns: ::prost::alloc::vec::Vec<browser_columns::Column>,
}
/// Nested message and enum types in `BrowserColumns`.
pub mod browser_columns {
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct Column {
        #[prost(string, tag = "1")]
        pub key: ::prost::alloc::string::String,
        #[prost(string, tag = "2")]
        pub cards_mode_label: ::prost::alloc::string::String,
        #[prost(string, tag = "3")]
        pub notes_mode_label: ::prost::alloc::string::String,
        /// The default sort order
        #[prost(enumeration = "Sorting", tag = "4")]
        pub sorting_cards: i32,
        #[prost(enumeration = "Sorting", tag = "9")]
        pub sorting_notes: i32,
        #[prost(bool, tag = "5")]
        pub uses_cell_font: bool,
        #[prost(enumeration = "Alignment", tag = "6")]
        pub alignment: i32,
        #[prost(string, tag = "7")]
        pub cards_mode_tooltip: ::prost::alloc::string::String,
        #[prost(string, tag = "8")]
        pub notes_mode_tooltip: ::prost::alloc::string::String,
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum Sorting {
        None = 0,
        Ascending = 1,
        Descending = 2,
    }
    impl Sorting {
        /// 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::None => "SORTING_NONE",
                Self::Ascending => "SORTING_ASCENDING",
                Self::Descending => "SORTING_DESCENDING",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "SORTING_NONE" => Some(Self::None),
                "SORTING_ASCENDING" => Some(Self::Ascending),
                "SORTING_DESCENDING" => Some(Self::Descending),
                _ => None,
            }
        }
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum Alignment {
        Start = 0,
        Center = 1,
    }
    impl Alignment {
        /// 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::Start => "ALIGNMENT_START",
                Self::Center => "ALIGNMENT_CENTER",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "ALIGNMENT_START" => Some(Self::Start),
                "ALIGNMENT_CENTER" => Some(Self::Center),
                _ => None,
            }
        }
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct BrowserRow {
    #[prost(message, repeated, tag = "1")]
    pub cells: ::prost::alloc::vec::Vec<browser_row::Cell>,
    #[prost(enumeration = "browser_row::Color", tag = "2")]
    pub color: i32,
    #[prost(string, tag = "3")]
    pub font_name: ::prost::alloc::string::String,
    #[prost(uint32, tag = "4")]
    pub font_size: u32,
}
/// Nested message and enum types in `BrowserRow`.
pub mod browser_row {
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct Cell {
        #[prost(string, tag = "1")]
        pub text: ::prost::alloc::string::String,
        #[prost(bool, tag = "2")]
        pub is_rtl: bool,
        #[prost(enumeration = "cell::TextElideMode", tag = "3")]
        pub elide_mode: i32,
    }
    /// Nested message and enum types in `Cell`.
    pub mod cell {
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        #[must_use]
pub enum TextElideMode {
            ElideLeft = 0,
            ElideRight = 1,
            ElideMiddle = 2,
            ElideNone = 3,
        }
        impl TextElideMode {
            /// 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::ElideLeft => "ElideLeft",
                    Self::ElideRight => "ElideRight",
                    Self::ElideMiddle => "ElideMiddle",
                    Self::ElideNone => "ElideNone",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "ElideLeft" => Some(Self::ElideLeft),
                    "ElideRight" => Some(Self::ElideRight),
                    "ElideMiddle" => Some(Self::ElideMiddle),
                    "ElideNone" => Some(Self::ElideNone),
                    _ => None,
                }
            }
        }
    }
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum Color {
        Default = 0,
        Marked = 1,
        Suspended = 2,
        FlagRed = 3,
        FlagOrange = 4,
        FlagGreen = 5,
        FlagBlue = 6,
        FlagPink = 7,
        FlagTurquoise = 8,
        FlagPurple = 9,
        Buried = 10,
    }
    impl Color {
        /// 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::Default => "COLOR_DEFAULT",
                Self::Marked => "COLOR_MARKED",
                Self::Suspended => "COLOR_SUSPENDED",
                Self::FlagRed => "COLOR_FLAG_RED",
                Self::FlagOrange => "COLOR_FLAG_ORANGE",
                Self::FlagGreen => "COLOR_FLAG_GREEN",
                Self::FlagBlue => "COLOR_FLAG_BLUE",
                Self::FlagPink => "COLOR_FLAG_PINK",
                Self::FlagTurquoise => "COLOR_FLAG_TURQUOISE",
                Self::FlagPurple => "COLOR_FLAG_PURPLE",
                Self::Buried => "COLOR_BURIED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "COLOR_DEFAULT" => Some(Self::Default),
                "COLOR_MARKED" => Some(Self::Marked),
                "COLOR_SUSPENDED" => Some(Self::Suspended),
                "COLOR_FLAG_RED" => Some(Self::FlagRed),
                "COLOR_FLAG_ORANGE" => Some(Self::FlagOrange),
                "COLOR_FLAG_GREEN" => Some(Self::FlagGreen),
                "COLOR_FLAG_BLUE" => Some(Self::FlagBlue),
                "COLOR_FLAG_PINK" => Some(Self::FlagPink),
                "COLOR_FLAG_TURQUOISE" => Some(Self::FlagTurquoise),
                "COLOR_FLAG_PURPLE" => Some(Self::FlagPurple),
                "COLOR_BURIED" => Some(Self::Buried),
                _ => None,
            }
        }
    }
}
