// This file is @generated by prost-build.
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct ImportCollectionPackageRequest {
    #[prost(string, tag = "1")]
    pub col_path: ::prost::alloc::string::String,
    #[prost(string, tag = "2")]
    pub backup_path: ::prost::alloc::string::String,
    #[prost(string, tag = "3")]
    pub media_folder: ::prost::alloc::string::String,
    #[prost(string, tag = "4")]
    pub media_db: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct ExportCollectionPackageRequest {
    #[prost(string, tag = "1")]
    pub out_path: ::prost::alloc::string::String,
    #[prost(bool, tag = "2")]
    pub include_media: bool,
    #[prost(bool, tag = "3")]
    pub legacy: bool,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[must_use]
pub struct ImportAnkiPackageOptions {
    #[prost(bool, tag = "1")]
    pub merge_notetypes: bool,
    #[prost(enumeration = "ImportAnkiPackageUpdateCondition", tag = "2")]
    pub update_notes: i32,
    #[prost(enumeration = "ImportAnkiPackageUpdateCondition", tag = "3")]
    pub update_notetypes: i32,
    #[prost(bool, tag = "4")]
    pub with_scheduling: bool,
    #[prost(bool, tag = "5")]
    pub with_deck_configs: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct ImportAnkiPackageRequest {
    #[prost(string, tag = "1")]
    pub package_path: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub options: ::core::option::Option<ImportAnkiPackageOptions>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct ImportResponse {
    #[prost(message, optional, tag = "1")]
    pub changes: ::core::option::Option<super::collection::OpChanges>,
    #[prost(message, optional, tag = "2")]
    pub log: ::core::option::Option<import_response::Log>,
}
/// Nested message and enum types in `ImportResponse`.
pub mod import_response {
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct Note {
        #[prost(message, optional, tag = "1")]
        pub id: ::core::option::Option<super::super::notes::NoteId>,
        #[prost(string, repeated, tag = "2")]
        pub fields: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    }
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct Log {
        #[prost(message, repeated, tag = "1")]
        pub new: ::prost::alloc::vec::Vec<Note>,
        #[prost(message, repeated, tag = "2")]
        pub updated: ::prost::alloc::vec::Vec<Note>,
        #[prost(message, repeated, tag = "3")]
        pub duplicate: ::prost::alloc::vec::Vec<Note>,
        #[prost(message, repeated, tag = "4")]
        pub conflicting: ::prost::alloc::vec::Vec<Note>,
        #[prost(message, repeated, tag = "5")]
        pub first_field_match: ::prost::alloc::vec::Vec<Note>,
        #[prost(message, repeated, tag = "6")]
        pub missing_notetype: ::prost::alloc::vec::Vec<Note>,
        #[prost(message, repeated, tag = "7")]
        pub missing_deck: ::prost::alloc::vec::Vec<Note>,
        #[prost(message, repeated, tag = "8")]
        pub empty_first_field: ::prost::alloc::vec::Vec<Note>,
        #[prost(enumeration = "super::csv_metadata::DupeResolution", tag = "9")]
        pub dupe_resolution: i32,
        #[prost(uint32, tag = "10")]
        pub found_notes: u32,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct ExportAnkiPackageRequest {
    #[prost(string, tag = "1")]
    pub out_path: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub options: ::core::option::Option<ExportAnkiPackageOptions>,
    #[prost(message, optional, tag = "3")]
    pub limit: ::core::option::Option<ExportLimit>,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[must_use]
pub struct ExportAnkiPackageOptions {
    #[prost(bool, tag = "1")]
    pub with_scheduling: bool,
    #[prost(bool, tag = "2")]
    pub with_deck_configs: bool,
    #[prost(bool, tag = "3")]
    pub with_media: bool,
    #[prost(bool, tag = "4")]
    pub legacy: bool,
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
#[must_use]
pub struct PackageMetadata {
    #[prost(enumeration = "package_metadata::Version", tag = "1")]
    pub version: i32,
}
/// Nested message and enum types in `PackageMetadata`.
pub mod package_metadata {
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum Version {
        Unknown = 0,
        /// When `meta` missing, and collection.anki2 file present.
        Legacy1 = 1,
        /// When `meta` missing, and collection.anki21 file present.
        Legacy2 = 2,
        /// Implies MediaEntry media map, and zstd compression.
        /// collection.21b file
        Latest = 3,
    }
    impl Version {
        /// 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 => "VERSION_UNKNOWN",
                Self::Legacy1 => "VERSION_LEGACY_1",
                Self::Legacy2 => "VERSION_LEGACY_2",
                Self::Latest => "VERSION_LATEST",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "VERSION_UNKNOWN" => Some(Self::Unknown),
                "VERSION_LEGACY_1" => Some(Self::Legacy1),
                "VERSION_LEGACY_2" => Some(Self::Legacy2),
                "VERSION_LATEST" => Some(Self::Latest),
                _ => None,
            }
        }
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct MediaEntries {
    #[prost(message, repeated, tag = "1")]
    pub entries: ::prost::alloc::vec::Vec<media_entries::MediaEntry>,
}
/// Nested message and enum types in `MediaEntries`.
pub mod media_entries {
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct MediaEntry {
        #[prost(string, tag = "1")]
        pub name: ::prost::alloc::string::String,
        #[prost(uint32, tag = "2")]
        pub size: u32,
        #[prost(bytes = "vec", tag = "3")]
        pub sha1: ::prost::alloc::vec::Vec<u8>,
        /// / Legacy media maps may include gaps in the media list, so the original
        /// / file index is recorded when importing from a HashMap. This field is not
        /// / set when exporting.
        #[prost(uint32, optional, tag = "255")]
        pub legacy_zip_filename: ::core::option::Option<u32>,
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct ImportCsvRequest {
    #[prost(string, tag = "1")]
    pub path: ::prost::alloc::string::String,
    #[prost(message, optional, tag = "2")]
    pub metadata: ::core::option::Option<CsvMetadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct CsvMetadataRequest {
    #[prost(string, tag = "1")]
    pub path: ::prost::alloc::string::String,
    #[prost(enumeration = "csv_metadata::Delimiter", optional, tag = "2")]
    pub delimiter: ::core::option::Option<i32>,
    #[prost(int64, optional, tag = "3")]
    pub notetype_id: ::core::option::Option<i64>,
    #[prost(int64, optional, tag = "4")]
    pub deck_id: ::core::option::Option<i64>,
    #[prost(bool, optional, tag = "5")]
    pub is_html: ::core::option::Option<bool>,
}
/// Column indices are 1-based to make working with them in TS easier, where
/// unset numerical fields default to 0.
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct CsvMetadata {
    #[prost(enumeration = "csv_metadata::Delimiter", tag = "1")]
    pub delimiter: i32,
    #[prost(bool, tag = "2")]
    pub is_html: bool,
    #[prost(string, repeated, tag = "3")]
    pub global_tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    #[prost(string, repeated, tag = "4")]
    pub updated_tags: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Column names as defined by the file or empty strings otherwise. Also used
    /// to determine the number of columns.
    #[prost(string, repeated, tag = "5")]
    pub column_labels: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// One-based. 0 means n/a.
    #[prost(uint32, tag = "10")]
    pub tags_column: u32,
    #[prost(bool, tag = "11")]
    pub force_delimiter: bool,
    #[prost(bool, tag = "12")]
    pub force_is_html: bool,
    #[prost(message, repeated, tag = "13")]
    pub preview: ::prost::alloc::vec::Vec<super::generic::StringList>,
    #[prost(uint32, tag = "14")]
    pub guid_column: u32,
    #[prost(enumeration = "csv_metadata::DupeResolution", tag = "15")]
    pub dupe_resolution: i32,
    #[prost(enumeration = "csv_metadata::MatchScope", tag = "16")]
    pub match_scope: i32,
    #[prost(oneof = "csv_metadata::Deck", tags = "6, 7, 17")]
    pub deck: ::core::option::Option<csv_metadata::Deck>,
    #[prost(oneof = "csv_metadata::Notetype", tags = "8, 9")]
    pub notetype: ::core::option::Option<csv_metadata::Notetype>,
}
/// Nested message and enum types in `CsvMetadata`.
pub mod csv_metadata {
    #[derive(Clone, PartialEq, ::prost::Message)]
    #[must_use]
pub struct MappedNotetype {
        #[prost(int64, tag = "1")]
        pub id: i64,
        /// Source column indices for note fields. One-based. 0 means n/a.
        #[prost(uint32, repeated, tag = "2")]
        pub field_columns: ::prost::alloc::vec::Vec<u32>,
    }
    #[derive(serde::Deserialize, serde::Serialize)]
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum DupeResolution {
        Update = 0,
        Preserve = 1,
        /// UPDATE_IF_NEWER = 3;
        Duplicate = 2,
    }
    impl DupeResolution {
        /// 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::Update => "UPDATE",
                Self::Preserve => "PRESERVE",
                Self::Duplicate => "DUPLICATE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "UPDATE" => Some(Self::Update),
                "PRESERVE" => Some(Self::Preserve),
                "DUPLICATE" => Some(Self::Duplicate),
                _ => None,
            }
        }
    }
    /// Order roughly in ascending expected frequency in note text, because the
    /// delimiter detection algorithm is stupidly picking the first one it
    /// encounters.
    #[derive(strum::EnumIter)]
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum Delimiter {
        Tab = 0,
        Pipe = 1,
        Semicolon = 2,
        Colon = 3,
        Comma = 4,
        Space = 5,
    }
    impl Delimiter {
        /// 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::Tab => "TAB",
                Self::Pipe => "PIPE",
                Self::Semicolon => "SEMICOLON",
                Self::Colon => "COLON",
                Self::Comma => "COMMA",
                Self::Space => "SPACE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "TAB" => Some(Self::Tab),
                "PIPE" => Some(Self::Pipe),
                "SEMICOLON" => Some(Self::Semicolon),
                "COLON" => Some(Self::Colon),
                "COMMA" => Some(Self::Comma),
                "SPACE" => Some(Self::Space),
                _ => None,
            }
        }
    }
    #[derive(serde::Deserialize, serde::Serialize)]
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    #[must_use]
pub enum MatchScope {
        Notetype = 0,
        NotetypeAndDeck = 1,
    }
    impl MatchScope {
        /// 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::Notetype => "NOTETYPE",
                Self::NotetypeAndDeck => "NOTETYPE_AND_DECK",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "NOTETYPE" => Some(Self::Notetype),
                "NOTETYPE_AND_DECK" => Some(Self::NotetypeAndDeck),
                _ => None,
            }
        }
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    #[must_use]
pub enum Deck {
        /// id of an existing deck
        #[prost(int64, tag = "6")]
        DeckId(i64),
        /// One-based. 0 means n/a.
        #[prost(uint32, tag = "7")]
        DeckColumn(u32),
        /// name of new deck to be created
        #[prost(string, tag = "17")]
        DeckName(::prost::alloc::string::String),
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    #[must_use]
pub enum Notetype {
        /// One notetype for all rows with given column mapping.
        #[prost(message, tag = "8")]
        GlobalNotetype(MappedNotetype),
        /// Row-specific notetypes with automatic mapping by index.
        /// One-based. 0 means n/a.
        #[prost(uint32, tag = "9")]
        NotetypeColumn(u32),
    }
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct ExportCardCsvRequest {
    #[prost(string, tag = "1")]
    pub out_path: ::prost::alloc::string::String,
    #[prost(bool, tag = "2")]
    pub with_html: bool,
    #[prost(message, optional, tag = "3")]
    pub limit: ::core::option::Option<ExportLimit>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct ExportNoteCsvRequest {
    #[prost(string, tag = "1")]
    pub out_path: ::prost::alloc::string::String,
    #[prost(bool, tag = "2")]
    pub with_html: bool,
    #[prost(bool, tag = "3")]
    pub with_tags: bool,
    #[prost(bool, tag = "4")]
    pub with_deck: bool,
    #[prost(bool, tag = "5")]
    pub with_notetype: bool,
    #[prost(bool, tag = "6")]
    pub with_guid: bool,
    #[prost(message, optional, tag = "7")]
    pub limit: ::core::option::Option<ExportLimit>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
#[must_use]
pub struct ExportLimit {
    #[prost(oneof = "export_limit::Limit", tags = "1, 2, 3, 4")]
    pub limit: ::core::option::Option<export_limit::Limit>,
}
/// Nested message and enum types in `ExportLimit`.
pub mod export_limit {
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    #[must_use]
pub enum Limit {
        #[prost(message, tag = "1")]
        WholeCollection(super::super::generic::Empty),
        #[prost(int64, tag = "2")]
        DeckId(i64),
        #[prost(message, tag = "3")]
        NoteIds(super::super::notes::NoteIds),
        #[prost(message, tag = "4")]
        CardIds(super::super::cards::CardIds),
    }
}
#[derive(serde::Deserialize, serde::Serialize)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
#[must_use]
pub enum ImportAnkiPackageUpdateCondition {
    IfNewer = 0,
    Always = 1,
    Never = 2,
}
impl ImportAnkiPackageUpdateCondition {
    /// 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::IfNewer => "IMPORT_ANKI_PACKAGE_UPDATE_CONDITION_IF_NEWER",
            Self::Always => "IMPORT_ANKI_PACKAGE_UPDATE_CONDITION_ALWAYS",
            Self::Never => "IMPORT_ANKI_PACKAGE_UPDATE_CONDITION_NEVER",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "IMPORT_ANKI_PACKAGE_UPDATE_CONDITION_IF_NEWER" => Some(Self::IfNewer),
            "IMPORT_ANKI_PACKAGE_UPDATE_CONDITION_ALWAYS" => Some(Self::Always),
            "IMPORT_ANKI_PACKAGE_UPDATE_CONDITION_NEVER" => Some(Self::Never),
            _ => None,
        }
    }
}
