// This file is @generated by prost-build.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[must_use]
pub struct NotetypeId {
    #[prost(int64, tag = "1")]
    pub ntid: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct Notetype {
    #[prost(int64, tag = "1")]
    pub id: i64,
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    #[prost(int64, tag = "3")]
    pub mtime_secs: i64,
    #[prost(sint32, tag = "4")]
    pub usn: i32,
    #[prost(message, optional, tag = "7")]
    pub config: ::core::option::Option<notetype::Config>,
    #[prost(message, repeated, tag = "8")]
    pub fields: ::prost::alloc::vec::Vec<notetype::Field>,
    #[prost(message, repeated, tag = "9")]
    pub templates: ::prost::alloc::vec::Vec<notetype::Template>,
}
/// Nested message and enum types in `Notetype`.
pub mod notetype {
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct Config {
        #[prost(enumeration = "config::Kind", tag = "1")]
        pub kind: i32,
        #[prost(uint32, tag = "2")]
        pub sort_field_idx: u32,
        #[prost(string, tag = "3")]
        pub css: ::prost::alloc::string::String,
        /// This is now stored separately; retrieve with DefaultsForAdding()
        #[prost(int64, tag = "4")]
        pub target_deck_id_unused: i64,
        #[prost(string, tag = "5")]
        pub latex_pre: ::prost::alloc::string::String,
        #[prost(string, tag = "6")]
        pub latex_post: ::prost::alloc::string::String,
        #[prost(bool, tag = "7")]
        pub latex_svg: bool,
        #[prost(message, repeated, tag = "8")]
        pub reqs: ::prost::alloc::vec::Vec<config::CardRequirement>,
        /// Only set on notetypes created with Anki 2.1.62+.
        #[prost(enumeration = "super::stock_notetype::OriginalStockKind", tag = "9")]
        pub original_stock_kind: i32,
        /// the id in the source collection for imported notetypes (Anki 23.10)
        #[prost(int64, optional, tag = "10")]
        pub original_id: ::core::option::Option<i64>,
        #[prost(bytes = "vec", tag = "255")]
        pub other: ::prost::alloc::vec::Vec<u8>,
    }
    /// Nested message and enum types in `Config`.
    pub mod config {
        #[derive(Clone, PartialEq, ::prost::Message)]
        #[must_use]
pub struct CardRequirement {
            #[prost(uint32, tag = "1")]
            pub card_ord: u32,
            #[prost(enumeration = "card_requirement::Kind", tag = "2")]
            pub kind: i32,
            #[prost(uint32, repeated, tag = "3")]
            pub field_ords: ::prost::alloc::vec::Vec<u32>,
        }
        /// Nested message and enum types in `CardRequirement`.
        pub mod card_requirement {
            #[derive(
                Clone,
                Copy,
                Debug,
                PartialEq,
                Eq,
                Hash,
                PartialOrd,
                Ord,
                ::prost::Enumeration
            )]
            #[repr(i32)]
            #[must_use]
pub enum Kind {
                None = 0,
                Any = 1,
                All = 2,
            }
            impl Kind {
                /// 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 => "KIND_NONE",
                        Self::Any => "KIND_ANY",
                        Self::All => "KIND_ALL",
                    }
                }
                /// Creates an enum from field names used in the ProtoBuf definition.
                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                    match value {
                        "KIND_NONE" => Some(Self::None),
                        "KIND_ANY" => Some(Self::Any),
                        "KIND_ALL" => Some(Self::All),
                        _ => None,
                    }
                }
            }
        }
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        #[must_use]
pub enum Kind {
            Normal = 0,
            Cloze = 1,
        }
        impl Kind {
            /// 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 => "KIND_NORMAL",
                    Self::Cloze => "KIND_CLOZE",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "KIND_NORMAL" => Some(Self::Normal),
                    "KIND_CLOZE" => Some(Self::Cloze),
                    _ => None,
                }
            }
        }
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct Field {
        #[prost(message, optional, tag = "1")]
        pub ord: ::core::option::Option<super::super::generic::UInt32>,
        #[prost(string, tag = "2")]
        pub name: ::prost::alloc::string::String,
        #[prost(message, optional, tag = "5")]
        pub config: ::core::option::Option<field::Config>,
    }
    /// Nested message and enum types in `Field`.
    pub mod field {
        #[derive(Clone, PartialEq, ::prost::Message)]
        #[must_use]
pub struct Config {
            #[prost(bool, tag = "1")]
            pub sticky: bool,
            #[prost(bool, tag = "2")]
            pub rtl: bool,
            #[prost(string, tag = "3")]
            pub font_name: ::prost::alloc::string::String,
            #[prost(uint32, tag = "4")]
            pub font_size: u32,
            #[prost(string, tag = "5")]
            pub description: ::prost::alloc::string::String,
            #[prost(bool, tag = "6")]
            pub plain_text: bool,
            #[prost(bool, tag = "7")]
            pub collapsed: bool,
            #[prost(bool, tag = "8")]
            pub exclude_from_search: bool,
            /// used for merging notetypes on import (Anki 23.10)
            #[prost(int64, optional, tag = "9")]
            pub id: ::core::option::Option<i64>,
            /// Can be used to uniquely identify required fields.
            #[prost(uint32, optional, tag = "10")]
            pub tag: ::core::option::Option<u32>,
            #[prost(bool, tag = "11")]
            pub prevent_deletion: bool,
            #[prost(bytes = "vec", tag = "255")]
            pub other: ::prost::alloc::vec::Vec<u8>,
        }
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct Template {
        #[prost(message, optional, tag = "1")]
        pub ord: ::core::option::Option<super::super::generic::UInt32>,
        #[prost(string, tag = "2")]
        pub name: ::prost::alloc::string::String,
        #[prost(int64, tag = "3")]
        pub mtime_secs: i64,
        #[prost(sint32, tag = "4")]
        pub usn: i32,
        #[prost(message, optional, tag = "5")]
        pub config: ::core::option::Option<template::Config>,
    }
    /// Nested message and enum types in `Template`.
    pub mod template {
        #[derive(Clone, PartialEq, ::prost::Message)]
        #[must_use]
pub struct Config {
            #[prost(string, tag = "1")]
            pub q_format: ::prost::alloc::string::String,
            #[prost(string, tag = "2")]
            pub a_format: ::prost::alloc::string::String,
            #[prost(string, tag = "3")]
            pub q_format_browser: ::prost::alloc::string::String,
            #[prost(string, tag = "4")]
            pub a_format_browser: ::prost::alloc::string::String,
            #[prost(int64, tag = "5")]
            pub target_deck_id: i64,
            #[prost(string, tag = "6")]
            pub browser_font_name: ::prost::alloc::string::String,
            #[prost(uint32, tag = "7")]
            pub browser_font_size: u32,
            /// used for merging notetypes on import (Anki 23.10)
            #[prost(int64, optional, tag = "8")]
            pub id: ::core::option::Option<i64>,
            #[prost(bytes = "vec", tag = "255")]
            pub other: ::prost::alloc::vec::Vec<u8>,
        }
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct AddOrUpdateNotetypeRequest {
    #[prost(bytes = "vec", tag = "1")]
    pub json: ::prost::alloc::vec::Vec<u8>,
    #[prost(bool, tag = "2")]
    pub preserve_usn_and_mtime: bool,
    #[prost(bool, tag = "3")]
    pub skip_checks: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct UpdateNotetypeLegacyRequest {
    #[prost(bytes = "vec", tag = "1")]
    pub json: ::prost::alloc::vec::Vec<u8>,
    #[prost(bool, tag = "2")]
    pub skip_checks: bool,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[must_use]
pub struct StockNotetype {
    #[prost(enumeration = "stock_notetype::Kind", tag = "1")]
    pub kind: i32,
}
/// Nested message and enum types in `StockNotetype`.
pub mod stock_notetype {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum Kind {
        Basic = 0,
        BasicAndReversed = 1,
        BasicOptionalReversed = 2,
        BasicTyping = 3,
        Cloze = 4,
        ImageOcclusion = 5,
    }
    impl Kind {
        /// 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::Basic => "KIND_BASIC",
                Self::BasicAndReversed => "KIND_BASIC_AND_REVERSED",
                Self::BasicOptionalReversed => "KIND_BASIC_OPTIONAL_REVERSED",
                Self::BasicTyping => "KIND_BASIC_TYPING",
                Self::Cloze => "KIND_CLOZE",
                Self::ImageOcclusion => "KIND_IMAGE_OCCLUSION",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "KIND_BASIC" => Some(Self::Basic),
                "KIND_BASIC_AND_REVERSED" => Some(Self::BasicAndReversed),
                "KIND_BASIC_OPTIONAL_REVERSED" => Some(Self::BasicOptionalReversed),
                "KIND_BASIC_TYPING" => Some(Self::BasicTyping),
                "KIND_CLOZE" => Some(Self::Cloze),
                "KIND_IMAGE_OCCLUSION" => Some(Self::ImageOcclusion),
                _ => None,
            }
        }
    }
    /// This is decoupled from Kind to allow us to evolve notetypes over time
    /// (eg an older notetype might require different JS), and allow us to store
    /// a type even for notetypes that we don't add by default. Code should not
    /// assume that the entries here are always +1 from Kind.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum OriginalStockKind {
        Unknown = 0,
        Basic = 1,
        BasicAndReversed = 2,
        BasicOptionalReversed = 3,
        BasicTyping = 4,
        Cloze = 5,
        ImageOcclusion = 6,
    }
    impl OriginalStockKind {
        /// 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::Unknown => "ORIGINAL_STOCK_KIND_UNKNOWN",
                Self::Basic => "ORIGINAL_STOCK_KIND_BASIC",
                Self::BasicAndReversed => "ORIGINAL_STOCK_KIND_BASIC_AND_REVERSED",
                Self::BasicOptionalReversed => {
                    "ORIGINAL_STOCK_KIND_BASIC_OPTIONAL_REVERSED"
                }
                Self::BasicTyping => "ORIGINAL_STOCK_KIND_BASIC_TYPING",
                Self::Cloze => "ORIGINAL_STOCK_KIND_CLOZE",
                Self::ImageOcclusion => "ORIGINAL_STOCK_KIND_IMAGE_OCCLUSION",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "ORIGINAL_STOCK_KIND_UNKNOWN" => Some(Self::Unknown),
                "ORIGINAL_STOCK_KIND_BASIC" => Some(Self::Basic),
                "ORIGINAL_STOCK_KIND_BASIC_AND_REVERSED" => Some(Self::BasicAndReversed),
                "ORIGINAL_STOCK_KIND_BASIC_OPTIONAL_REVERSED" => {
                    Some(Self::BasicOptionalReversed)
                }
                "ORIGINAL_STOCK_KIND_BASIC_TYPING" => Some(Self::BasicTyping),
                "ORIGINAL_STOCK_KIND_CLOZE" => Some(Self::Cloze),
                "ORIGINAL_STOCK_KIND_IMAGE_OCCLUSION" => Some(Self::ImageOcclusion),
                _ => None,
            }
        }
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct NotetypeNames {
    #[prost(message, repeated, tag = "1")]
    pub entries: ::prost::alloc::vec::Vec<NotetypeNameId>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct NotetypeUseCounts {
    #[prost(message, repeated, tag = "1")]
    pub entries: ::prost::alloc::vec::Vec<NotetypeNameIdUseCount>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct NotetypeNameId {
    #[prost(int64, tag = "1")]
    pub id: i64,
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct NotetypeNameIdUseCount {
    #[prost(int64, tag = "1")]
    pub id: i64,
    #[prost(string, tag = "2")]
    pub name: ::prost::alloc::string::String,
    #[prost(uint32, tag = "3")]
    pub use_count: u32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct GetAuxConfigKeyRequest {
    #[prost(int64, tag = "1")]
    pub id: i64,
    #[prost(string, tag = "2")]
    pub key: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct GetAuxTemplateConfigKeyRequest {
    #[prost(int64, tag = "1")]
    pub notetype_id: i64,
    #[prost(uint32, tag = "2")]
    pub card_ordinal: u32,
    #[prost(string, tag = "3")]
    pub key: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[must_use]
pub struct GetChangeNotetypeInfoRequest {
    #[prost(int64, tag = "1")]
    pub old_notetype_id: i64,
    #[prost(int64, tag = "2")]
    pub new_notetype_id: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct ChangeNotetypeRequest {
    #[prost(int64, repeated, tag = "1")]
    pub note_ids: ::prost::alloc::vec::Vec<i64>,
    /// -1 is used to represent null, as nullable repeated fields
    /// are unwieldy in protobuf
    #[prost(int32, repeated, tag = "2")]
    pub new_fields: ::prost::alloc::vec::Vec<i32>,
    #[prost(int32, repeated, tag = "3")]
    pub new_templates: ::prost::alloc::vec::Vec<i32>,
    #[prost(int64, tag = "4")]
    pub old_notetype_id: i64,
    #[prost(int64, tag = "5")]
    pub new_notetype_id: i64,
    #[prost(int64, tag = "6")]
    pub current_schema: i64,
    #[prost(string, tag = "7")]
    pub old_notetype_name: ::prost::alloc::string::String,
    #[prost(bool, tag = "8")]
    pub is_cloze: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct ChangeNotetypeInfo {
    #[prost(string, repeated, tag = "1")]
    pub old_field_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "2")]
    pub old_template_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "3")]
    pub new_field_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "4")]
    pub new_template_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(message, optional, tag = "5")]
    pub input: ::core::option::Option<ChangeNotetypeRequest>,
    #[prost(string, tag = "6")]
    pub old_notetype_name: ::prost::alloc::string::String,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[must_use]
pub struct RestoreNotetypeToStockRequest {
    #[prost(message, optional, tag = "1")]
    pub notetype_id: ::core::option::Option<NotetypeId>,
    /// Older notetypes did not store their original stock kind, so we allow the UI
    /// to pass in an override to use when missing, or for tests.
    #[prost(enumeration = "stock_notetype::Kind", optional, tag = "2")]
    pub force_kind: ::core::option::Option<i32>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct GetClozeFieldOrdsResponse {
    #[prost(uint32, repeated, tag = "1")]
    pub ords: ::prost::alloc::vec::Vec<u32>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
#[must_use]
pub enum ImageOcclusionField {
    Occlusions = 0,
    Image = 1,
    Header = 2,
    BackExtra = 3,
    Comments = 4,
}
impl ImageOcclusionField {
    /// 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::Occlusions => "IMAGE_OCCLUSION_FIELD_OCCLUSIONS",
            Self::Image => "IMAGE_OCCLUSION_FIELD_IMAGE",
            Self::Header => "IMAGE_OCCLUSION_FIELD_HEADER",
            Self::BackExtra => "IMAGE_OCCLUSION_FIELD_BACK_EXTRA",
            Self::Comments => "IMAGE_OCCLUSION_FIELD_COMMENTS",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "IMAGE_OCCLUSION_FIELD_OCCLUSIONS" => Some(Self::Occlusions),
            "IMAGE_OCCLUSION_FIELD_IMAGE" => Some(Self::Image),
            "IMAGE_OCCLUSION_FIELD_HEADER" => Some(Self::Header),
            "IMAGE_OCCLUSION_FIELD_BACK_EXTRA" => Some(Self::BackExtra),
            "IMAGE_OCCLUSION_FIELD_COMMENTS" => Some(Self::Comments),
            _ => None,
        }
    }
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
#[must_use]
pub enum ClozeField {
    Text = 0,
    BackExtra = 1,
}
impl ClozeField {
    /// 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::Text => "CLOZE_FIELD_TEXT",
            Self::BackExtra => "CLOZE_FIELD_BACK_EXTRA",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "CLOZE_FIELD_TEXT" => Some(Self::Text),
            "CLOZE_FIELD_BACK_EXTRA" => Some(Self::BackExtra),
            _ => None,
        }
    }
}
