// This file is @generated by prost-build.
/// Encodes the detailed information of a barcode.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Barcode {
    /// Format of a barcode.
    /// The supported formats are:
    ///
    /// * `CODE_128`: Code 128 type.
    /// * `CODE_39`: Code 39 type.
    /// * `CODE_93`: Code 93 type.
    /// * `CODABAR`: Codabar type.
    /// * `DATA_MATRIX`: 2D Data Matrix type.
    /// * `ITF`: ITF type.
    /// * `EAN_13`: EAN-13 type.
    /// * `EAN_8`: EAN-8 type.
    /// * `QR_CODE`: 2D QR code type.
    /// * `UPC_A`: UPC-A type.
    /// * `UPC_E`: UPC-E type.
    /// * `PDF417`: PDF417 type.
    /// * `AZTEC`: 2D Aztec code type.
    /// * `DATABAR`: GS1 DataBar code type.
    #[prost(string, tag = "1")]
    pub format: ::prost::alloc::string::String,
    /// Value format describes the format of the value that a barcode
    /// encodes.
    /// The supported formats are:
    ///
    /// * `CONTACT_INFO`: Contact information.
    /// * `EMAIL`: Email address.
    /// * `ISBN`: ISBN identifier.
    /// * `PHONE`: Phone number.
    /// * `PRODUCT`: Product.
    /// * `SMS`: SMS message.
    /// * `TEXT`: Text string.
    /// * `URL`: URL address.
    /// * `WIFI`: Wifi information.
    /// * `GEO`: Geo-localization.
    /// * `CALENDAR_EVENT`: Calendar event.
    /// * `DRIVER_LICENSE`: Driver's license.
    #[prost(string, tag = "2")]
    pub value_format: ::prost::alloc::string::String,
    /// Raw value encoded in the barcode.
    /// For example: `'MEBKM:TITLE:Google;URL:<https://www.google.com;;'`.>
    #[prost(string, tag = "3")]
    pub raw_value: ::prost::alloc::string::String,
}
/// A vertex represents a 2D point in the image.
/// NOTE: the vertex coordinates are in the same scale as the original image.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Vertex {
    /// X coordinate.
    #[prost(int32, tag = "1")]
    pub x: i32,
    /// Y coordinate (starts from the top of the image).
    #[prost(int32, tag = "2")]
    pub y: i32,
}
/// A vertex represents a 2D point in the image.
/// NOTE: the normalized vertex coordinates are relative to the original image
/// and range from 0 to 1.
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct NormalizedVertex {
    /// X coordinate.
    #[prost(float, tag = "1")]
    pub x: f32,
    /// Y coordinate (starts from the top of the image).
    #[prost(float, tag = "2")]
    pub y: f32,
}
/// A bounding polygon for the detected image annotation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BoundingPoly {
    /// The bounding polygon vertices.
    #[prost(message, repeated, tag = "1")]
    pub vertices: ::prost::alloc::vec::Vec<Vertex>,
    /// The bounding polygon normalized vertices.
    #[prost(message, repeated, tag = "2")]
    pub normalized_vertices: ::prost::alloc::vec::Vec<NormalizedVertex>,
}
/// Document represents the canonical document resource in Document AI. It is an
/// interchange format that provides insights into documents and allows for
/// collaboration between users and Document AI to iterate and optimize for
/// quality.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Document {
    /// Optional. An internal identifier for document. Should be loggable (no PII).
    #[prost(string, tag = "15")]
    pub docid: ::prost::alloc::string::String,
    /// An IANA published [media type (MIME
    /// type)](<https://www.iana.org/assignments/media-types/media-types.xhtml>).
    #[prost(string, tag = "3")]
    pub mime_type: ::prost::alloc::string::String,
    /// Optional. UTF-8 encoded text in reading order from the document.
    #[prost(string, tag = "4")]
    pub text: ::prost::alloc::string::String,
    /// Styles for the
    /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\].
    #[deprecated]
    #[prost(message, repeated, tag = "5")]
    pub text_styles: ::prost::alloc::vec::Vec<document::Style>,
    /// Visual page layout for the
    /// \[Document\]\[google.cloud.documentai.v1beta3.Document\].
    #[prost(message, repeated, tag = "6")]
    pub pages: ::prost::alloc::vec::Vec<document::Page>,
    /// A list of entities detected on
    /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\]. For
    /// document shards, entities in this list may cross shard boundaries.
    #[prost(message, repeated, tag = "7")]
    pub entities: ::prost::alloc::vec::Vec<document::Entity>,
    /// Placeholder.  Relationship among
    /// \[Document.entities\]\[google.cloud.documentai.v1beta3.Document.entities\].
    #[prost(message, repeated, tag = "8")]
    pub entity_relations: ::prost::alloc::vec::Vec<document::EntityRelation>,
    /// Placeholder.  A list of text corrections made to
    /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\].  This is
    /// usually used for annotating corrections to OCR mistakes.  Text changes for
    /// a given revision may not overlap with each other.
    #[prost(message, repeated, tag = "14")]
    pub text_changes: ::prost::alloc::vec::Vec<document::TextChange>,
    /// Information about the sharding if this document is sharded part of a larger
    /// document. If the document is not sharded, this message is not specified.
    #[prost(message, optional, tag = "9")]
    pub shard_info: ::core::option::Option<document::ShardInfo>,
    /// Any error that occurred while processing this document.
    #[prost(message, optional, tag = "10")]
    pub error: ::core::option::Option<super::super::super::rpc::Status>,
    /// Placeholder. Revision history of this document.
    #[prost(message, repeated, tag = "13")]
    pub revisions: ::prost::alloc::vec::Vec<document::Revision>,
    /// Parsed layout of the document.
    #[prost(message, optional, tag = "17")]
    pub document_layout: ::core::option::Option<document::DocumentLayout>,
    /// Document chunked based on chunking config.
    #[prost(message, optional, tag = "18")]
    pub chunked_document: ::core::option::Option<document::ChunkedDocument>,
    /// Optional. The blob assets in this document. This is used to store the
    /// content of the inline blobs in this document, e.g. image bytes, such that
    /// it can be referenced by other fields in the document via asset id.
    #[prost(message, repeated, tag = "19")]
    pub blob_assets: ::prost::alloc::vec::Vec<document::BlobAsset>,
    /// Original source document from the user.
    #[prost(oneof = "document::Source", tags = "1, 2")]
    pub source: ::core::option::Option<document::Source>,
}
/// Nested message and enum types in `Document`.
pub mod document {
    /// For a large document, sharding may be performed to produce several
    /// document shards. Each document shard contains this field to detail which
    /// shard it is.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct ShardInfo {
        /// The 0-based index of this shard.
        #[prost(int64, tag = "1")]
        pub shard_index: i64,
        /// Total number of shards.
        #[prost(int64, tag = "2")]
        pub shard_count: i64,
        /// The index of the first character in
        /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\] in the
        /// overall document global text.
        #[prost(int64, tag = "3")]
        pub text_offset: i64,
    }
    /// Annotation for common text style attributes. This adheres to CSS
    /// conventions as much as possible.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Style {
        /// Text anchor indexing into the
        /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\].
        #[prost(message, optional, tag = "1")]
        pub text_anchor: ::core::option::Option<TextAnchor>,
        /// Text color.
        #[prost(message, optional, tag = "2")]
        pub color: ::core::option::Option<super::super::super::super::r#type::Color>,
        /// Text background color.
        #[prost(message, optional, tag = "3")]
        pub background_color: ::core::option::Option<
            super::super::super::super::r#type::Color,
        >,
        /// [Font weight](<https://www.w3schools.com/cssref/pr_font_weight.asp>).
        /// Possible values are `normal`, `bold`, `bolder`, and `lighter`.
        #[prost(string, tag = "4")]
        pub font_weight: ::prost::alloc::string::String,
        /// [Text style](<https://www.w3schools.com/cssref/pr_font_font-style.asp>).
        /// Possible values are `normal`, `italic`, and `oblique`.
        #[prost(string, tag = "5")]
        pub text_style: ::prost::alloc::string::String,
        /// [Text
        /// decoration](<https://www.w3schools.com/cssref/pr_text_text-decoration.asp>).
        /// Follows CSS standard. <text-decoration-line> <text-decoration-color>
        /// <text-decoration-style>
        #[prost(string, tag = "6")]
        pub text_decoration: ::prost::alloc::string::String,
        /// Font size.
        #[prost(message, optional, tag = "7")]
        pub font_size: ::core::option::Option<style::FontSize>,
        /// Font family such as `Arial`, `Times New Roman`.
        /// <https://www.w3schools.com/cssref/pr_font_font-family.asp>
        #[prost(string, tag = "8")]
        pub font_family: ::prost::alloc::string::String,
    }
    /// Nested message and enum types in `Style`.
    pub mod style {
        /// Font size with unit.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct FontSize {
            /// Font size for the text.
            #[prost(float, tag = "1")]
            pub size: f32,
            /// Unit for the font size. Follows CSS naming (such as `in`, `px`, and
            /// `pt`).
            #[prost(string, tag = "2")]
            pub unit: ::prost::alloc::string::String,
        }
    }
    /// A page in a \[Document\]\[google.cloud.documentai.v1beta3.Document\].
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Page {
        /// 1-based index for current
        /// \[Page\]\[google.cloud.documentai.v1beta3.Document.Page\] in a parent
        /// \[Document\]\[google.cloud.documentai.v1beta3.Document\]. Useful when a page
        /// is taken out of a \[Document\]\[google.cloud.documentai.v1beta3.Document\]
        /// for individual processing.
        #[prost(int32, tag = "1")]
        pub page_number: i32,
        /// Rendered image for this page. This image is preprocessed to remove any
        /// skew, rotation, and distortions such that the annotation bounding boxes
        /// can be upright and axis-aligned.
        #[prost(message, optional, tag = "13")]
        pub image: ::core::option::Option<page::Image>,
        /// Transformation matrices that were applied to the original document image
        /// to produce
        /// \[Page.image\]\[google.cloud.documentai.v1beta3.Document.Page.image\].
        #[prost(message, repeated, tag = "14")]
        pub transforms: ::prost::alloc::vec::Vec<page::Matrix>,
        /// Physical dimension of the page.
        #[prost(message, optional, tag = "2")]
        pub dimension: ::core::option::Option<page::Dimension>,
        /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] for the
        /// page.
        #[prost(message, optional, tag = "3")]
        pub layout: ::core::option::Option<page::Layout>,
        /// A list of detected languages together with confidence.
        #[prost(message, repeated, tag = "4")]
        pub detected_languages: ::prost::alloc::vec::Vec<page::DetectedLanguage>,
        /// A list of visually detected text blocks on the page.
        /// A block has a set of lines (collected into paragraphs) that have a common
        /// line-spacing and orientation.
        #[prost(message, repeated, tag = "5")]
        pub blocks: ::prost::alloc::vec::Vec<page::Block>,
        /// A list of visually detected text paragraphs on the page.
        /// A collection of lines that a human would perceive as a paragraph.
        #[prost(message, repeated, tag = "6")]
        pub paragraphs: ::prost::alloc::vec::Vec<page::Paragraph>,
        /// A list of visually detected text lines on the page.
        /// A collection of tokens that a human would perceive as a line.
        #[prost(message, repeated, tag = "7")]
        pub lines: ::prost::alloc::vec::Vec<page::Line>,
        /// A list of visually detected tokens on the page.
        #[prost(message, repeated, tag = "8")]
        pub tokens: ::prost::alloc::vec::Vec<page::Token>,
        /// A list of detected non-text visual elements e.g. checkbox,
        /// signature etc. on the page.
        #[prost(message, repeated, tag = "9")]
        pub visual_elements: ::prost::alloc::vec::Vec<page::VisualElement>,
        /// A list of visually detected tables on the page.
        #[prost(message, repeated, tag = "10")]
        pub tables: ::prost::alloc::vec::Vec<page::Table>,
        /// A list of visually detected form fields on the page.
        #[prost(message, repeated, tag = "11")]
        pub form_fields: ::prost::alloc::vec::Vec<page::FormField>,
        /// A list of visually detected symbols on the page.
        #[prost(message, repeated, tag = "12")]
        pub symbols: ::prost::alloc::vec::Vec<page::Symbol>,
        /// A list of detected barcodes.
        #[prost(message, repeated, tag = "15")]
        pub detected_barcodes: ::prost::alloc::vec::Vec<page::DetectedBarcode>,
        /// Image quality scores.
        #[prost(message, optional, tag = "17")]
        pub image_quality_scores: ::core::option::Option<page::ImageQualityScores>,
        /// The history of this page.
        #[deprecated]
        #[prost(message, optional, tag = "16")]
        pub provenance: ::core::option::Option<Provenance>,
    }
    /// Nested message and enum types in `Page`.
    pub mod page {
        /// Dimension for the page.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Dimension {
            /// Page width.
            #[prost(float, tag = "1")]
            pub width: f32,
            /// Page height.
            #[prost(float, tag = "2")]
            pub height: f32,
            /// Dimension unit.
            #[prost(string, tag = "3")]
            pub unit: ::prost::alloc::string::String,
        }
        /// Rendered image contents for this page.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct Image {
            /// Raw byte content of the image.
            #[prost(bytes = "vec", tag = "1")]
            pub content: ::prost::alloc::vec::Vec<u8>,
            /// Encoding [media type (MIME
            /// type)](<https://www.iana.org/assignments/media-types/media-types.xhtml>)
            /// for the image.
            #[prost(string, tag = "2")]
            pub mime_type: ::prost::alloc::string::String,
            /// Width of the image in pixels.
            #[prost(int32, tag = "3")]
            pub width: i32,
            /// Height of the image in pixels.
            #[prost(int32, tag = "4")]
            pub height: i32,
        }
        /// Representation for transformation matrix, intended to be compatible and
        /// used with OpenCV format for image manipulation.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct Matrix {
            /// Number of rows in the matrix.
            #[prost(int32, tag = "1")]
            pub rows: i32,
            /// Number of columns in the matrix.
            #[prost(int32, tag = "2")]
            pub cols: i32,
            /// This encodes information about what data type the matrix uses.
            /// For example, 0 (CV_8U) is an unsigned 8-bit image. For the full list
            /// of OpenCV primitive data types, please refer to
            /// <https://docs.opencv.org/4.3.0/d1/d1b/group__core__hal__interface.html>
            #[prost(int32, tag = "3")]
            pub r#type: i32,
            /// The matrix data.
            #[prost(bytes = "vec", tag = "4")]
            pub data: ::prost::alloc::vec::Vec<u8>,
        }
        /// Visual element describing a layout unit on a page.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Layout {
            /// Text anchor indexing into the
            /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\].
            #[prost(message, optional, tag = "1")]
            pub text_anchor: ::core::option::Option<super::TextAnchor>,
            /// Confidence of the current
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] within
            /// context of the object this layout is for. e.g. confidence can be for a
            /// single token, a table, a visual element, etc. depending on context.
            /// Range `\[0, 1\]`.
            #[prost(float, tag = "2")]
            pub confidence: f32,
            /// The bounding polygon for the
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\].
            #[prost(message, optional, tag = "3")]
            pub bounding_poly: ::core::option::Option<super::super::BoundingPoly>,
            /// Detected orientation for the
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\].
            #[prost(enumeration = "layout::Orientation", tag = "4")]
            pub orientation: i32,
        }
        /// Nested message and enum types in `Layout`.
        pub mod layout {
            /// Detected human reading orientation.
            #[derive(
                Clone,
                Copy,
                Debug,
                PartialEq,
                Eq,
                Hash,
                PartialOrd,
                Ord,
                ::prost::Enumeration
            )]
            #[repr(i32)]
            pub enum Orientation {
                /// Unspecified orientation.
                Unspecified = 0,
                /// Orientation is aligned with page up.
                PageUp = 1,
                /// Orientation is aligned with page right.
                /// Turn the head 90 degrees clockwise from upright to read.
                PageRight = 2,
                /// Orientation is aligned with page down.
                /// Turn the head 180 degrees from upright to read.
                PageDown = 3,
                /// Orientation is aligned with page left.
                /// Turn the head 90 degrees counterclockwise from upright to read.
                PageLeft = 4,
            }
            impl Orientation {
                /// 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 => "ORIENTATION_UNSPECIFIED",
                        Self::PageUp => "PAGE_UP",
                        Self::PageRight => "PAGE_RIGHT",
                        Self::PageDown => "PAGE_DOWN",
                        Self::PageLeft => "PAGE_LEFT",
                    }
                }
                /// Creates an enum from field names used in the ProtoBuf definition.
                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                    match value {
                        "ORIENTATION_UNSPECIFIED" => Some(Self::Unspecified),
                        "PAGE_UP" => Some(Self::PageUp),
                        "PAGE_RIGHT" => Some(Self::PageRight),
                        "PAGE_DOWN" => Some(Self::PageDown),
                        "PAGE_LEFT" => Some(Self::PageLeft),
                        _ => None,
                    }
                }
            }
        }
        /// A block has a set of lines (collected into paragraphs) that have a
        /// common line-spacing and orientation.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Block {
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] for
            /// \[Block\]\[google.cloud.documentai.v1beta3.Document.Page.Block\].
            #[prost(message, optional, tag = "1")]
            pub layout: ::core::option::Option<Layout>,
            /// A list of detected languages together with confidence.
            #[prost(message, repeated, tag = "2")]
            pub detected_languages: ::prost::alloc::vec::Vec<DetectedLanguage>,
            /// The history of this annotation.
            #[deprecated]
            #[prost(message, optional, tag = "3")]
            pub provenance: ::core::option::Option<super::Provenance>,
        }
        /// A collection of lines that a human would perceive as a paragraph.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Paragraph {
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] for
            /// \[Paragraph\]\[google.cloud.documentai.v1beta3.Document.Page.Paragraph\].
            #[prost(message, optional, tag = "1")]
            pub layout: ::core::option::Option<Layout>,
            /// A list of detected languages together with confidence.
            #[prost(message, repeated, tag = "2")]
            pub detected_languages: ::prost::alloc::vec::Vec<DetectedLanguage>,
            /// The  history of this annotation.
            #[deprecated]
            #[prost(message, optional, tag = "3")]
            pub provenance: ::core::option::Option<super::Provenance>,
        }
        /// A collection of tokens that a human would perceive as a line.
        /// Does not cross column boundaries, can be horizontal, vertical, etc.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Line {
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] for
            /// \[Line\]\[google.cloud.documentai.v1beta3.Document.Page.Line\].
            #[prost(message, optional, tag = "1")]
            pub layout: ::core::option::Option<Layout>,
            /// A list of detected languages together with confidence.
            #[prost(message, repeated, tag = "2")]
            pub detected_languages: ::prost::alloc::vec::Vec<DetectedLanguage>,
            /// The  history of this annotation.
            #[deprecated]
            #[prost(message, optional, tag = "3")]
            pub provenance: ::core::option::Option<super::Provenance>,
        }
        /// A detected token.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Token {
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] for
            /// \[Token\]\[google.cloud.documentai.v1beta3.Document.Page.Token\].
            #[prost(message, optional, tag = "1")]
            pub layout: ::core::option::Option<Layout>,
            /// Detected break at the end of a
            /// \[Token\]\[google.cloud.documentai.v1beta3.Document.Page.Token\].
            #[prost(message, optional, tag = "2")]
            pub detected_break: ::core::option::Option<token::DetectedBreak>,
            /// A list of detected languages together with confidence.
            #[prost(message, repeated, tag = "3")]
            pub detected_languages: ::prost::alloc::vec::Vec<DetectedLanguage>,
            /// The history of this annotation.
            #[deprecated]
            #[prost(message, optional, tag = "4")]
            pub provenance: ::core::option::Option<super::Provenance>,
            /// Text style attributes.
            #[prost(message, optional, tag = "5")]
            pub style_info: ::core::option::Option<token::StyleInfo>,
        }
        /// Nested message and enum types in `Token`.
        pub mod token {
            /// Detected break at the end of a
            /// \[Token\]\[google.cloud.documentai.v1beta3.Document.Page.Token\].
            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
            pub struct DetectedBreak {
                /// Detected break type.
                #[prost(enumeration = "detected_break::Type", tag = "1")]
                pub r#type: i32,
            }
            /// Nested message and enum types in `DetectedBreak`.
            pub mod detected_break {
                /// Enum to denote the type of break found.
                #[derive(
                    Clone,
                    Copy,
                    Debug,
                    PartialEq,
                    Eq,
                    Hash,
                    PartialOrd,
                    Ord,
                    ::prost::Enumeration
                )]
                #[repr(i32)]
                pub enum Type {
                    /// Unspecified break type.
                    Unspecified = 0,
                    /// A single whitespace.
                    Space = 1,
                    /// A wider whitespace.
                    WideSpace = 2,
                    /// A hyphen that indicates that a token has been split across lines.
                    Hyphen = 3,
                }
                impl Type {
                    /// 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 => "TYPE_UNSPECIFIED",
                            Self::Space => "SPACE",
                            Self::WideSpace => "WIDE_SPACE",
                            Self::Hyphen => "HYPHEN",
                        }
                    }
                    /// Creates an enum from field names used in the ProtoBuf definition.
                    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                        match value {
                            "TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                            "SPACE" => Some(Self::Space),
                            "WIDE_SPACE" => Some(Self::WideSpace),
                            "HYPHEN" => Some(Self::Hyphen),
                            _ => None,
                        }
                    }
                }
            }
            /// Font and other text style attributes.
            #[derive(Clone, PartialEq, ::prost::Message)]
            pub struct StyleInfo {
                /// Font size in points (`1` point is `¹⁄₇₂` inches).
                #[prost(int32, tag = "1")]
                pub font_size: i32,
                /// Font size in pixels, equal to *unrounded
                /// \[font_size\]\[google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo.font_size\]*
                ///
                /// * *resolution* ÷ `72.0`.
                #[prost(double, tag = "2")]
                pub pixel_font_size: f64,
                /// Letter spacing in points.
                #[prost(double, tag = "3")]
                pub letter_spacing: f64,
                /// Name or style of the font.
                #[prost(string, tag = "4")]
                pub font_type: ::prost::alloc::string::String,
                /// Whether the text is bold (equivalent to
                /// \[font_weight\]\[google.cloud.documentai.v1beta3.Document.Page.Token.StyleInfo.font_weight\]
                /// is at least `700`).
                #[prost(bool, tag = "5")]
                pub bold: bool,
                /// Whether the text is italic.
                #[prost(bool, tag = "6")]
                pub italic: bool,
                /// Whether the text is underlined.
                #[prost(bool, tag = "7")]
                pub underlined: bool,
                /// Whether the text is strikethrough. This feature is not supported yet.
                #[prost(bool, tag = "8")]
                pub strikeout: bool,
                /// Whether the text is a subscript. This feature is not supported yet.
                #[prost(bool, tag = "9")]
                pub subscript: bool,
                /// Whether the text is a superscript. This feature is not supported yet.
                #[prost(bool, tag = "10")]
                pub superscript: bool,
                /// Whether the text is in small caps. This feature is not supported yet.
                #[prost(bool, tag = "11")]
                pub smallcaps: bool,
                /// TrueType weight on a scale `100` (thin) to `1000` (ultra-heavy).
                /// Normal is `400`, bold is `700`.
                #[prost(int32, tag = "12")]
                pub font_weight: i32,
                /// Whether the text is handwritten.
                #[prost(bool, tag = "13")]
                pub handwritten: bool,
                /// Color of the text.
                #[prost(message, optional, tag = "14")]
                pub text_color: ::core::option::Option<
                    super::super::super::super::super::super::r#type::Color,
                >,
                /// Color of the background.
                #[prost(message, optional, tag = "15")]
                pub background_color: ::core::option::Option<
                    super::super::super::super::super::super::r#type::Color,
                >,
            }
        }
        /// A detected symbol.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Symbol {
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] for
            /// \[Symbol\]\[google.cloud.documentai.v1beta3.Document.Page.Symbol\].
            #[prost(message, optional, tag = "1")]
            pub layout: ::core::option::Option<Layout>,
            /// A list of detected languages together with confidence.
            #[prost(message, repeated, tag = "2")]
            pub detected_languages: ::prost::alloc::vec::Vec<DetectedLanguage>,
        }
        /// Detected non-text visual elements e.g. checkbox, signature etc. on the
        /// page.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct VisualElement {
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] for
            /// \[VisualElement\]\[google.cloud.documentai.v1beta3.Document.Page.VisualElement\].
            #[prost(message, optional, tag = "1")]
            pub layout: ::core::option::Option<Layout>,
            /// Type of the
            /// \[VisualElement\]\[google.cloud.documentai.v1beta3.Document.Page.VisualElement\].
            #[prost(string, tag = "2")]
            pub r#type: ::prost::alloc::string::String,
            /// A list of detected languages together with confidence.
            #[prost(message, repeated, tag = "3")]
            pub detected_languages: ::prost::alloc::vec::Vec<DetectedLanguage>,
        }
        /// A table representation similar to HTML table structure.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Table {
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] for
            /// \[Table\]\[google.cloud.documentai.v1beta3.Document.Page.Table\].
            #[prost(message, optional, tag = "1")]
            pub layout: ::core::option::Option<Layout>,
            /// Header rows of the table.
            #[prost(message, repeated, tag = "2")]
            pub header_rows: ::prost::alloc::vec::Vec<table::TableRow>,
            /// Body rows of the table.
            #[prost(message, repeated, tag = "3")]
            pub body_rows: ::prost::alloc::vec::Vec<table::TableRow>,
            /// A list of detected languages together with confidence.
            #[prost(message, repeated, tag = "4")]
            pub detected_languages: ::prost::alloc::vec::Vec<DetectedLanguage>,
            /// The history of this table.
            #[deprecated]
            #[prost(message, optional, tag = "5")]
            pub provenance: ::core::option::Option<super::Provenance>,
        }
        /// Nested message and enum types in `Table`.
        pub mod table {
            /// A row of table cells.
            #[derive(Clone, PartialEq, ::prost::Message)]
            pub struct TableRow {
                /// Cells that make up this row.
                #[prost(message, repeated, tag = "1")]
                pub cells: ::prost::alloc::vec::Vec<TableCell>,
            }
            /// A cell representation inside the table.
            #[derive(Clone, PartialEq, ::prost::Message)]
            pub struct TableCell {
                /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] for
                /// \[TableCell\]\[google.cloud.documentai.v1beta3.Document.Page.Table.TableCell\].
                #[prost(message, optional, tag = "1")]
                pub layout: ::core::option::Option<super::Layout>,
                /// How many rows this cell spans.
                #[prost(int32, tag = "2")]
                pub row_span: i32,
                /// How many columns this cell spans.
                #[prost(int32, tag = "3")]
                pub col_span: i32,
                /// A list of detected languages together with confidence.
                #[prost(message, repeated, tag = "4")]
                pub detected_languages: ::prost::alloc::vec::Vec<
                    super::DetectedLanguage,
                >,
            }
        }
        /// A form field detected on the page.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct FormField {
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] for the
            /// \[FormField\]\[google.cloud.documentai.v1beta3.Document.Page.FormField\]
            /// name. e.g. `Address`, `Email`, `Grand total`, `Phone number`, etc.
            #[prost(message, optional, tag = "1")]
            pub field_name: ::core::option::Option<Layout>,
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] for the
            /// \[FormField\]\[google.cloud.documentai.v1beta3.Document.Page.FormField\]
            /// value.
            #[prost(message, optional, tag = "2")]
            pub field_value: ::core::option::Option<Layout>,
            /// A list of detected languages for name together with confidence.
            #[prost(message, repeated, tag = "3")]
            pub name_detected_languages: ::prost::alloc::vec::Vec<DetectedLanguage>,
            /// A list of detected languages for value together with confidence.
            #[prost(message, repeated, tag = "4")]
            pub value_detected_languages: ::prost::alloc::vec::Vec<DetectedLanguage>,
            /// If the value is non-textual, this field represents the type. Current
            /// valid values are:
            ///
            /// * blank (this indicates the `field_value` is normal text)
            /// * `unfilled_checkbox`
            /// * `filled_checkbox`
            #[prost(string, tag = "5")]
            pub value_type: ::prost::alloc::string::String,
            /// Created for Labeling UI to export key text.
            /// If corrections were made to the text identified by the
            /// `field_name.text_anchor`, this field will contain the correction.
            #[prost(string, tag = "6")]
            pub corrected_key_text: ::prost::alloc::string::String,
            /// Created for Labeling UI to export value text.
            /// If corrections were made to the text identified by the
            /// `field_value.text_anchor`, this field will contain the correction.
            #[prost(string, tag = "7")]
            pub corrected_value_text: ::prost::alloc::string::String,
            /// The history of this annotation.
            #[prost(message, optional, tag = "8")]
            pub provenance: ::core::option::Option<super::Provenance>,
        }
        /// A detected barcode.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct DetectedBarcode {
            /// \[Layout\]\[google.cloud.documentai.v1beta3.Document.Page.Layout\] for
            /// \[DetectedBarcode\]\[google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode\].
            #[prost(message, optional, tag = "1")]
            pub layout: ::core::option::Option<Layout>,
            /// Detailed barcode information of the
            /// \[DetectedBarcode\]\[google.cloud.documentai.v1beta3.Document.Page.DetectedBarcode\].
            #[prost(message, optional, tag = "2")]
            pub barcode: ::core::option::Option<super::super::Barcode>,
        }
        /// Detected language for a structural component.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct DetectedLanguage {
            /// The [BCP-47 language
            /// code](<https://www.unicode.org/reports/tr35/#Unicode_locale_identifier>),
            /// such as `en-US` or `sr-Latn`.
            #[prost(string, tag = "1")]
            pub language_code: ::prost::alloc::string::String,
            /// Confidence of detected language. Range `\[0, 1\]`.
            #[prost(float, tag = "2")]
            pub confidence: f32,
        }
        /// Image quality scores for the page image.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct ImageQualityScores {
            /// The overall quality score. Range `\[0, 1\]` where `1` is perfect quality.
            #[prost(float, tag = "1")]
            pub quality_score: f32,
            /// A list of detected defects.
            #[prost(message, repeated, tag = "2")]
            pub detected_defects: ::prost::alloc::vec::Vec<
                image_quality_scores::DetectedDefect,
            >,
        }
        /// Nested message and enum types in `ImageQualityScores`.
        pub mod image_quality_scores {
            /// Image Quality Defects
            #[derive(Clone, PartialEq, ::prost::Message)]
            pub struct DetectedDefect {
                /// Name of the defect type. Supported values are:
                ///
                /// * `quality/defect_blurry`
                /// * `quality/defect_noisy`
                /// * `quality/defect_dark`
                /// * `quality/defect_faint`
                /// * `quality/defect_text_too_small`
                /// * `quality/defect_document_cutoff`
                /// * `quality/defect_text_cutoff`
                /// * `quality/defect_glare`
                #[prost(string, tag = "1")]
                pub r#type: ::prost::alloc::string::String,
                /// Confidence of detected defect. Range `\[0, 1\]` where `1` indicates
                /// strong confidence that the defect exists.
                #[prost(float, tag = "2")]
                pub confidence: f32,
            }
        }
    }
    /// An entity that could be a phrase in the text or a property that belongs to
    /// the document. It is a known entity type, such as a person, an organization,
    /// or location.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Entity {
        /// Optional. Provenance of the entity.
        /// Text anchor indexing into the
        /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\].
        #[prost(message, optional, tag = "1")]
        pub text_anchor: ::core::option::Option<TextAnchor>,
        /// Required. Entity type from a schema e.g. `Address`.
        #[prost(string, tag = "2")]
        pub r#type: ::prost::alloc::string::String,
        /// Optional. Text value of the entity e.g. `1600 Amphitheatre Pkwy`.
        #[prost(string, tag = "3")]
        pub mention_text: ::prost::alloc::string::String,
        /// Optional. Deprecated.  Use `id` field instead.
        #[prost(string, tag = "4")]
        pub mention_id: ::prost::alloc::string::String,
        /// Optional. Confidence of detected Schema entity. Range `\[0, 1\]`.
        #[prost(float, tag = "5")]
        pub confidence: f32,
        /// Optional. Represents the provenance of this entity wrt. the location on
        /// the page where it was found.
        #[prost(message, optional, tag = "6")]
        pub page_anchor: ::core::option::Option<PageAnchor>,
        /// Optional. Canonical id. This will be a unique value in the entity list
        /// for this document.
        #[prost(string, tag = "7")]
        pub id: ::prost::alloc::string::String,
        /// Optional. Normalized entity value. Absent if the extracted value could
        /// not be converted or the type (e.g. address) is not supported for certain
        /// parsers. This field is also only populated for certain supported document
        /// types.
        #[prost(message, optional, tag = "9")]
        pub normalized_value: ::core::option::Option<entity::NormalizedValue>,
        /// Optional. Entities can be nested to form a hierarchical data structure
        /// representing the content in the document.
        #[prost(message, repeated, tag = "10")]
        pub properties: ::prost::alloc::vec::Vec<Entity>,
        /// Optional. The history of this annotation.
        #[prost(message, optional, tag = "11")]
        pub provenance: ::core::option::Option<Provenance>,
        /// Optional. Whether the entity will be redacted for de-identification
        /// purposes.
        #[prost(bool, tag = "12")]
        pub redacted: bool,
    }
    /// Nested message and enum types in `Entity`.
    pub mod entity {
        /// Parsed and normalized entity value.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct NormalizedValue {
            /// Optional. An optional field to store a normalized string.
            /// For some entity types, one of respective `structured_value` fields may
            /// also be populated. Also not all the types of `structured_value` will be
            /// normalized. For example, some processors may not generate `float`
            /// or `integer` normalized text by default.
            ///
            /// Below are sample formats mapped to structured values.
            ///
            /// * Money/Currency type (`money_value`) is in the ISO 4217 text format.
            /// * Date type (`date_value`) is in the ISO 8601 text format.
            /// * Datetime type (`datetime_value`) is in the ISO 8601 text format.
            #[prost(string, tag = "1")]
            pub text: ::prost::alloc::string::String,
            /// An optional structured entity value.
            /// Must match entity type defined in schema if
            /// known. If this field is present, the `text` field could also be
            /// populated.
            #[prost(
                oneof = "normalized_value::StructuredValue",
                tags = "2, 3, 4, 5, 6, 7, 8"
            )]
            pub structured_value: ::core::option::Option<
                normalized_value::StructuredValue,
            >,
        }
        /// Nested message and enum types in `NormalizedValue`.
        pub mod normalized_value {
            /// An optional structured entity value.
            /// Must match entity type defined in schema if
            /// known. If this field is present, the `text` field could also be
            /// populated.
            #[derive(Clone, PartialEq, ::prost::Oneof)]
            pub enum StructuredValue {
                /// Money value. See also:
                /// <https://github.com/googleapis/googleapis/blob/master/google/type/money.proto>
                #[prost(message, tag = "2")]
                MoneyValue(super::super::super::super::super::super::r#type::Money),
                /// Date value. Includes year, month, day. See also:
                /// <https://github.com/googleapis/googleapis/blob/master/google/type/date.proto>
                #[prost(message, tag = "3")]
                DateValue(super::super::super::super::super::super::r#type::Date),
                /// DateTime value. Includes date, time, and timezone. See also:
                /// <https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto>
                #[prost(message, tag = "4")]
                DatetimeValue(
                    super::super::super::super::super::super::r#type::DateTime,
                ),
                /// Postal address. See also:
                /// <https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto>
                #[prost(message, tag = "5")]
                AddressValue(
                    super::super::super::super::super::super::r#type::PostalAddress,
                ),
                /// Boolean value. Can be used for entities with binary values, or for
                /// checkboxes.
                #[prost(bool, tag = "6")]
                BooleanValue(bool),
                /// Integer value.
                #[prost(int32, tag = "7")]
                IntegerValue(i32),
                /// Float value.
                #[prost(float, tag = "8")]
                FloatValue(f32),
            }
        }
    }
    /// Relationship between
    /// \[Entities\]\[google.cloud.documentai.v1beta3.Document.Entity\].
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct EntityRelation {
        /// Subject entity id.
        #[prost(string, tag = "1")]
        pub subject_id: ::prost::alloc::string::String,
        /// Object entity id.
        #[prost(string, tag = "2")]
        pub object_id: ::prost::alloc::string::String,
        /// Relationship description.
        #[prost(string, tag = "3")]
        pub relation: ::prost::alloc::string::String,
    }
    /// Text reference indexing into the
    /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\].
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct TextAnchor {
        /// The text segments from the
        /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\].
        #[prost(message, repeated, tag = "1")]
        pub text_segments: ::prost::alloc::vec::Vec<text_anchor::TextSegment>,
        /// Contains the content of the text span so that users do
        /// not have to look it up in the text_segments.  It is always
        /// populated for formFields.
        #[prost(string, tag = "2")]
        pub content: ::prost::alloc::string::String,
    }
    /// Nested message and enum types in `TextAnchor`.
    pub mod text_anchor {
        /// A text segment in the
        /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\]. The
        /// indices may be out of bounds which indicate that the text extends into
        /// another document shard for large sharded documents. See
        /// \[ShardInfo.text_offset\]\[google.cloud.documentai.v1beta3.Document.ShardInfo.text_offset\]
        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct TextSegment {
            /// \[TextSegment\]\[google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment\]
            /// start UTF-8 char index in the
            /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\].
            #[prost(int64, tag = "1")]
            pub start_index: i64,
            /// \[TextSegment\]\[google.cloud.documentai.v1beta3.Document.TextAnchor.TextSegment\]
            /// half open end UTF-8 char index in the
            /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\].
            #[prost(int64, tag = "2")]
            pub end_index: i64,
        }
    }
    /// Referencing the visual context of the entity in the
    /// \[Document.pages\]\[google.cloud.documentai.v1beta3.Document.pages\]. Page
    /// anchors can be cross-page, consist of multiple bounding polygons and
    /// optionally reference specific layout element types.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct PageAnchor {
        /// One or more references to visual page elements
        #[prost(message, repeated, tag = "1")]
        pub page_refs: ::prost::alloc::vec::Vec<page_anchor::PageRef>,
    }
    /// Nested message and enum types in `PageAnchor`.
    pub mod page_anchor {
        /// Represents a weak reference to a page element within a document.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct PageRef {
            /// Required. Index into the
            /// \[Document.pages\]\[google.cloud.documentai.v1beta3.Document.pages\]
            /// element, for example using
            /// `[Document.pages][page_refs.page]` to locate the related page element.
            /// This field is skipped when its value is the default `0`. See
            /// <https://developers.google.com/protocol-buffers/docs/proto3#json.>
            #[prost(int64, tag = "1")]
            pub page: i64,
            /// Optional. The type of the layout element that is being referenced if
            /// any.
            #[prost(enumeration = "page_ref::LayoutType", tag = "2")]
            pub layout_type: i32,
            /// Optional. Deprecated.  Use
            /// \[PageRef.bounding_poly\]\[google.cloud.documentai.v1beta3.Document.PageAnchor.PageRef.bounding_poly\]
            /// instead.
            #[deprecated]
            #[prost(string, tag = "3")]
            pub layout_id: ::prost::alloc::string::String,
            /// Optional. Identifies the bounding polygon of a layout element on the
            /// page. If `layout_type` is set, the bounding polygon must be exactly the
            /// same to the layout element it's referring to.
            #[prost(message, optional, tag = "4")]
            pub bounding_poly: ::core::option::Option<super::super::BoundingPoly>,
            /// Optional. Confidence of detected page element, if applicable. Range
            /// `\[0, 1\]`.
            #[prost(float, tag = "5")]
            pub confidence: f32,
        }
        /// Nested message and enum types in `PageRef`.
        pub mod page_ref {
            /// The type of layout that is being referenced.
            #[derive(
                Clone,
                Copy,
                Debug,
                PartialEq,
                Eq,
                Hash,
                PartialOrd,
                Ord,
                ::prost::Enumeration
            )]
            #[repr(i32)]
            pub enum LayoutType {
                /// Layout Unspecified.
                Unspecified = 0,
                /// References a
                /// \[Page.blocks\]\[google.cloud.documentai.v1beta3.Document.Page.blocks\]
                /// element.
                Block = 1,
                /// References a
                /// \[Page.paragraphs\]\[google.cloud.documentai.v1beta3.Document.Page.paragraphs\]
                /// element.
                Paragraph = 2,
                /// References a
                /// \[Page.lines\]\[google.cloud.documentai.v1beta3.Document.Page.lines\]
                /// element.
                Line = 3,
                /// References a
                /// \[Page.tokens\]\[google.cloud.documentai.v1beta3.Document.Page.tokens\]
                /// element.
                Token = 4,
                /// References a
                /// \[Page.visual_elements\]\[google.cloud.documentai.v1beta3.Document.Page.visual_elements\]
                /// element.
                VisualElement = 5,
                /// Refrrences a
                /// \[Page.tables\]\[google.cloud.documentai.v1beta3.Document.Page.tables\]
                /// element.
                Table = 6,
                /// References a
                /// \[Page.form_fields\]\[google.cloud.documentai.v1beta3.Document.Page.form_fields\]
                /// element.
                FormField = 7,
            }
            impl LayoutType {
                /// 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 => "LAYOUT_TYPE_UNSPECIFIED",
                        Self::Block => "BLOCK",
                        Self::Paragraph => "PARAGRAPH",
                        Self::Line => "LINE",
                        Self::Token => "TOKEN",
                        Self::VisualElement => "VISUAL_ELEMENT",
                        Self::Table => "TABLE",
                        Self::FormField => "FORM_FIELD",
                    }
                }
                /// Creates an enum from field names used in the ProtoBuf definition.
                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                    match value {
                        "LAYOUT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                        "BLOCK" => Some(Self::Block),
                        "PARAGRAPH" => Some(Self::Paragraph),
                        "LINE" => Some(Self::Line),
                        "TOKEN" => Some(Self::Token),
                        "VISUAL_ELEMENT" => Some(Self::VisualElement),
                        "TABLE" => Some(Self::Table),
                        "FORM_FIELD" => Some(Self::FormField),
                        _ => None,
                    }
                }
            }
        }
    }
    /// Structure to identify provenance relationships between annotations in
    /// different revisions.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct Provenance {
        /// The index of the revision that produced this element.
        #[deprecated]
        #[prost(int32, tag = "1")]
        pub revision: i32,
        /// The Id of this operation.  Needs to be unique within the scope of the
        /// revision.
        #[deprecated]
        #[prost(int32, tag = "2")]
        pub id: i32,
        /// References to the original elements that are replaced.
        #[prost(message, repeated, tag = "3")]
        pub parents: ::prost::alloc::vec::Vec<provenance::Parent>,
        /// The type of provenance operation.
        #[prost(enumeration = "provenance::OperationType", tag = "4")]
        pub r#type: i32,
    }
    /// Nested message and enum types in `Provenance`.
    pub mod provenance {
        /// The parent element the current element is based on. Used for
        /// referencing/aligning, removal and replacement operations.
        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct Parent {
            /// The index of the index into current revision's parent_ids list.
            #[prost(int32, tag = "1")]
            pub revision: i32,
            /// The index of the parent item in the corresponding item list (eg. list
            /// of entities, properties within entities, etc.) in the parent revision.
            #[prost(int32, tag = "3")]
            pub index: i32,
            /// The id of the parent provenance.
            #[deprecated]
            #[prost(int32, tag = "2")]
            pub id: i32,
        }
        /// If a processor or agent does an explicit operation on existing elements.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum OperationType {
            /// Operation type unspecified. If no operation is specified a provenance
            /// entry is simply used to match against a `parent`.
            Unspecified = 0,
            /// Add an element.
            Add = 1,
            /// Remove an element identified by `parent`.
            Remove = 2,
            /// Updates any fields within the given provenance scope of the message. It
            /// overwrites the fields rather than replacing them.  Use this when you
            /// want to update a field value of an entity without also updating all the
            /// child properties.
            Update = 7,
            /// Currently unused. Replace an element identified by `parent`.
            Replace = 3,
            /// Deprecated. Request human review for the element identified by
            /// `parent`.
            EvalRequested = 4,
            /// Deprecated. Element is reviewed and approved at human review,
            /// confidence will be set to 1.0.
            EvalApproved = 5,
            /// Deprecated. Element is skipped in the validation process.
            EvalSkipped = 6,
        }
        impl OperationType {
            /// 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 => "OPERATION_TYPE_UNSPECIFIED",
                    Self::Add => "ADD",
                    Self::Remove => "REMOVE",
                    Self::Update => "UPDATE",
                    Self::Replace => "REPLACE",
                    Self::EvalRequested => "EVAL_REQUESTED",
                    Self::EvalApproved => "EVAL_APPROVED",
                    Self::EvalSkipped => "EVAL_SKIPPED",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "OPERATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                    "ADD" => Some(Self::Add),
                    "REMOVE" => Some(Self::Remove),
                    "UPDATE" => Some(Self::Update),
                    "REPLACE" => Some(Self::Replace),
                    "EVAL_REQUESTED" => Some(Self::EvalRequested),
                    "EVAL_APPROVED" => Some(Self::EvalApproved),
                    "EVAL_SKIPPED" => Some(Self::EvalSkipped),
                    _ => None,
                }
            }
        }
    }
    /// Contains past or forward revisions of this document.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct Revision {
        /// Id of the revision, internally generated by doc proto storage.
        /// Unique within the context of the document.
        #[prost(string, tag = "1")]
        pub id: ::prost::alloc::string::String,
        /// The revisions that this revision is based on.  This can include one or
        /// more parent (when documents are merged.)  This field represents the
        /// index into the `revisions` field.
        #[deprecated]
        #[prost(int32, repeated, packed = "false", tag = "2")]
        pub parent: ::prost::alloc::vec::Vec<i32>,
        /// The revisions that this revision is based on. Must include all the ids
        /// that have anything to do with this revision - eg. there are
        /// `provenance.parent.revision` fields that index into this field.
        #[prost(string, repeated, tag = "7")]
        pub parent_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
        /// The time that the revision was created, internally generated by
        /// doc proto storage at the time of create.
        #[prost(message, optional, tag = "3")]
        pub create_time: ::core::option::Option<::prost_types::Timestamp>,
        /// Human Review information of this revision.
        #[prost(message, optional, tag = "6")]
        pub human_review: ::core::option::Option<revision::HumanReview>,
        /// Who/what made the change
        #[prost(oneof = "revision::Source", tags = "4, 5")]
        pub source: ::core::option::Option<revision::Source>,
    }
    /// Nested message and enum types in `Revision`.
    pub mod revision {
        /// Human Review information of the document.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct HumanReview {
            /// Human review state. e.g. `requested`, `succeeded`, `rejected`.
            #[prost(string, tag = "1")]
            pub state: ::prost::alloc::string::String,
            /// A message providing more details about the current state of processing.
            /// For example, the rejection reason when the state is `rejected`.
            #[prost(string, tag = "2")]
            pub state_message: ::prost::alloc::string::String,
        }
        /// Who/what made the change
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
        pub enum Source {
            /// If the change was made by a person specify the name or id of that
            /// person.
            #[prost(string, tag = "4")]
            Agent(::prost::alloc::string::String),
            /// If the annotation was made by processor identify the processor by its
            /// resource name.
            #[prost(string, tag = "5")]
            Processor(::prost::alloc::string::String),
        }
    }
    /// This message is used for text changes aka. OCR corrections.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct TextChange {
        /// Provenance of the correction.
        /// Text anchor indexing into the
        /// \[Document.text\]\[google.cloud.documentai.v1beta3.Document.text\].  There
        /// can only be a single `TextAnchor.text_segments` element.  If the start
        /// and end index of the text segment are the same, the text change is
        /// inserted before that index.
        #[prost(message, optional, tag = "1")]
        pub text_anchor: ::core::option::Option<TextAnchor>,
        /// The text that replaces the text identified in the `text_anchor`.
        #[prost(string, tag = "2")]
        pub changed_text: ::prost::alloc::string::String,
        /// The history of this annotation.
        #[deprecated]
        #[prost(message, repeated, tag = "3")]
        pub provenance: ::prost::alloc::vec::Vec<Provenance>,
    }
    /// Represents the annotation of a block or a chunk.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct Annotations {
        /// The description of the content with this annotation.
        #[prost(string, tag = "1")]
        pub description: ::prost::alloc::string::String,
    }
    /// Represents the parsed layout of a document as a collection of blocks that
    /// the document is divided into.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct DocumentLayout {
        /// List of blocks in the document.
        #[prost(message, repeated, tag = "1")]
        pub blocks: ::prost::alloc::vec::Vec<document_layout::DocumentLayoutBlock>,
    }
    /// Nested message and enum types in `DocumentLayout`.
    pub mod document_layout {
        /// Represents a block. A block could be one of the various types (text,
        /// table, list) supported.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct DocumentLayoutBlock {
            /// ID of the block.
            #[prost(string, tag = "1")]
            pub block_id: ::prost::alloc::string::String,
            /// Page span of the block.
            #[prost(message, optional, tag = "5")]
            pub page_span: ::core::option::Option<document_layout_block::LayoutPageSpan>,
            /// Identifies the bounding box for the block.
            #[prost(message, optional, tag = "6")]
            pub bounding_box: ::core::option::Option<super::super::BoundingPoly>,
            #[prost(oneof = "document_layout_block::Block", tags = "2, 3, 4, 7")]
            pub block: ::core::option::Option<document_layout_block::Block>,
        }
        /// Nested message and enum types in `DocumentLayoutBlock`.
        pub mod document_layout_block {
            /// Represents where the block starts and ends in the document.
            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
            pub struct LayoutPageSpan {
                /// Page where block starts in the document.
                #[prost(int32, tag = "1")]
                pub page_start: i32,
                /// Page where block ends in the document.
                #[prost(int32, tag = "2")]
                pub page_end: i32,
            }
            /// Represents a text type block.
            #[derive(Clone, PartialEq, ::prost::Message)]
            pub struct LayoutTextBlock {
                /// Text content stored in the block.
                #[prost(string, tag = "1")]
                pub text: ::prost::alloc::string::String,
                /// Type of the text in the block. Available options are: `paragraph`,
                /// `subtitle`, `heading-1`, `heading-2`, `heading-3`, `heading-4`,
                /// `heading-5`, `header`, `footer`.
                #[prost(string, tag = "2")]
                pub r#type: ::prost::alloc::string::String,
                /// A text block could further have child blocks.
                /// Repeated blocks support further hierarchies and nested blocks.
                #[prost(message, repeated, tag = "3")]
                pub blocks: ::prost::alloc::vec::Vec<super::DocumentLayoutBlock>,
            }
            /// Represents a table type block.
            #[derive(Clone, PartialEq, ::prost::Message)]
            pub struct LayoutTableBlock {
                /// Header rows at the top of the table.
                #[prost(message, repeated, tag = "1")]
                pub header_rows: ::prost::alloc::vec::Vec<LayoutTableRow>,
                /// Body rows containing main table content.
                #[prost(message, repeated, tag = "2")]
                pub body_rows: ::prost::alloc::vec::Vec<LayoutTableRow>,
                /// Table caption/title.
                #[prost(string, tag = "3")]
                pub caption: ::prost::alloc::string::String,
            }
            /// Represents a row in a table.
            #[derive(Clone, PartialEq, ::prost::Message)]
            pub struct LayoutTableRow {
                /// A table row is a list of table cells.
                #[prost(message, repeated, tag = "1")]
                pub cells: ::prost::alloc::vec::Vec<LayoutTableCell>,
            }
            /// Represents a cell in a table row.
            #[derive(Clone, PartialEq, ::prost::Message)]
            pub struct LayoutTableCell {
                /// A table cell is a list of blocks.
                /// Repeated blocks support further hierarchies and nested blocks.
                #[prost(message, repeated, tag = "1")]
                pub blocks: ::prost::alloc::vec::Vec<super::DocumentLayoutBlock>,
                /// How many rows this cell spans.
                #[prost(int32, tag = "2")]
                pub row_span: i32,
                /// How many columns this cell spans.
                #[prost(int32, tag = "3")]
                pub col_span: i32,
            }
            /// Represents a list type block.
            #[derive(Clone, PartialEq, ::prost::Message)]
            pub struct LayoutListBlock {
                /// List entries that constitute a list block.
                #[prost(message, repeated, tag = "1")]
                pub list_entries: ::prost::alloc::vec::Vec<LayoutListEntry>,
                /// Type of the list_entries (if exist). Available options are `ordered`
                /// and `unordered`.
                #[prost(string, tag = "2")]
                pub r#type: ::prost::alloc::string::String,
            }
            /// Represents an entry in the list.
            #[derive(Clone, PartialEq, ::prost::Message)]
            pub struct LayoutListEntry {
                /// A list entry is a list of blocks.
                /// Repeated blocks support further hierarchies and nested blocks.
                #[prost(message, repeated, tag = "1")]
                pub blocks: ::prost::alloc::vec::Vec<super::DocumentLayoutBlock>,
            }
            /// Represents an image type block.
            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
            pub struct LayoutImageBlock {
                /// Mime type of the image. An IANA published \[media type (MIME type)\]
                /// (<https://www.iana.org/assignments/media-types/media-types.xhtml>).
                #[prost(string, tag = "1")]
                pub mime_type: ::prost::alloc::string::String,
                /// Text extracted from the image using OCR or alt text describing the
                /// image.
                #[prost(string, tag = "2")]
                pub image_text: ::prost::alloc::string::String,
                /// Annotation of the image block.
                #[prost(message, optional, tag = "3")]
                pub annotations: ::core::option::Option<super::super::Annotations>,
                /// Source of the image.
                #[prost(oneof = "layout_image_block::ImageSource", tags = "4, 5, 6")]
                pub image_source: ::core::option::Option<
                    layout_image_block::ImageSource,
                >,
            }
            /// Nested message and enum types in `LayoutImageBlock`.
            pub mod layout_image_block {
                /// Source of the image.
                #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
                pub enum ImageSource {
                    /// Optional. Asset id of the inline image. If set, find the image
                    /// content in the blob_assets field.
                    #[prost(string, tag = "4")]
                    BlobAssetId(::prost::alloc::string::String),
                    /// Optional. Google Cloud Storage uri of the image.
                    #[prost(string, tag = "5")]
                    GcsUri(::prost::alloc::string::String),
                    /// Optional. Data uri of the image.
                    /// It is composed of four parts: a prefix (data:), a MIME type
                    /// indicating the type of data, an optional base64 token if
                    /// non-textual, and the data itself:
                    /// data:\[<mediatype>\]\[;base64\],<data>
                    #[prost(string, tag = "6")]
                    DataUri(::prost::alloc::string::String),
                }
            }
            #[derive(Clone, PartialEq, ::prost::Oneof)]
            pub enum Block {
                /// Block consisting of text content.
                #[prost(message, tag = "2")]
                TextBlock(LayoutTextBlock),
                /// Block consisting of table content/structure.
                #[prost(message, tag = "3")]
                TableBlock(LayoutTableBlock),
                /// Block consisting of list content/structure.
                #[prost(message, tag = "4")]
                ListBlock(LayoutListBlock),
                /// Block consisting of image content.
                #[prost(message, tag = "7")]
                ImageBlock(LayoutImageBlock),
            }
        }
    }
    /// Represents the chunks that the document is divided into.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ChunkedDocument {
        /// List of chunks.
        #[prost(message, repeated, tag = "1")]
        pub chunks: ::prost::alloc::vec::Vec<chunked_document::Chunk>,
    }
    /// Nested message and enum types in `ChunkedDocument`.
    pub mod chunked_document {
        /// Represents a chunk.
        #[derive(Clone, PartialEq, ::prost::Message)]
        pub struct Chunk {
            /// ID of the chunk.
            #[prost(string, tag = "1")]
            pub chunk_id: ::prost::alloc::string::String,
            /// Unused.
            #[prost(string, repeated, tag = "2")]
            pub source_block_ids: ::prost::alloc::vec::Vec<
                ::prost::alloc::string::String,
            >,
            /// Text content of the chunk.
            #[prost(string, tag = "3")]
            pub content: ::prost::alloc::string::String,
            /// Page span of the chunk.
            #[prost(message, optional, tag = "4")]
            pub page_span: ::core::option::Option<chunk::ChunkPageSpan>,
            /// Page headers associated with the chunk.
            #[prost(message, repeated, tag = "5")]
            pub page_headers: ::prost::alloc::vec::Vec<chunk::ChunkPageHeader>,
            /// Page footers associated with the chunk.
            #[prost(message, repeated, tag = "6")]
            pub page_footers: ::prost::alloc::vec::Vec<chunk::ChunkPageFooter>,
            /// Chunk fields inside this chunk.
            #[prost(message, repeated, tag = "7")]
            pub chunk_fields: ::prost::alloc::vec::Vec<chunk::ChunkField>,
        }
        /// Nested message and enum types in `Chunk`.
        pub mod chunk {
            /// Represents where the chunk starts and ends in the document.
            #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
            pub struct ChunkPageSpan {
                /// Page where chunk starts in the document.
                #[prost(int32, tag = "1")]
                pub page_start: i32,
                /// Page where chunk ends in the document.
                #[prost(int32, tag = "2")]
                pub page_end: i32,
            }
            /// Represents the page header associated with the chunk.
            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
            pub struct ChunkPageHeader {
                /// Header in text format.
                #[prost(string, tag = "1")]
                pub text: ::prost::alloc::string::String,
                /// Page span of the header.
                #[prost(message, optional, tag = "2")]
                pub page_span: ::core::option::Option<ChunkPageSpan>,
            }
            /// Represents the page footer associated with the chunk.
            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
            pub struct ChunkPageFooter {
                /// Footer in text format.
                #[prost(string, tag = "1")]
                pub text: ::prost::alloc::string::String,
                /// Page span of the footer.
                #[prost(message, optional, tag = "2")]
                pub page_span: ::core::option::Option<ChunkPageSpan>,
            }
            /// The image chunk field in the chunk.
            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
            pub struct ImageChunkField {
                /// Annotation of the image chunk field.
                #[prost(message, optional, tag = "4")]
                pub annotations: ::core::option::Option<super::super::Annotations>,
                /// Source of the image.
                #[prost(oneof = "image_chunk_field::ImageSource", tags = "1, 2, 3")]
                pub image_source: ::core::option::Option<image_chunk_field::ImageSource>,
            }
            /// Nested message and enum types in `ImageChunkField`.
            pub mod image_chunk_field {
                /// Source of the image.
                #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
                pub enum ImageSource {
                    /// Optional. Asset id of the inline image. If set, find the image
                    /// content in the blob_assets field.
                    #[prost(string, tag = "1")]
                    BlobAssetId(::prost::alloc::string::String),
                    /// Optional. Google Cloud Storage uri of the image.
                    #[prost(string, tag = "2")]
                    GcsUri(::prost::alloc::string::String),
                    /// Optional. Data uri of the image.
                    /// It is composed of four parts: a prefix (data:), a MIME type
                    /// indicating the type of data, an optional base64 token if
                    /// non-textual, and the data itself:
                    /// data:\[<mediatype>\]\[;base64\],<data>
                    #[prost(string, tag = "3")]
                    DataUri(::prost::alloc::string::String),
                }
            }
            /// The table chunk field in the chunk.
            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
            pub struct TableChunkField {
                /// Annotation of the table chunk field.
                #[prost(message, optional, tag = "1")]
                pub annotations: ::core::option::Option<super::super::Annotations>,
            }
            /// The chunk field in the chunk. A chunk field could be one of the various
            /// types (e.g. image, table) supported.
            #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
            pub struct ChunkField {
                /// The type of the chunk field.
                #[prost(oneof = "chunk_field::FieldType", tags = "1, 2")]
                pub field_type: ::core::option::Option<chunk_field::FieldType>,
            }
            /// Nested message and enum types in `ChunkField`.
            pub mod chunk_field {
                /// The type of the chunk field.
                #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
                pub enum FieldType {
                    /// The image chunk field in the chunk.
                    #[prost(message, tag = "1")]
                    ImageChunkField(super::ImageChunkField),
                    /// The table chunk field in the chunk.
                    #[prost(message, tag = "2")]
                    TableChunkField(super::TableChunkField),
                }
            }
        }
    }
    /// Represents a blob asset. It's used to store the content of the inline blob
    /// in this document, e.g. image bytes, such that it can be referenced by
    /// other fields in the document via asset id.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct BlobAsset {
        /// Optional. The id of the blob asset.
        #[prost(string, tag = "1")]
        pub asset_id: ::prost::alloc::string::String,
        /// Optional. The content of the blob asset, e.g. image bytes.
        #[prost(bytes = "vec", tag = "2")]
        pub content: ::prost::alloc::vec::Vec<u8>,
        /// The mime type of the blob asset.
        /// An IANA published [media type (MIME
        /// type)](<https://www.iana.org/assignments/media-types/media-types.xhtml>).
        #[prost(string, tag = "3")]
        pub mime_type: ::prost::alloc::string::String,
    }
    /// Original source document from the user.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Source {
        /// Optional. Currently supports Google Cloud Storage URI of the form
        /// `gs://bucket_name/object_name`. Object versioning is not supported.
        /// For more information, refer to [Google Cloud Storage Request
        /// URIs](<https://cloud.google.com/storage/docs/reference-uris>).
        #[prost(string, tag = "1")]
        Uri(::prost::alloc::string::String),
        /// Optional. Inline document content, represented as a stream of bytes.
        /// Note: As with all `bytes` fields, protobuffers use a pure binary
        /// representation, whereas JSON representations use base64.
        #[prost(bytes, tag = "2")]
        Content(::prost::alloc::vec::Vec<u8>),
    }
}
/// The revision reference specifies which revision on the document to read.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RevisionRef {
    /// Specifies which revision to read.
    #[prost(oneof = "revision_ref::Source", tags = "1, 2, 3")]
    pub source: ::core::option::Option<revision_ref::Source>,
}
/// Nested message and enum types in `RevisionRef`.
pub mod revision_ref {
    /// Some predefined revision cases.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum RevisionCase {
        /// Unspecified case, fall back to read the `LATEST_HUMAN_REVIEW`.
        Unspecified = 0,
        /// The latest revision made by a human.
        LatestHumanReview = 1,
        /// The latest revision based on timestamp.
        LatestTimestamp = 2,
        /// The first (OCR) revision.
        BaseOcrRevision = 3,
    }
    impl RevisionCase {
        /// 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 => "REVISION_CASE_UNSPECIFIED",
                Self::LatestHumanReview => "LATEST_HUMAN_REVIEW",
                Self::LatestTimestamp => "LATEST_TIMESTAMP",
                Self::BaseOcrRevision => "BASE_OCR_REVISION",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "REVISION_CASE_UNSPECIFIED" => Some(Self::Unspecified),
                "LATEST_HUMAN_REVIEW" => Some(Self::LatestHumanReview),
                "LATEST_TIMESTAMP" => Some(Self::LatestTimestamp),
                "BASE_OCR_REVISION" => Some(Self::BaseOcrRevision),
                _ => None,
            }
        }
    }
    /// Specifies which revision to read.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Source {
        /// Reads the revision by the predefined case.
        #[prost(enumeration = "RevisionCase", tag = "1")]
        RevisionCase(i32),
        /// Reads the revision given by the id.
        #[prost(string, tag = "2")]
        RevisionId(::prost::alloc::string::String),
        /// Reads the revision generated by the processor version.
        /// The format takes the full resource name of processor version.
        /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
        #[prost(string, tag = "3")]
        LatestProcessorVersion(::prost::alloc::string::String),
    }
}
/// Payload message of raw document content (bytes).
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct RawDocument {
    /// Inline document content.
    #[prost(bytes = "vec", tag = "1")]
    pub content: ::prost::alloc::vec::Vec<u8>,
    /// An IANA MIME type (RFC6838) indicating the nature and format of the
    /// \[content\]\[google.cloud.documentai.v1beta3.RawDocument.content\].
    #[prost(string, tag = "2")]
    pub mime_type: ::prost::alloc::string::String,
    /// The display name of the document, it supports all Unicode characters except
    /// the following:
    /// `*`, `?`, `\[`, `\]`, `%`, `{`, `}`,`'`, `\"`, `,`
    /// `~`, `=` and `:` are reserved.
    /// If not specified, a default ID is generated.
    #[prost(string, tag = "3")]
    pub display_name: ::prost::alloc::string::String,
}
/// Specifies a document stored on Cloud Storage.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GcsDocument {
    /// The Cloud Storage object uri.
    #[prost(string, tag = "1")]
    pub gcs_uri: ::prost::alloc::string::String,
    /// An IANA MIME type (RFC6838) of the content.
    #[prost(string, tag = "2")]
    pub mime_type: ::prost::alloc::string::String,
}
/// Specifies a set of documents on Cloud Storage.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GcsDocuments {
    /// The list of documents.
    #[prost(message, repeated, tag = "1")]
    pub documents: ::prost::alloc::vec::Vec<GcsDocument>,
}
/// Specifies all documents on Cloud Storage with a common prefix.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GcsPrefix {
    /// The URI prefix.
    #[prost(string, tag = "1")]
    pub gcs_uri_prefix: ::prost::alloc::string::String,
}
/// The common config to specify a set of documents used as input.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchDocumentsInputConfig {
    /// The source. Make sure that the caller of the API has storage.objects.get
    /// access to the buckets.
    #[prost(oneof = "batch_documents_input_config::Source", tags = "1, 2")]
    pub source: ::core::option::Option<batch_documents_input_config::Source>,
}
/// Nested message and enum types in `BatchDocumentsInputConfig`.
pub mod batch_documents_input_config {
    /// The source. Make sure that the caller of the API has storage.objects.get
    /// access to the buckets.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Source {
        /// The set of documents that match the specified Cloud Storage `gcs_prefix`.
        #[prost(message, tag = "1")]
        GcsPrefix(super::GcsPrefix),
        /// The set of documents individually specified on Cloud Storage.
        #[prost(message, tag = "2")]
        GcsDocuments(super::GcsDocuments),
    }
}
/// Config that controls the output of documents. All documents will be written
/// as a JSON file.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DocumentOutputConfig {
    /// The destination of the results.
    #[prost(oneof = "document_output_config::Destination", tags = "1")]
    pub destination: ::core::option::Option<document_output_config::Destination>,
}
/// Nested message and enum types in `DocumentOutputConfig`.
pub mod document_output_config {
    /// The configuration used when outputting documents.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct GcsOutputConfig {
        /// The Cloud Storage uri (a directory) of the output.
        #[prost(string, tag = "1")]
        pub gcs_uri: ::prost::alloc::string::String,
        /// Specifies which fields to include in the output documents.
        /// Only supports top level document and pages field so it must be in the
        /// form of `{document_field_name}` or `pages.{page_field_name}`.
        #[prost(message, optional, tag = "2")]
        pub field_mask: ::core::option::Option<::prost_types::FieldMask>,
        /// Specifies the sharding config for the output document.
        #[prost(message, optional, tag = "3")]
        pub sharding_config: ::core::option::Option<gcs_output_config::ShardingConfig>,
    }
    /// Nested message and enum types in `GcsOutputConfig`.
    pub mod gcs_output_config {
        /// The sharding config for the output document.
        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct ShardingConfig {
            /// The number of pages per shard.
            #[prost(int32, tag = "1")]
            pub pages_per_shard: i32,
            /// The number of overlapping pages between consecutive shards.
            #[prost(int32, tag = "2")]
            pub pages_overlap: i32,
        }
    }
    /// The destination of the results.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Destination {
        /// Output config to write the results to Cloud Storage.
        #[prost(message, tag = "1")]
        GcsOutputConfig(GcsOutputConfig),
    }
}
/// Config for Document OCR.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct OcrConfig {
    /// Hints for the OCR model.
    #[prost(message, optional, tag = "2")]
    pub hints: ::core::option::Option<ocr_config::Hints>,
    /// Enables special handling for PDFs with existing text information. Results
    /// in better text extraction quality in such PDF inputs.
    #[prost(bool, tag = "3")]
    pub enable_native_pdf_parsing: bool,
    /// Enables intelligent document quality scores after OCR. Can help with
    /// diagnosing why OCR responses are of poor quality for a given input.
    /// Adds additional latency comparable to regular OCR to the process call.
    #[prost(bool, tag = "4")]
    pub enable_image_quality_scores: bool,
    /// A list of advanced OCR options to further fine-tune OCR behavior. Current
    /// valid values are:
    ///
    /// * `legacy_layout`: a heuristics layout detection algorithm, which serves as
    ///   an alternative to the current ML-based layout detection algorithm.
    ///   Customers can choose the best suitable layout algorithm based on their
    ///   situation.
    #[prost(string, repeated, tag = "5")]
    pub advanced_ocr_options: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    /// Includes symbol level OCR information if set to true.
    #[prost(bool, tag = "6")]
    pub enable_symbol: bool,
    /// Turn on font identification model and return font style information.
    /// Deprecated, use
    /// \[PremiumFeatures.compute_style_info\]\[google.cloud.documentai.v1beta3.OcrConfig.PremiumFeatures.compute_style_info\]
    /// instead.
    #[deprecated]
    #[prost(bool, tag = "8")]
    pub compute_style_info: bool,
    /// Turn off character box detector in OCR engine. Character box detection is
    /// enabled by default in OCR 2.0 (and later) processors.
    #[prost(bool, tag = "10")]
    pub disable_character_boxes_detection: bool,
    /// Configurations for premium OCR features.
    #[prost(message, optional, tag = "11")]
    pub premium_features: ::core::option::Option<ocr_config::PremiumFeatures>,
}
/// Nested message and enum types in `OcrConfig`.
pub mod ocr_config {
    /// Hints for OCR Engine
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct Hints {
        /// List of BCP-47 language codes to use for OCR. In most cases, not
        /// specifying it yields the best results since it enables automatic language
        /// detection. For languages based on the Latin alphabet, setting hints is
        /// not needed. In rare cases, when the language of the text in the
        /// image is known, setting a hint will help get better results (although it
        /// will be a significant hindrance if the hint is wrong).
        #[prost(string, repeated, tag = "1")]
        pub language_hints: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
    }
    /// Configurations for premium OCR features.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct PremiumFeatures {
        /// Turn on selection mark detector in OCR engine. Only available in OCR 2.0
        /// (and later) processors.
        #[prost(bool, tag = "3")]
        pub enable_selection_mark_detection: bool,
        /// Turn on font identification model and return font style information.
        #[prost(bool, tag = "4")]
        pub compute_style_info: bool,
        /// Turn on the model that can extract LaTeX math formulas.
        #[prost(bool, tag = "5")]
        pub enable_math_ocr: bool,
    }
}
/// Metadata for document summarization.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SummaryOptions {
    /// How long the summary should be.
    #[prost(enumeration = "summary_options::Length", tag = "1")]
    pub length: i32,
    /// The format the summary should be in.
    #[prost(enumeration = "summary_options::Format", tag = "2")]
    pub format: i32,
}
/// Nested message and enum types in `SummaryOptions`.
pub mod summary_options {
    /// The Length enum.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Length {
        /// Default.
        Unspecified = 0,
        /// A brief summary of one or two sentences.
        Brief = 1,
        /// A paragraph-length summary.
        Moderate = 2,
        /// The longest option available.
        Comprehensive = 3,
    }
    impl Length {
        /// 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 => "LENGTH_UNSPECIFIED",
                Self::Brief => "BRIEF",
                Self::Moderate => "MODERATE",
                Self::Comprehensive => "COMPREHENSIVE",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "LENGTH_UNSPECIFIED" => Some(Self::Unspecified),
                "BRIEF" => Some(Self::Brief),
                "MODERATE" => Some(Self::Moderate),
                "COMPREHENSIVE" => Some(Self::Comprehensive),
                _ => None,
            }
        }
    }
    /// The Format enum.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Format {
        /// Default.
        Unspecified = 0,
        /// Format the output in paragraphs.
        Paragraph = 1,
        /// Format the output in bullets.
        Bullets = 2,
    }
    impl Format {
        /// 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 => "FORMAT_UNSPECIFIED",
                Self::Paragraph => "PARAGRAPH",
                Self::Bullets => "BULLETS",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "FORMAT_UNSPECIFIED" => Some(Self::Unspecified),
                "PARAGRAPH" => Some(Self::Paragraph),
                "BULLETS" => Some(Self::Bullets),
                _ => None,
            }
        }
    }
}
/// Metadata for how this field value is extracted.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FieldExtractionMetadata {
    /// Summary options config.
    #[prost(message, optional, tag = "2")]
    pub summary_options: ::core::option::Option<SummaryOptions>,
}
/// Metadata about a property.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct PropertyMetadata {
    /// Whether the property should be considered as "inactive".
    #[prost(bool, tag = "3")]
    pub inactive: bool,
    /// Field extraction metadata on the property.
    #[prost(message, optional, tag = "9")]
    pub field_extraction_metadata: ::core::option::Option<FieldExtractionMetadata>,
}
/// Metadata about an entity type.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EntityTypeMetadata {
    /// Whether the entity type should be considered inactive.
    #[prost(bool, tag = "5")]
    pub inactive: bool,
}
/// The schema defines the output of the processed document by a processor.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DocumentSchema {
    /// Display name to show to users.
    #[prost(string, tag = "1")]
    pub display_name: ::prost::alloc::string::String,
    /// Description of the schema.
    #[prost(string, tag = "2")]
    pub description: ::prost::alloc::string::String,
    /// Entity types of the schema.
    #[prost(message, repeated, tag = "3")]
    pub entity_types: ::prost::alloc::vec::Vec<document_schema::EntityType>,
    /// Metadata of the schema.
    #[prost(message, optional, tag = "4")]
    pub metadata: ::core::option::Option<document_schema::Metadata>,
}
/// Nested message and enum types in `DocumentSchema`.
pub mod document_schema {
    /// EntityType is the wrapper of a label of the corresponding model with
    /// detailed attributes and limitations for entity-based processors. Multiple
    /// types can also compose a dependency tree to represent nested types.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct EntityType {
        /// User defined name for the type.
        #[prost(string, tag = "13")]
        pub display_name: ::prost::alloc::string::String,
        /// Name of the type. It must be unique within the schema file and
        /// cannot be a "Common Type".  The following naming conventions are used:
        ///
        /// * Use `snake_casing`.
        /// * Name matching is case-sensitive.
        /// * Maximum 64 characters.
        /// * Must start with a letter.
        /// * Allowed characters: ASCII letters `\[a-z0-9_-\]`.  (For backward
        ///   compatibility internal infrastructure and tooling can handle any ascii
        ///   character.)
        /// * The `/` is sometimes used to denote a property of a type.  For example
        ///   `line_item/amount`.  This convention is deprecated, but will still be
        ///   honored for backward compatibility.
        #[prost(string, tag = "1")]
        pub name: ::prost::alloc::string::String,
        /// The description of the entity type. Could be used to provide more
        /// information about the entity type for model calls.
        #[prost(string, tag = "15")]
        pub description: ::prost::alloc::string::String,
        /// The entity type that this type is derived from.  For now, one and only
        /// one should be set.
        #[prost(string, repeated, tag = "2")]
        pub base_types: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
        /// Description the nested structure, or composition of an entity.
        #[prost(message, repeated, tag = "6")]
        pub properties: ::prost::alloc::vec::Vec<entity_type::Property>,
        /// Metadata for the entity type.
        #[prost(message, optional, tag = "11")]
        pub entity_type_metadata: ::core::option::Option<super::EntityTypeMetadata>,
        #[prost(oneof = "entity_type::ValueSource", tags = "14")]
        pub value_source: ::core::option::Option<entity_type::ValueSource>,
    }
    /// Nested message and enum types in `EntityType`.
    pub mod entity_type {
        /// Defines the a list of enum values.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct EnumValues {
            /// The individual values that this enum values type can include.
            #[prost(string, repeated, tag = "1")]
            pub values: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
        }
        /// Defines properties that can be part of the entity type.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct Property {
            /// The name of the property.  Follows the same guidelines as the
            /// EntityType name.
            #[prost(string, tag = "1")]
            pub name: ::prost::alloc::string::String,
            /// The description of the property. Could be used to provide more
            /// information about the property for model calls.
            #[prost(string, tag = "7")]
            pub description: ::prost::alloc::string::String,
            /// User defined name for the property.
            #[prost(string, tag = "6")]
            pub display_name: ::prost::alloc::string::String,
            /// A reference to the value type of the property.  This type is subject
            /// to the same conventions as the `Entity.base_types` field.
            #[prost(string, tag = "2")]
            pub value_type: ::prost::alloc::string::String,
            /// Occurrence type limits the number of instances an entity type appears
            /// in the document.
            #[prost(enumeration = "property::OccurrenceType", tag = "3")]
            pub occurrence_type: i32,
            /// Any additional metadata about the property can be added here.
            #[prost(message, optional, tag = "5")]
            pub property_metadata: ::core::option::Option<
                super::super::PropertyMetadata,
            >,
        }
        /// Nested message and enum types in `Property`.
        pub mod property {
            /// Types of occurrences of the entity type in the document.  This
            /// represents the number of instances, not mentions, of an entity.
            /// For example, a bank statement might only have one
            /// `account_number`, but this account number can be mentioned in several
            /// places on the document.  In this case, the `account_number` is
            /// considered a `REQUIRED_ONCE` entity type. If, on the other hand, we
            /// expect a bank statement to contain the status of multiple different
            /// accounts for the customers, the occurrence type is set to
            /// `REQUIRED_MULTIPLE`.
            #[derive(
                Clone,
                Copy,
                Debug,
                PartialEq,
                Eq,
                Hash,
                PartialOrd,
                Ord,
                ::prost::Enumeration
            )]
            #[repr(i32)]
            pub enum OccurrenceType {
                /// Unspecified occurrence type.
                Unspecified = 0,
                /// There will be zero or one instance of this entity type.  The same
                /// entity instance may be mentioned multiple times.
                OptionalOnce = 1,
                /// The entity type will appear zero or multiple times.
                OptionalMultiple = 2,
                /// The entity type will only appear exactly once.  The same
                /// entity instance may be mentioned multiple times.
                RequiredOnce = 3,
                /// The entity type will appear once or more times.
                RequiredMultiple = 4,
            }
            impl OccurrenceType {
                /// 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 => "OCCURRENCE_TYPE_UNSPECIFIED",
                        Self::OptionalOnce => "OPTIONAL_ONCE",
                        Self::OptionalMultiple => "OPTIONAL_MULTIPLE",
                        Self::RequiredOnce => "REQUIRED_ONCE",
                        Self::RequiredMultiple => "REQUIRED_MULTIPLE",
                    }
                }
                /// Creates an enum from field names used in the ProtoBuf definition.
                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                    match value {
                        "OCCURRENCE_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                        "OPTIONAL_ONCE" => Some(Self::OptionalOnce),
                        "OPTIONAL_MULTIPLE" => Some(Self::OptionalMultiple),
                        "REQUIRED_ONCE" => Some(Self::RequiredOnce),
                        "REQUIRED_MULTIPLE" => Some(Self::RequiredMultiple),
                        _ => None,
                    }
                }
            }
        }
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
        pub enum ValueSource {
            /// If specified, lists all the possible values for this entity.  This
            /// should not be more than a handful of values.  If the number of values
            /// is >10 or could change frequently use the `EntityType.value_ontology`
            /// field and specify a list of all possible values in a value ontology
            /// file.
            #[prost(message, tag = "14")]
            EnumValues(EnumValues),
        }
    }
    /// Metadata for global schema behavior.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct Metadata {
        /// If true, a `document` entity type can be applied to subdocument
        /// (splitting). Otherwise, it can only be applied to the entire document
        /// (classification).
        #[prost(bool, tag = "1")]
        pub document_splitter: bool,
        /// If true, on a given page, there can be multiple `document` annotations
        /// covering it.
        #[prost(bool, tag = "2")]
        pub document_allow_multiple_labels: bool,
        /// If set, all the nested entities must be prefixed with the parents.
        #[prost(bool, tag = "6")]
        pub prefixed_naming_on_properties: bool,
        /// If set, we will skip the naming format validation in the schema. So the
        /// string values in `DocumentSchema.EntityType.name` and
        /// `DocumentSchema.EntityType.Property.name` will not be checked.
        #[prost(bool, tag = "7")]
        pub skip_naming_validation: bool,
    }
}
/// A singleton resource under a
/// \[Processor\]\[google.cloud.documentai.v1beta3.Processor\] which configures a
/// collection of documents.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct Dataset {
    /// Dataset resource name.
    /// Format:
    /// `projects/{project}/locations/{location}/processors/{processor}/dataset`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Required. State of the dataset. Ignored when updating dataset.
    #[prost(enumeration = "dataset::State", tag = "2")]
    pub state: i32,
    /// Output only. Reserved for future use.
    #[prost(bool, tag = "8")]
    pub satisfies_pzs: bool,
    /// Output only. Reserved for future use.
    #[prost(bool, tag = "9")]
    pub satisfies_pzi: bool,
    #[prost(oneof = "dataset::StorageSource", tags = "3, 5, 6")]
    pub storage_source: ::core::option::Option<dataset::StorageSource>,
    #[prost(oneof = "dataset::IndexingSource", tags = "4")]
    pub indexing_source: ::core::option::Option<dataset::IndexingSource>,
}
/// Nested message and enum types in `Dataset`.
pub mod dataset {
    /// Configuration specific to the Cloud Storage-based implementation.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct GcsManagedConfig {
        /// Required. The Cloud Storage URI (a directory) where the documents
        /// belonging to the dataset must be stored.
        #[prost(message, optional, tag = "1")]
        pub gcs_prefix: ::core::option::Option<super::GcsPrefix>,
    }
    /// Configuration specific to the Document AI Warehouse-based implementation.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct DocumentWarehouseConfig {
        /// Output only. The collection in Document AI Warehouse associated with the
        /// dataset.
        #[prost(string, tag = "1")]
        pub collection: ::prost::alloc::string::String,
        /// Output only. The schema in Document AI Warehouse associated with the
        /// dataset.
        #[prost(string, tag = "2")]
        pub schema: ::prost::alloc::string::String,
    }
    /// Configuration specific to an unmanaged dataset.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct UnmanagedDatasetConfig {}
    /// Configuration specific to spanner-based indexing.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct SpannerIndexingConfig {}
    /// Different states of a dataset.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// Default unspecified enum, should not be used.
        Unspecified = 0,
        /// Dataset has not been initialized.
        Uninitialized = 1,
        /// Dataset is being initialized.
        Initializing = 2,
        /// Dataset has been initialized.
        Initialized = 3,
    }
    impl State {
        /// 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 => "STATE_UNSPECIFIED",
                Self::Uninitialized => "UNINITIALIZED",
                Self::Initializing => "INITIALIZING",
                Self::Initialized => "INITIALIZED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "UNINITIALIZED" => Some(Self::Uninitialized),
                "INITIALIZING" => Some(Self::Initializing),
                "INITIALIZED" => Some(Self::Initialized),
                _ => None,
            }
        }
    }
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum StorageSource {
        /// Optional. User-managed Cloud Storage dataset configuration. Use this
        /// configuration if the dataset documents are stored under a user-managed
        /// Cloud Storage location.
        #[prost(message, tag = "3")]
        GcsManagedConfig(GcsManagedConfig),
        /// Optional. Deprecated. Warehouse-based dataset configuration is not
        /// supported.
        #[prost(message, tag = "5")]
        DocumentWarehouseConfig(DocumentWarehouseConfig),
        /// Optional. Unmanaged dataset configuration. Use this configuration if the
        /// dataset documents are managed by the document service internally (not
        /// user-managed).
        #[prost(message, tag = "6")]
        UnmanagedDatasetConfig(UnmanagedDatasetConfig),
    }
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum IndexingSource {
        /// Optional. A lightweight indexing source with low latency and high
        /// reliability, but lacking advanced features like CMEK and content-based
        /// search.
        #[prost(message, tag = "4")]
        SpannerIndexingConfig(SpannerIndexingConfig),
    }
}
/// Document Identifier.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DocumentId {
    /// Points to a specific revision of the document if set.
    #[prost(message, optional, tag = "3")]
    pub revision_ref: ::core::option::Option<RevisionRef>,
    #[prost(oneof = "document_id::Type", tags = "1, 4")]
    pub r#type: ::core::option::Option<document_id::Type>,
}
/// Nested message and enum types in `DocumentId`.
pub mod document_id {
    /// Identifies a document uniquely within the scope of a dataset in the
    /// user-managed Cloud Storage option.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct GcsManagedDocumentId {
        /// Required. The Cloud Storage URI where the actual document is stored.
        #[prost(string, tag = "1")]
        pub gcs_uri: ::prost::alloc::string::String,
        /// Id of the document (indexed) managed by Content Warehouse.
        #[deprecated]
        #[prost(string, tag = "2")]
        pub cw_doc_id: ::prost::alloc::string::String,
    }
    /// Identifies a document uniquely within the scope of a dataset in unmanaged
    /// option.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct UnmanagedDocumentId {
        /// Required. The id of the document.
        #[prost(string, tag = "1")]
        pub doc_id: ::prost::alloc::string::String,
    }
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Type {
        /// A document id within user-managed Cloud Storage.
        #[prost(message, tag = "1")]
        GcsManagedDocId(GcsManagedDocumentId),
        /// A document id within unmanaged dataset.
        #[prost(message, tag = "4")]
        UnmanagedDocId(UnmanagedDocumentId),
    }
}
/// Dataset Schema.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DatasetSchema {
    /// Dataset schema resource name.
    /// Format:
    /// `projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// Optional. Schema of the dataset.
    #[prost(message, optional, tag = "3")]
    pub document_schema: ::core::option::Option<DocumentSchema>,
    /// Output only. Reserved for future use.
    #[prost(bool, tag = "4")]
    pub satisfies_pzs: bool,
    /// Output only. Reserved for future use.
    #[prost(bool, tag = "5")]
    pub satisfies_pzi: bool,
}
/// Dataset documents that the batch operation will be applied to.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchDatasetDocuments {
    #[prost(oneof = "batch_dataset_documents::Criteria", tags = "1, 2")]
    pub criteria: ::core::option::Option<batch_dataset_documents::Criteria>,
}
/// Nested message and enum types in `BatchDatasetDocuments`.
pub mod batch_dataset_documents {
    /// List of individual DocumentIds.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct IndividualDocumentIds {
        /// Required. List of Document IDs indicating where the actual documents are
        /// stored.
        #[prost(message, repeated, tag = "1")]
        pub document_ids: ::prost::alloc::vec::Vec<super::DocumentId>,
    }
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Criteria {
        /// Document identifiers.
        #[prost(message, tag = "1")]
        IndividualDocumentIds(IndividualDocumentIds),
        /// A filter matching the documents.
        /// Follows the same format and restriction as
        /// \[google.cloud.documentai.master.ListDocumentsRequest.filter\].
        #[prost(string, tag = "2")]
        Filter(::prost::alloc::string::String),
    }
}
/// Gives a short summary of an evaluation, and links to the evaluation itself.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EvaluationReference {
    /// The resource name of the Long Running Operation for the evaluation.
    #[prost(string, tag = "1")]
    pub operation: ::prost::alloc::string::String,
    /// The resource name of the evaluation.
    #[prost(string, tag = "2")]
    pub evaluation: ::prost::alloc::string::String,
    /// An aggregate of the statistics for the evaluation with fuzzy matching on.
    #[prost(message, optional, tag = "4")]
    pub aggregate_metrics: ::core::option::Option<evaluation::Metrics>,
    /// An aggregate of the statistics for the evaluation with fuzzy matching off.
    #[prost(message, optional, tag = "5")]
    pub aggregate_metrics_exact: ::core::option::Option<evaluation::Metrics>,
}
/// An evaluation of a ProcessorVersion's performance.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Evaluation {
    /// The resource name of the evaluation.
    /// Format:
    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}/evaluations/{evaluation}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The time that the evaluation was created.
    #[prost(message, optional, tag = "2")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// Counters for the documents used in the evaluation.
    #[prost(message, optional, tag = "5")]
    pub document_counters: ::core::option::Option<evaluation::Counters>,
    /// Metrics for all the entities in aggregate.
    #[prost(message, optional, tag = "3")]
    pub all_entities_metrics: ::core::option::Option<evaluation::MultiConfidenceMetrics>,
    /// Metrics across confidence levels, for different entities.
    #[prost(map = "string, message", tag = "4")]
    pub entity_metrics: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        evaluation::MultiConfidenceMetrics,
    >,
    /// The KMS key name used for encryption.
    #[prost(string, tag = "6")]
    pub kms_key_name: ::prost::alloc::string::String,
    /// The KMS key version with which data is encrypted.
    #[prost(string, tag = "7")]
    pub kms_key_version_name: ::prost::alloc::string::String,
}
/// Nested message and enum types in `Evaluation`.
pub mod evaluation {
    /// Evaluation counters for the documents that were used.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct Counters {
        /// How many documents were sent for evaluation.
        #[prost(int32, tag = "1")]
        pub input_documents_count: i32,
        /// How many documents were not included in the evaluation as they didn't
        /// pass validation.
        #[prost(int32, tag = "2")]
        pub invalid_documents_count: i32,
        /// How many documents were not included in the evaluation as Document AI
        /// failed to process them.
        #[prost(int32, tag = "3")]
        pub failed_documents_count: i32,
        /// How many documents were used in the evaluation.
        #[prost(int32, tag = "4")]
        pub evaluated_documents_count: i32,
    }
    /// Evaluation metrics, either in aggregate or about a specific entity.
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct Metrics {
        /// The calculated precision.
        #[prost(float, tag = "1")]
        pub precision: f32,
        /// The calculated recall.
        #[prost(float, tag = "2")]
        pub recall: f32,
        /// The calculated f1 score.
        #[prost(float, tag = "3")]
        pub f1_score: f32,
        /// The amount of occurrences in predicted documents.
        #[prost(int32, tag = "4")]
        pub predicted_occurrences_count: i32,
        /// The amount of occurrences in ground truth documents.
        #[prost(int32, tag = "5")]
        pub ground_truth_occurrences_count: i32,
        /// The amount of documents with a predicted occurrence.
        #[prost(int32, tag = "10")]
        pub predicted_document_count: i32,
        /// The amount of documents with a ground truth occurrence.
        #[prost(int32, tag = "11")]
        pub ground_truth_document_count: i32,
        /// The amount of true positives.
        #[prost(int32, tag = "6")]
        pub true_positives_count: i32,
        /// The amount of false positives.
        #[prost(int32, tag = "7")]
        pub false_positives_count: i32,
        /// The amount of false negatives.
        #[prost(int32, tag = "8")]
        pub false_negatives_count: i32,
        /// The amount of documents that had an occurrence of this label.
        #[prost(int32, tag = "9")]
        pub total_documents_count: i32,
    }
    /// Evaluations metrics, at a specific confidence level.
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct ConfidenceLevelMetrics {
        /// The confidence level.
        #[prost(float, tag = "1")]
        pub confidence_level: f32,
        /// The metrics at the specific confidence level.
        #[prost(message, optional, tag = "2")]
        pub metrics: ::core::option::Option<Metrics>,
    }
    /// Metrics across multiple confidence levels.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct MultiConfidenceMetrics {
        /// Metrics across confidence levels with fuzzy matching enabled.
        #[prost(message, repeated, tag = "1")]
        pub confidence_level_metrics: ::prost::alloc::vec::Vec<ConfidenceLevelMetrics>,
        /// Metrics across confidence levels with only exact matching.
        #[prost(message, repeated, tag = "4")]
        pub confidence_level_metrics_exact: ::prost::alloc::vec::Vec<
            ConfidenceLevelMetrics,
        >,
        /// The calculated area under the precision recall curve (AUPRC), computed by
        /// integrating over all confidence thresholds.
        #[prost(float, tag = "2")]
        pub auprc: f32,
        /// The Estimated Calibration Error (ECE) of the confidence of the predicted
        /// entities.
        #[prost(float, tag = "3")]
        pub estimated_calibration_error: f32,
        /// The AUPRC for metrics with fuzzy matching disabled, i.e., exact matching
        /// only.
        #[prost(float, tag = "5")]
        pub auprc_exact: f32,
        /// The ECE for the predicted entities with fuzzy matching disabled, i.e.,
        /// exact matching only.
        #[prost(float, tag = "6")]
        pub estimated_calibration_error_exact: f32,
        /// The metrics type for the label.
        #[prost(enumeration = "multi_confidence_metrics::MetricsType", tag = "7")]
        pub metrics_type: i32,
    }
    /// Nested message and enum types in `MultiConfidenceMetrics`.
    pub mod multi_confidence_metrics {
        /// A type that determines how metrics should be interpreted.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum MetricsType {
            /// The metrics type is unspecified. By default, metrics without a
            /// particular specification are for leaf entity types (i.e., top-level
            /// entity types without child types, or child types which are not
            /// parent types themselves).
            Unspecified = 0,
            /// Indicates whether metrics for this particular label type represent an
            /// aggregate of metrics for other types instead of being based on actual
            /// TP/FP/FN values for the label type. Metrics for parent (i.e., non-leaf)
            /// entity types are an aggregate of metrics for their children.
            Aggregate = 1,
        }
        impl MetricsType {
            /// 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 => "METRICS_TYPE_UNSPECIFIED",
                    Self::Aggregate => "AGGREGATE",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "METRICS_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                    "AGGREGATE" => Some(Self::Aggregate),
                    _ => None,
                }
            }
        }
    }
}
/// The common metadata for long running operations.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct CommonOperationMetadata {
    /// The state of the operation.
    #[prost(enumeration = "common_operation_metadata::State", tag = "1")]
    pub state: i32,
    /// A message providing more details about the current state of processing.
    #[prost(string, tag = "2")]
    pub state_message: ::prost::alloc::string::String,
    /// A related resource to this operation.
    #[prost(string, tag = "5")]
    pub resource: ::prost::alloc::string::String,
    /// The creation time of the operation.
    #[prost(message, optional, tag = "3")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The last update time of the operation.
    #[prost(message, optional, tag = "4")]
    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
}
/// Nested message and enum types in `CommonOperationMetadata`.
pub mod common_operation_metadata {
    /// State of the longrunning operation.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// Unspecified state.
        Unspecified = 0,
        /// Operation is still running.
        Running = 1,
        /// Operation is being cancelled.
        Cancelling = 2,
        /// Operation succeeded.
        Succeeded = 3,
        /// Operation failed.
        Failed = 4,
        /// Operation is cancelled.
        Cancelled = 5,
    }
    impl State {
        /// 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 => "STATE_UNSPECIFIED",
                Self::Running => "RUNNING",
                Self::Cancelling => "CANCELLING",
                Self::Succeeded => "SUCCEEDED",
                Self::Failed => "FAILED",
                Self::Cancelled => "CANCELLED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "RUNNING" => Some(Self::Running),
                "CANCELLING" => Some(Self::Cancelling),
                "SUCCEEDED" => Some(Self::Succeeded),
                "FAILED" => Some(Self::Failed),
                "CANCELLED" => Some(Self::Cancelled),
                _ => None,
            }
        }
    }
}
/// A processor version is an implementation of a processor. Each processor
/// can have multiple versions, pretrained by Google internally or uptrained
/// by the customer. A processor can only have one default version at a time.
/// Its document-processing behavior is defined by that version.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessorVersion {
    /// Identifier. The resource name of the processor version.
    /// Format:
    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processor_version}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The display name of the processor version.
    #[prost(string, tag = "2")]
    pub display_name: ::prost::alloc::string::String,
    /// The schema of the processor version. Describes the output.
    #[prost(message, optional, tag = "12")]
    pub document_schema: ::core::option::Option<DocumentSchema>,
    /// Output only. The state of the processor version.
    #[prost(enumeration = "processor_version::State", tag = "6")]
    pub state: i32,
    /// The time the processor version was created.
    #[prost(message, optional, tag = "7")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The most recently invoked evaluation for the processor version.
    #[prost(message, optional, tag = "8")]
    pub latest_evaluation: ::core::option::Option<EvaluationReference>,
    /// The KMS key name used for encryption.
    #[prost(string, tag = "9")]
    pub kms_key_name: ::prost::alloc::string::String,
    /// The KMS key version with which data is encrypted.
    #[prost(string, tag = "10")]
    pub kms_key_version_name: ::prost::alloc::string::String,
    /// Output only. Denotes that this `ProcessorVersion` is managed by Google.
    #[prost(bool, tag = "11")]
    pub google_managed: bool,
    /// If set, information about the eventual deprecation of this version.
    #[prost(message, optional, tag = "13")]
    pub deprecation_info: ::core::option::Option<processor_version::DeprecationInfo>,
    /// Output only. The model type of this processor version.
    #[prost(enumeration = "processor_version::ModelType", tag = "15")]
    pub model_type: i32,
    /// Output only. Reserved for future use.
    #[prost(bool, tag = "16")]
    pub satisfies_pzs: bool,
    /// Output only. Reserved for future use.
    #[prost(bool, tag = "17")]
    pub satisfies_pzi: bool,
    /// Output only. Information about Generative AI model-based processor
    /// versions.
    #[prost(message, optional, tag = "18")]
    pub gen_ai_model_info: ::core::option::Option<processor_version::GenAiModelInfo>,
}
/// Nested message and enum types in `ProcessorVersion`.
pub mod processor_version {
    /// Information about the upcoming deprecation of this processor version.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct DeprecationInfo {
        /// The time at which this processor version will be deprecated.
        #[prost(message, optional, tag = "1")]
        pub deprecation_time: ::core::option::Option<::prost_types::Timestamp>,
        /// If set, the processor version that will be used as a replacement.
        #[prost(string, tag = "2")]
        pub replacement_processor_version: ::prost::alloc::string::String,
    }
    /// Information about Generative AI model-based processor versions.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct GenAiModelInfo {
        /// The processor version is either a pretrained Google-managed foundation
        /// model or a custom Generative AI model created by the user.
        #[prost(oneof = "gen_ai_model_info::ModelInfo", tags = "1, 2")]
        pub model_info: ::core::option::Option<gen_ai_model_info::ModelInfo>,
    }
    /// Nested message and enum types in `GenAiModelInfo`.
    pub mod gen_ai_model_info {
        /// Information for a pretrained Google-managed foundation model.
        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct FoundationGenAiModelInfo {
            /// Whether finetuning is allowed for this base processor version.
            #[prost(bool, tag = "1")]
            pub finetuning_allowed: bool,
            /// The minimum number of labeled documents in the training dataset
            /// required for finetuning.
            #[prost(int32, tag = "2")]
            pub min_train_labeled_documents: i32,
        }
        /// Information for a custom Generative AI model created by the user. These
        /// are created with `Create New Version` in either the `Call foundation  model` or `Fine tuning` tabs.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct CustomGenAiModelInfo {
            /// The type of custom model created by the user.
            #[prost(
                enumeration = "custom_gen_ai_model_info::CustomModelType",
                tag = "1"
            )]
            pub custom_model_type: i32,
            /// The base processor version ID for the custom model.
            #[prost(string, tag = "2")]
            pub base_processor_version_id: ::prost::alloc::string::String,
        }
        /// Nested message and enum types in `CustomGenAiModelInfo`.
        pub mod custom_gen_ai_model_info {
            /// The type of custom model created by the user.
            #[derive(
                Clone,
                Copy,
                Debug,
                PartialEq,
                Eq,
                Hash,
                PartialOrd,
                Ord,
                ::prost::Enumeration
            )]
            #[repr(i32)]
            pub enum CustomModelType {
                /// The model type is unspecified.
                Unspecified = 0,
                /// The model is a versioned foundation model.
                VersionedFoundation = 1,
                /// The model is a finetuned foundation model.
                FineTuned = 2,
            }
            impl CustomModelType {
                /// 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 => "CUSTOM_MODEL_TYPE_UNSPECIFIED",
                        Self::VersionedFoundation => "VERSIONED_FOUNDATION",
                        Self::FineTuned => "FINE_TUNED",
                    }
                }
                /// Creates an enum from field names used in the ProtoBuf definition.
                pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                    match value {
                        "CUSTOM_MODEL_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                        "VERSIONED_FOUNDATION" => Some(Self::VersionedFoundation),
                        "FINE_TUNED" => Some(Self::FineTuned),
                        _ => None,
                    }
                }
            }
        }
        /// The processor version is either a pretrained Google-managed foundation
        /// model or a custom Generative AI model created by the user.
        #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
        pub enum ModelInfo {
            /// Information for a pretrained Google-managed foundation model.
            #[prost(message, tag = "1")]
            FoundationGenAiModelInfo(FoundationGenAiModelInfo),
            /// Information for a custom Generative AI model created by the user.
            #[prost(message, tag = "2")]
            CustomGenAiModelInfo(CustomGenAiModelInfo),
        }
    }
    /// The possible states of the processor version.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// The processor version is in an unspecified state.
        Unspecified = 0,
        /// The processor version is deployed and can be used for processing.
        Deployed = 1,
        /// The processor version is being deployed.
        Deploying = 2,
        /// The processor version is not deployed and cannot be used for processing.
        Undeployed = 3,
        /// The processor version is being undeployed.
        Undeploying = 4,
        /// The processor version is being created.
        Creating = 5,
        /// The processor version is being deleted.
        Deleting = 6,
        /// The processor version failed and is in an indeterminate state.
        Failed = 7,
        /// The processor version is being imported.
        Importing = 8,
    }
    impl State {
        /// 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 => "STATE_UNSPECIFIED",
                Self::Deployed => "DEPLOYED",
                Self::Deploying => "DEPLOYING",
                Self::Undeployed => "UNDEPLOYED",
                Self::Undeploying => "UNDEPLOYING",
                Self::Creating => "CREATING",
                Self::Deleting => "DELETING",
                Self::Failed => "FAILED",
                Self::Importing => "IMPORTING",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "DEPLOYED" => Some(Self::Deployed),
                "DEPLOYING" => Some(Self::Deploying),
                "UNDEPLOYED" => Some(Self::Undeployed),
                "UNDEPLOYING" => Some(Self::Undeploying),
                "CREATING" => Some(Self::Creating),
                "DELETING" => Some(Self::Deleting),
                "FAILED" => Some(Self::Failed),
                "IMPORTING" => Some(Self::Importing),
                _ => None,
            }
        }
    }
    /// The possible model types of the processor version.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum ModelType {
        /// The processor version has unspecified model type.
        Unspecified = 0,
        /// The processor version has generative model type.
        Generative = 1,
        /// The processor version has custom model type.
        Custom = 2,
    }
    impl ModelType {
        /// 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 => "MODEL_TYPE_UNSPECIFIED",
                Self::Generative => "MODEL_TYPE_GENERATIVE",
                Self::Custom => "MODEL_TYPE_CUSTOM",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "MODEL_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
                "MODEL_TYPE_GENERATIVE" => Some(Self::Generative),
                "MODEL_TYPE_CUSTOM" => Some(Self::Custom),
                _ => None,
            }
        }
    }
}
/// Contains the alias and the aliased resource name of processor version.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ProcessorVersionAlias {
    /// The alias in the form of `processor_version` resource name.
    #[prost(string, tag = "1")]
    pub alias: ::prost::alloc::string::String,
    /// The resource name of aliased processor version.
    #[prost(string, tag = "2")]
    pub processor_version: ::prost::alloc::string::String,
}
/// The first-class citizen for Document AI. Each processor defines how to
/// extract structural information from a document.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Processor {
    /// Output only. Immutable. The resource name of the processor.
    /// Format: `projects/{project}/locations/{location}/processors/{processor}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`.
    /// To get a list of processor types, see
    /// \[FetchProcessorTypes\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes\].
    #[prost(string, tag = "2")]
    pub r#type: ::prost::alloc::string::String,
    /// The display name of the processor.
    #[prost(string, tag = "3")]
    pub display_name: ::prost::alloc::string::String,
    /// Output only. The state of the processor.
    #[prost(enumeration = "processor::State", tag = "4")]
    pub state: i32,
    /// The default processor version.
    #[prost(string, tag = "9")]
    pub default_processor_version: ::prost::alloc::string::String,
    /// Output only. The processor version aliases.
    #[prost(message, repeated, tag = "10")]
    pub processor_version_aliases: ::prost::alloc::vec::Vec<ProcessorVersionAlias>,
    /// Output only. Immutable. The http endpoint that can be called to invoke
    /// processing.
    #[prost(string, tag = "6")]
    pub process_endpoint: ::prost::alloc::string::String,
    /// The time the processor was created.
    #[prost(message, optional, tag = "7")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The [KMS key](<https://cloud.google.com/security-key-management>) used for
    /// encryption and decryption in CMEK scenarios.
    #[prost(string, tag = "8")]
    pub kms_key_name: ::prost::alloc::string::String,
    /// Output only. Reserved for future use.
    #[prost(bool, tag = "12")]
    pub satisfies_pzs: bool,
    /// Output only. Reserved for future use.
    #[prost(bool, tag = "13")]
    pub satisfies_pzi: bool,
}
/// Nested message and enum types in `Processor`.
pub mod processor {
    /// The possible states of the processor.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// The processor is in an unspecified state.
        Unspecified = 0,
        /// The processor is enabled, i.e., has an enabled version which can
        /// currently serve processing requests and all the feature dependencies have
        /// been successfully initialized.
        Enabled = 1,
        /// The processor is disabled.
        Disabled = 2,
        /// The processor is being enabled, will become `ENABLED` if successful.
        Enabling = 3,
        /// The processor is being disabled, will become `DISABLED` if successful.
        Disabling = 4,
        /// The processor is being created, will become either `ENABLED` (for
        /// successful creation) or `FAILED` (for failed ones).
        /// Once a processor is in this state, it can then be used for document
        /// processing, but the feature dependencies of the processor might not be
        /// fully created yet.
        Creating = 5,
        /// The processor failed during creation or initialization of feature
        /// dependencies. The user should delete the processor and recreate one as
        /// all the functionalities of the processor are disabled.
        Failed = 6,
        /// The processor is being deleted, will be removed if successful.
        Deleting = 7,
    }
    impl State {
        /// 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 => "STATE_UNSPECIFIED",
                Self::Enabled => "ENABLED",
                Self::Disabled => "DISABLED",
                Self::Enabling => "ENABLING",
                Self::Disabling => "DISABLING",
                Self::Creating => "CREATING",
                Self::Failed => "FAILED",
                Self::Deleting => "DELETING",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "ENABLED" => Some(Self::Enabled),
                "DISABLED" => Some(Self::Disabled),
                "ENABLING" => Some(Self::Enabling),
                "DISABLING" => Some(Self::Disabling),
                "CREATING" => Some(Self::Creating),
                "FAILED" => Some(Self::Failed),
                "DELETING" => Some(Self::Deleting),
                _ => None,
            }
        }
    }
}
/// A processor type is responsible for performing a certain document
/// understanding task on a certain type of document.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessorType {
    /// The resource name of the processor type.
    /// Format: `projects/{project}/processorTypes/{processor_type}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The processor type, such as: `OCR_PROCESSOR`, `INVOICE_PROCESSOR`.
    #[prost(string, tag = "2")]
    pub r#type: ::prost::alloc::string::String,
    /// The processor category, used by UI to group processor types.
    #[prost(string, tag = "3")]
    pub category: ::prost::alloc::string::String,
    /// The locations in which this processor is available.
    #[prost(message, repeated, tag = "4")]
    pub available_locations: ::prost::alloc::vec::Vec<processor_type::LocationInfo>,
    /// Whether the processor type allows creation. If true, users can create a
    /// processor of this processor type. Otherwise, users need to request access.
    #[prost(bool, tag = "6")]
    pub allow_creation: bool,
    /// Launch stage of the processor type
    #[prost(enumeration = "super::super::super::api::LaunchStage", tag = "8")]
    pub launch_stage: i32,
    /// A set of Cloud Storage URIs of sample documents for this processor.
    #[prost(string, repeated, tag = "9")]
    pub sample_document_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
/// Nested message and enum types in `ProcessorType`.
pub mod processor_type {
    /// The location information about where the processor is available.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct LocationInfo {
        /// The location ID. For supported locations, refer to [regional and
        /// multi-regional support](/document-ai/docs/regions).
        #[prost(string, tag = "1")]
        pub location_id: ::prost::alloc::string::String,
    }
}
/// Options for Process API
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessOptions {
    /// Only applicable to `OCR_PROCESSOR` and `FORM_PARSER_PROCESSOR`.
    /// Returns error if set on other processor types.
    #[prost(message, optional, tag = "1")]
    pub ocr_config: ::core::option::Option<OcrConfig>,
    /// Optional. Only applicable to `LAYOUT_PARSER_PROCESSOR`.
    /// Returns error if set on other processor types.
    #[prost(message, optional, tag = "9")]
    pub layout_config: ::core::option::Option<process_options::LayoutConfig>,
    /// Optional. Override the schema of the
    /// \[ProcessorVersion\]\[google.cloud.documentai.v1beta3.ProcessorVersion\]. Will
    /// return an Invalid Argument error if this field is set when the underlying
    /// \[ProcessorVersion\]\[google.cloud.documentai.v1beta3.ProcessorVersion\]
    /// doesn't support schema override.
    #[prost(message, optional, tag = "8")]
    pub schema_override: ::core::option::Option<DocumentSchema>,
    /// A subset of pages to process. If not specified, all pages are processed.
    /// If a page range is set, only the given pages are extracted and processed
    /// from the document. In the output document,
    /// \[Document.Page.page_number\]\[google.cloud.documentai.v1beta3.Document.Page.page_number\]
    /// refers to the page number in the original document.
    /// This configuration only applies to online processing with
    /// \[ProcessDocument\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument\].
    #[prost(oneof = "process_options::PageRange", tags = "5, 6, 7")]
    pub page_range: ::core::option::Option<process_options::PageRange>,
}
/// Nested message and enum types in `ProcessOptions`.
pub mod process_options {
    /// Serving config for layout parser processor.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct LayoutConfig {
        /// Optional. Config for chunking in layout parser processor.
        #[prost(message, optional, tag = "1")]
        pub chunking_config: ::core::option::Option<layout_config::ChunkingConfig>,
        /// Optional. Whether to include images in layout parser processor response.
        #[prost(bool, tag = "2")]
        pub return_images: bool,
        /// Optional. Whether to include bounding boxes in layout parser processor
        /// response.
        #[prost(bool, tag = "3")]
        pub return_bounding_boxes: bool,
        /// Optional. Whether to include image annotations in layout parser response.
        #[prost(bool, tag = "4")]
        pub enable_image_annotation: bool,
        /// Optional. Whether to extract images in layout parser response.
        #[prost(bool, tag = "7")]
        pub enable_image_extraction: bool,
        /// Optional. Whether to refine PDF layout using LLM.
        #[prost(bool, tag = "5")]
        pub enable_llm_layout_parsing: bool,
        /// Optional. Whether to include table annotations in layout parser response.
        #[prost(bool, tag = "6")]
        pub enable_table_annotation: bool,
    }
    /// Nested message and enum types in `LayoutConfig`.
    pub mod layout_config {
        /// Serving config for chunking.
        #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
        pub struct ChunkingConfig {
            /// Optional. The chunk sizes to use when splitting documents, in order of
            /// level.
            #[prost(int32, tag = "1")]
            pub chunk_size: i32,
            /// Optional. Whether or not to include ancestor headings when splitting.
            #[prost(bool, tag = "2")]
            pub include_ancestor_headings: bool,
            /// Optional. The number of tokens to group together when evaluating
            /// semantic similarity. THIS FIELD IS NOT YET USED.
            #[prost(bool, tag = "3")]
            pub semantic_chunking_group_size: bool,
            /// Optional. The percentile of cosine dissimilarity that must be exceeded
            /// between a group of tokens and the next. The smaller this number is, the
            /// more chunks will be generated. THIS FIELD IS NOT YET USED.
            #[prost(int32, tag = "4")]
            pub breakpoint_percentile_threshold: i32,
        }
    }
    /// A list of individual page numbers.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct IndividualPageSelector {
        /// Optional. Indices of the pages (starting from 1).
        #[prost(int32, repeated, packed = "false", tag = "1")]
        pub pages: ::prost::alloc::vec::Vec<i32>,
    }
    /// A subset of pages to process. If not specified, all pages are processed.
    /// If a page range is set, only the given pages are extracted and processed
    /// from the document. In the output document,
    /// \[Document.Page.page_number\]\[google.cloud.documentai.v1beta3.Document.Page.page_number\]
    /// refers to the page number in the original document.
    /// This configuration only applies to online processing with
    /// \[ProcessDocument\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument\].
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum PageRange {
        /// Which pages to process (1-indexed).
        #[prost(message, tag = "5")]
        IndividualPageSelector(IndividualPageSelector),
        /// Only process certain pages from the start. Process all if the document
        /// has fewer pages.
        #[prost(int32, tag = "6")]
        FromStart(i32),
        /// Only process certain pages from the end, same as above.
        #[prost(int32, tag = "7")]
        FromEnd(i32),
    }
}
/// Request message for the
/// \[ProcessDocument\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument\]
/// method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessRequest {
    /// Required. The resource name of the
    /// \[Processor\]\[google.cloud.documentai.v1beta3.Processor\] or
    /// \[ProcessorVersion\]\[google.cloud.documentai.v1beta3.ProcessorVersion\]
    /// to use for processing. If a
    /// \[Processor\]\[google.cloud.documentai.v1beta3.Processor\] is specified, the
    /// server will use its \[default
    /// version\]\[google.cloud.documentai.v1beta3.Processor.default_processor_version\].
    /// Format: `projects/{project}/locations/{location}/processors/{processor}`,
    /// or
    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The document payload, the
    /// \[content\]\[google.cloud.documentai.v1beta3.Document.content\] and
    /// \[mime_type\]\[google.cloud.documentai.v1beta3.Document.mime_type\] fields must
    /// be set.
    #[deprecated]
    #[prost(message, optional, tag = "2")]
    pub document: ::core::option::Option<Document>,
    /// Whether human review should be skipped for this request. Default to
    /// `false`.
    #[prost(bool, tag = "3")]
    pub skip_human_review: bool,
    /// Specifies which fields to include in the
    /// \[ProcessResponse.document\]\[google.cloud.documentai.v1beta3.ProcessResponse.document\]
    /// output. Only supports top-level document and pages field, so it must be in
    /// the form of `{document_field_name}` or `pages.{page_field_name}`.
    #[prost(message, optional, tag = "6")]
    pub field_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// Inference-time options for the process API
    #[prost(message, optional, tag = "7")]
    pub process_options: ::core::option::Option<ProcessOptions>,
    /// Optional. The labels with user-defined metadata for the request.
    ///
    /// Label keys and values can be no longer than 63 characters
    /// (Unicode codepoints) and can only contain lowercase letters, numeric
    /// characters, underscores, and dashes. International characters are allowed.
    /// Label values are optional. Label keys must start with a letter.
    #[prost(map = "string, string", tag = "10")]
    pub labels: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
    /// Optional. Option to remove images from the document.
    #[prost(bool, tag = "11")]
    pub imageless_mode: bool,
    /// The document payload.
    #[prost(oneof = "process_request::Source", tags = "4, 5, 8")]
    pub source: ::core::option::Option<process_request::Source>,
}
/// Nested message and enum types in `ProcessRequest`.
pub mod process_request {
    /// The document payload.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Source {
        /// An inline document proto.
        #[prost(message, tag = "4")]
        InlineDocument(super::Document),
        /// A raw document content (bytes).
        #[prost(message, tag = "5")]
        RawDocument(super::RawDocument),
        /// A raw document on Google Cloud Storage.
        #[prost(message, tag = "8")]
        GcsDocument(super::GcsDocument),
    }
}
/// The status of human review on a processed document.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct HumanReviewStatus {
    /// The state of human review on the processing request.
    #[prost(enumeration = "human_review_status::State", tag = "1")]
    pub state: i32,
    /// A message providing more details about the human review state.
    #[prost(string, tag = "2")]
    pub state_message: ::prost::alloc::string::String,
    /// The name of the operation triggered by the processed document. This field
    /// is populated only when the
    /// \[state\]\[google.cloud.documentai.v1beta3.HumanReviewStatus.state\] is
    /// `HUMAN_REVIEW_IN_PROGRESS`. It has the same response type and metadata as
    /// the long-running operation returned by
    /// \[ReviewDocument\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument\].
    #[prost(string, tag = "3")]
    pub human_review_operation: ::prost::alloc::string::String,
}
/// Nested message and enum types in `HumanReviewStatus`.
pub mod human_review_status {
    /// The final state of human review on a processed document.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// Human review state is unspecified. Most likely due to an internal error.
        Unspecified = 0,
        /// Human review is skipped for the document. This can happen because human
        /// review isn't enabled on the processor or the processing request has
        /// been set to skip this document.
        Skipped = 1,
        /// Human review validation is triggered and passed, so no review is needed.
        ValidationPassed = 2,
        /// Human review validation is triggered and the document is under review.
        InProgress = 3,
        /// Some error happened during triggering human review, see the
        /// \[state_message\]\[google.cloud.documentai.v1beta3.HumanReviewStatus.state_message\]
        /// for details.
        Error = 4,
    }
    impl State {
        /// 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 => "STATE_UNSPECIFIED",
                Self::Skipped => "SKIPPED",
                Self::ValidationPassed => "VALIDATION_PASSED",
                Self::InProgress => "IN_PROGRESS",
                Self::Error => "ERROR",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "SKIPPED" => Some(Self::Skipped),
                "VALIDATION_PASSED" => Some(Self::ValidationPassed),
                "IN_PROGRESS" => Some(Self::InProgress),
                "ERROR" => Some(Self::Error),
                _ => None,
            }
        }
    }
}
/// Response message for the
/// \[ProcessDocument\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument\]
/// method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProcessResponse {
    /// The document payload, will populate fields based on the processor's
    /// behavior.
    #[prost(message, optional, tag = "1")]
    pub document: ::core::option::Option<Document>,
    /// The name of the operation triggered by the processed document. If the human
    /// review process isn't triggered, this field is empty. It has the same
    /// response type and metadata as the long-running operation returned by
    /// \[ReviewDocument\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument\].
    #[deprecated]
    #[prost(string, tag = "2")]
    pub human_review_operation: ::prost::alloc::string::String,
    /// The status of human review on the processed document.
    #[prost(message, optional, tag = "3")]
    pub human_review_status: ::core::option::Option<HumanReviewStatus>,
}
/// Request message for
/// \[BatchProcessDocuments\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchProcessRequest {
    /// Required. The resource name of
    /// \[Processor\]\[google.cloud.documentai.v1beta3.Processor\] or
    /// \[ProcessorVersion\]\[google.cloud.documentai.v1beta3.ProcessorVersion\].
    /// Format: `projects/{project}/locations/{location}/processors/{processor}`,
    /// or
    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// The input config for each single document in the batch process.
    #[deprecated]
    #[prost(message, repeated, tag = "2")]
    pub input_configs: ::prost::alloc::vec::Vec<batch_process_request::BatchInputConfig>,
    /// The overall output config for batch process.
    #[deprecated]
    #[prost(message, optional, tag = "3")]
    pub output_config: ::core::option::Option<batch_process_request::BatchOutputConfig>,
    /// The input documents for the
    /// \[BatchProcessDocuments\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments\]
    /// method.
    #[prost(message, optional, tag = "5")]
    pub input_documents: ::core::option::Option<BatchDocumentsInputConfig>,
    /// The output configuration for the
    /// \[BatchProcessDocuments\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments\]
    /// method.
    #[prost(message, optional, tag = "6")]
    pub document_output_config: ::core::option::Option<DocumentOutputConfig>,
    /// Whether human review should be skipped for this request. Default to
    /// `false`.
    #[prost(bool, tag = "4")]
    pub skip_human_review: bool,
    /// Inference-time options for the process API
    #[prost(message, optional, tag = "7")]
    pub process_options: ::core::option::Option<ProcessOptions>,
    /// Optional. The labels with user-defined metadata for the request.
    ///
    /// Label keys and values can be no longer than 63 characters
    /// (Unicode codepoints) and can only contain lowercase letters, numeric
    /// characters, underscores, and dashes. International characters are allowed.
    /// Label values are optional. Label keys must start with a letter.
    #[prost(map = "string, string", tag = "9")]
    pub labels: ::std::collections::HashMap<
        ::prost::alloc::string::String,
        ::prost::alloc::string::String,
    >,
}
/// Nested message and enum types in `BatchProcessRequest`.
pub mod batch_process_request {
    /// The message for input config in batch process.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct BatchInputConfig {
        /// The Cloud Storage location as the source of the document.
        #[prost(string, tag = "1")]
        pub gcs_source: ::prost::alloc::string::String,
        /// An IANA published [media type (MIME
        /// type)](<https://www.iana.org/assignments/media-types/media-types.xhtml>) of
        /// the input. If the input is a raw document, refer to [supported file
        /// types](<https://cloud.google.com/document-ai/docs/file-types>) for the list
        /// of media types. If the input is a
        /// \[Document\]\[google.cloud.documentai.v1beta3.Document\], the type should be
        /// `application/json`.
        #[prost(string, tag = "2")]
        pub mime_type: ::prost::alloc::string::String,
    }
    /// The output configuration in the
    /// \[BatchProcessDocuments\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments\]
    /// method.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct BatchOutputConfig {
        /// The output Cloud Storage directory to put the processed documents.
        #[prost(string, tag = "1")]
        pub gcs_destination: ::prost::alloc::string::String,
    }
}
/// Response message for
/// \[BatchProcessDocuments\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments\].
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BatchProcessResponse {}
/// The long-running operation metadata for
/// \[BatchProcessDocuments\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments\].
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchProcessMetadata {
    /// The state of the current batch processing.
    #[prost(enumeration = "batch_process_metadata::State", tag = "1")]
    pub state: i32,
    /// A message providing more details about the current state of processing.
    /// For example, the error message if the operation is failed.
    #[prost(string, tag = "2")]
    pub state_message: ::prost::alloc::string::String,
    /// The creation time of the operation.
    #[prost(message, optional, tag = "3")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The last update time of the operation.
    #[prost(message, optional, tag = "4")]
    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The list of response details of each document.
    #[prost(message, repeated, tag = "5")]
    pub individual_process_statuses: ::prost::alloc::vec::Vec<
        batch_process_metadata::IndividualProcessStatus,
    >,
}
/// Nested message and enum types in `BatchProcessMetadata`.
pub mod batch_process_metadata {
    /// The status of a each individual document in the batch process.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct IndividualProcessStatus {
        /// The source of the document, same as the
        /// \[input_gcs_source\]\[google.cloud.documentai.v1beta3.BatchProcessMetadata.IndividualProcessStatus.input_gcs_source\]
        /// field in the request when the batch process started.
        #[prost(string, tag = "1")]
        pub input_gcs_source: ::prost::alloc::string::String,
        /// The status processing the document.
        #[prost(message, optional, tag = "2")]
        pub status: ::core::option::Option<super::super::super::super::rpc::Status>,
        /// The Cloud Storage output destination (in the request as
        /// \[DocumentOutputConfig.GcsOutputConfig.gcs_uri\]\[google.cloud.documentai.v1beta3.DocumentOutputConfig.GcsOutputConfig.gcs_uri\])
        /// of the processed document if it was successful, otherwise empty.
        #[prost(string, tag = "3")]
        pub output_gcs_destination: ::prost::alloc::string::String,
        /// The name of the operation triggered by the processed document. If the
        /// human review process isn't triggered, this field will be empty. It has
        /// the same response type and metadata as the long-running operation
        /// returned by the
        /// \[ReviewDocument\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument\]
        /// method.
        #[deprecated]
        #[prost(string, tag = "4")]
        pub human_review_operation: ::prost::alloc::string::String,
        /// The status of human review on the processed document.
        #[prost(message, optional, tag = "5")]
        pub human_review_status: ::core::option::Option<super::HumanReviewStatus>,
    }
    /// Possible states of the batch processing operation.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// The default value. This value is used if the state is omitted.
        Unspecified = 0,
        /// Request operation is waiting for scheduling.
        Waiting = 1,
        /// Request is being processed.
        Running = 2,
        /// The batch processing completed successfully.
        Succeeded = 3,
        /// The batch processing was being cancelled.
        Cancelling = 4,
        /// The batch processing was cancelled.
        Cancelled = 5,
        /// The batch processing has failed.
        Failed = 6,
    }
    impl State {
        /// 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 => "STATE_UNSPECIFIED",
                Self::Waiting => "WAITING",
                Self::Running => "RUNNING",
                Self::Succeeded => "SUCCEEDED",
                Self::Cancelling => "CANCELLING",
                Self::Cancelled => "CANCELLED",
                Self::Failed => "FAILED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "WAITING" => Some(Self::Waiting),
                "RUNNING" => Some(Self::Running),
                "SUCCEEDED" => Some(Self::Succeeded),
                "CANCELLING" => Some(Self::Cancelling),
                "CANCELLED" => Some(Self::Cancelled),
                "FAILED" => Some(Self::Failed),
                _ => None,
            }
        }
    }
}
/// Request message for the
/// \[FetchProcessorTypes\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes\]
/// method. Some processor types may require the project be added to an
/// allowlist.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct FetchProcessorTypesRequest {
    /// Required. The location of processor types to list.
    /// Format: `projects/{project}/locations/{location}`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
}
/// Response message for the
/// \[FetchProcessorTypes\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.FetchProcessorTypes\]
/// method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FetchProcessorTypesResponse {
    /// The list of processor types.
    #[prost(message, repeated, tag = "1")]
    pub processor_types: ::prost::alloc::vec::Vec<ProcessorType>,
}
/// Request message for the
/// \[ListProcessorTypes\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes\]
/// method. Some processor types may require the project be added to an
/// allowlist.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListProcessorTypesRequest {
    /// Required. The location of processor types to list.
    /// Format: `projects/{project}/locations/{location}`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// The maximum number of processor types to return.
    /// If unspecified, at most `100` processor types will be returned.
    /// The maximum value is `500`. Values above `500` will be coerced to `500`.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// Used to retrieve the next page of results, empty if at the end of the list.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Response message for the
/// \[ListProcessorTypes\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes\]
/// method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListProcessorTypesResponse {
    /// The processor types.
    #[prost(message, repeated, tag = "1")]
    pub processor_types: ::prost::alloc::vec::Vec<ProcessorType>,
    /// Points to the next page, otherwise empty.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for list all processors belongs to a project.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListProcessorsRequest {
    /// Required. The parent (project and location) which owns this collection of
    /// Processors. Format: `projects/{project}/locations/{location}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// The maximum number of processors to return.
    /// If unspecified, at most `50` processors will be returned.
    /// The maximum value is `100`. Values above `100` will be coerced to `100`.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// We will return the processors sorted by creation time. The page token
    /// will point to the next processor.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Response message for the
/// \[ListProcessors\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessors\]
/// method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListProcessorsResponse {
    /// The list of processors.
    #[prost(message, repeated, tag = "1")]
    pub processors: ::prost::alloc::vec::Vec<Processor>,
    /// Points to the next processor, otherwise empty.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for the
/// \[GetProcessorType\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorType\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetProcessorTypeRequest {
    /// Required. The processor type resource name.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for the
/// \[GetProcessor\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessor\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetProcessorRequest {
    /// Required. The processor resource name.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for the
/// \[GetProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.GetProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetProcessorVersionRequest {
    /// Required. The processor resource name.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Request message for list all processor versions belongs to a processor.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListProcessorVersionsRequest {
    /// Required. The parent (project, location and processor) to list all
    /// versions. Format:
    /// `projects/{project}/locations/{location}/processors/{processor}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// The maximum number of processor versions to return.
    /// If unspecified, at most `10` processor versions will be returned.
    /// The maximum value is `20`. Values above `20` will be coerced to `20`.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// We will return the processor versions sorted by creation time. The page
    /// token will point to the next processor version.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// Response message for the
/// \[ListProcessorVersions\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorVersions\]
/// method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListProcessorVersionsResponse {
    /// The list of processors.
    #[prost(message, repeated, tag = "1")]
    pub processor_versions: ::prost::alloc::vec::Vec<ProcessorVersion>,
    /// Points to the next processor, otherwise empty.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// Request message for the
/// \[DeleteProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteProcessorVersionRequest {
    /// Required. The processor version resource name to be deleted.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The long-running operation metadata for the
/// \[DeleteProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteProcessorVersionMetadata {
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "1")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
}
/// Request message for the
/// \[DeployProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeployProcessorVersionRequest {
    /// Required. The processor version resource name to be deployed.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Response message for the
/// \[DeployProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion\]
/// method.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeployProcessorVersionResponse {}
/// The long-running operation metadata for the
/// \[DeployProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.DeployProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeployProcessorVersionMetadata {
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "1")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
}
/// Request message for the
/// \[UndeployProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UndeployProcessorVersionRequest {
    /// Required. The processor version resource name to be undeployed.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Response message for the
/// \[UndeployProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion\]
/// method.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UndeployProcessorVersionResponse {}
/// The long-running operation metadata for the
/// \[UndeployProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.UndeployProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UndeployProcessorVersionMetadata {
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "1")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
}
/// Request message for the
/// \[CreateProcessor\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.CreateProcessor\]
/// method. Notice this request is sent to a regionalized backend service. If the
/// \[ProcessorType\]\[google.cloud.documentai.v1beta3.ProcessorType\] isn't
/// available in that region, the creation fails.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CreateProcessorRequest {
    /// Required. The parent (project and location) under which to create the
    /// processor. Format: `projects/{project}/locations/{location}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The processor to be created, requires
    /// \[Processor.type\]\[google.cloud.documentai.v1beta3.Processor.type\] and
    /// \[Processor.display_name\]\[google.cloud.documentai.v1beta3.Processor.display_name\]
    /// to be set. Also, the
    /// \[Processor.kms_key_name\]\[google.cloud.documentai.v1beta3.Processor.kms_key_name\]
    /// field must be set if the processor is under CMEK.
    #[prost(message, optional, tag = "2")]
    pub processor: ::core::option::Option<Processor>,
}
/// Request message for the
/// \[DeleteProcessor\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteProcessorRequest {
    /// Required. The processor resource name to be deleted.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// The long-running operation metadata for the
/// \[DeleteProcessor\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.DeleteProcessor\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DeleteProcessorMetadata {
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "5")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
}
/// Request message for the
/// \[EnableProcessor\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EnableProcessorRequest {
    /// Required. The processor resource name to be enabled.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Response message for the
/// \[EnableProcessor\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor\]
/// method. Intentionally empty proto for adding fields in future.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EnableProcessorResponse {}
/// The long-running operation metadata for the
/// \[EnableProcessor\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.EnableProcessor\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EnableProcessorMetadata {
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "5")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
}
/// Request message for the
/// \[DisableProcessor\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DisableProcessorRequest {
    /// Required. The processor resource name to be disabled.
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Response message for the
/// \[DisableProcessor\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor\]
/// method. Intentionally empty proto for adding fields in future.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DisableProcessorResponse {}
/// The long-running operation metadata for the
/// \[DisableProcessor\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.DisableProcessor\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DisableProcessorMetadata {
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "5")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
}
/// Request message for the
/// \[SetDefaultProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetDefaultProcessorVersionRequest {
    /// Required. The resource name of the
    /// \[Processor\]\[google.cloud.documentai.v1beta3.Processor\] to change default
    /// version.
    #[prost(string, tag = "1")]
    pub processor: ::prost::alloc::string::String,
    /// Required. The resource name of child
    /// \[ProcessorVersion\]\[google.cloud.documentai.v1beta3.ProcessorVersion\] to use
    /// as default. Format:
    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{version}`
    #[prost(string, tag = "2")]
    pub default_processor_version: ::prost::alloc::string::String,
}
/// Response message for the
/// \[SetDefaultProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion\]
/// method.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetDefaultProcessorVersionResponse {}
/// The long-running operation metadata for the
/// \[SetDefaultProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.SetDefaultProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct SetDefaultProcessorVersionMetadata {
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "1")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
}
/// Request message for the
/// \[TrainProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrainProcessorVersionRequest {
    /// Required. The parent (project, location and processor) to create the new
    /// version for. Format:
    /// `projects/{project}/locations/{location}/processors/{processor}`.
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// Required. The processor version to be created.
    #[prost(message, optional, tag = "2")]
    pub processor_version: ::core::option::Option<ProcessorVersion>,
    /// Optional. The schema the processor version will be trained with.
    #[prost(message, optional, tag = "10")]
    pub document_schema: ::core::option::Option<DocumentSchema>,
    /// Optional. The input data used to train the
    /// \[ProcessorVersion\]\[google.cloud.documentai.v1beta3.ProcessorVersion\].
    #[prost(message, optional, tag = "4")]
    pub input_data: ::core::option::Option<train_processor_version_request::InputData>,
    /// Optional. The processor version to use as a base for training. This
    /// processor version must be a child of `parent`. Format:
    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`.
    #[prost(string, tag = "8")]
    pub base_processor_version: ::prost::alloc::string::String,
    #[prost(oneof = "train_processor_version_request::ProcessorFlags", tags = "5, 12")]
    pub processor_flags: ::core::option::Option<
        train_processor_version_request::ProcessorFlags,
    >,
}
/// Nested message and enum types in `TrainProcessorVersionRequest`.
pub mod train_processor_version_request {
    /// The input data used to train a new
    /// \[ProcessorVersion\]\[google.cloud.documentai.v1beta3.ProcessorVersion\].
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct InputData {
        /// The documents used for training the new version.
        #[prost(message, optional, tag = "3")]
        pub training_documents: ::core::option::Option<super::BatchDocumentsInputConfig>,
        /// The documents used for testing the trained version.
        #[prost(message, optional, tag = "4")]
        pub test_documents: ::core::option::Option<super::BatchDocumentsInputConfig>,
    }
    /// Options to control the training of the Custom Document Extraction (CDE)
    /// Processor.
    #[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct CustomDocumentExtractionOptions {
        /// Training method to use for CDE training.
        #[prost(
            enumeration = "custom_document_extraction_options::TrainingMethod",
            tag = "3"
        )]
        pub training_method: i32,
    }
    /// Nested message and enum types in `CustomDocumentExtractionOptions`.
    pub mod custom_document_extraction_options {
        /// Training Method for CDE. `TRAINING_METHOD_UNSPECIFIED` will fall back to
        /// `MODEL_BASED`.
        #[derive(
            Clone,
            Copy,
            Debug,
            PartialEq,
            Eq,
            Hash,
            PartialOrd,
            Ord,
            ::prost::Enumeration
        )]
        #[repr(i32)]
        pub enum TrainingMethod {
            Unspecified = 0,
            ModelBased = 1,
            TemplateBased = 2,
        }
        impl TrainingMethod {
            /// 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 => "TRAINING_METHOD_UNSPECIFIED",
                    Self::ModelBased => "MODEL_BASED",
                    Self::TemplateBased => "TEMPLATE_BASED",
                }
            }
            /// Creates an enum from field names used in the ProtoBuf definition.
            pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
                match value {
                    "TRAINING_METHOD_UNSPECIFIED" => Some(Self::Unspecified),
                    "MODEL_BASED" => Some(Self::ModelBased),
                    "TEMPLATE_BASED" => Some(Self::TemplateBased),
                    _ => None,
                }
            }
        }
    }
    /// Options to control foundation model tuning of the processor.
    #[derive(Clone, Copy, PartialEq, ::prost::Message)]
    pub struct FoundationModelTuningOptions {
        /// Optional. The number of steps to run for model tuning. Valid values are
        /// between 1 and 400. If not provided, recommended steps will be used.
        #[prost(int32, tag = "2")]
        pub train_steps: i32,
        /// Optional. The multiplier to apply to the recommended learning rate. Valid
        /// values are between 0.1 and 10. If not provided, recommended learning rate
        /// will be used.
        #[prost(float, tag = "3")]
        pub learning_rate_multiplier: f32,
    }
    #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
    pub enum ProcessorFlags {
        /// Options to control Custom Document Extraction (CDE) Processor.
        #[prost(message, tag = "5")]
        CustomDocumentExtractionOptions(CustomDocumentExtractionOptions),
        /// Options to control foundation model tuning of a processor.
        #[prost(message, tag = "12")]
        FoundationModelTuningOptions(FoundationModelTuningOptions),
    }
}
/// The response for
/// \[TrainProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.TrainProcessorVersion\].
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct TrainProcessorVersionResponse {
    /// The resource name of the processor version produced by training.
    #[prost(string, tag = "1")]
    pub processor_version: ::prost::alloc::string::String,
}
/// The metadata that represents a processor version being created.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct TrainProcessorVersionMetadata {
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "1")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
    /// The training dataset validation information.
    #[prost(message, optional, tag = "2")]
    pub training_dataset_validation: ::core::option::Option<
        train_processor_version_metadata::DatasetValidation,
    >,
    /// The test dataset validation information.
    #[prost(message, optional, tag = "3")]
    pub test_dataset_validation: ::core::option::Option<
        train_processor_version_metadata::DatasetValidation,
    >,
}
/// Nested message and enum types in `TrainProcessorVersionMetadata`.
pub mod train_processor_version_metadata {
    /// The dataset validation information.
    /// This includes any and all errors with documents and the dataset.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct DatasetValidation {
        /// The total number of document errors.
        #[prost(int32, tag = "3")]
        pub document_error_count: i32,
        /// The total number of dataset errors.
        #[prost(int32, tag = "4")]
        pub dataset_error_count: i32,
        /// Error information pertaining to specific documents. A maximum of 10
        /// document errors will be returned.
        /// Any document with errors will not be used throughout training.
        #[prost(message, repeated, tag = "1")]
        pub document_errors: ::prost::alloc::vec::Vec<
            super::super::super::super::rpc::Status,
        >,
        /// Error information for the dataset as a whole. A maximum of 10 dataset
        /// errors will be returned.
        /// A single dataset error is terminal for training.
        #[prost(message, repeated, tag = "2")]
        pub dataset_errors: ::prost::alloc::vec::Vec<
            super::super::super::super::rpc::Status,
        >,
    }
}
/// Request message for the
/// \[ReviewDocument\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument\]
/// method.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ReviewDocumentRequest {
    /// Required. The resource name of the
    /// \[HumanReviewConfig\]\[google.cloud.documentai.v1beta3.HumanReviewConfig\] that
    /// the document will be reviewed with.
    #[prost(string, tag = "1")]
    pub human_review_config: ::prost::alloc::string::String,
    /// The document that needs human review.
    #[deprecated]
    #[prost(message, optional, tag = "2")]
    pub document: ::core::option::Option<Document>,
    /// Whether the validation should be performed on the ad-hoc review request.
    #[prost(bool, tag = "3")]
    pub enable_schema_validation: bool,
    /// The priority of the human review task.
    #[prost(enumeration = "review_document_request::Priority", tag = "5")]
    pub priority: i32,
    /// The document schema of the human review task.
    #[prost(message, optional, tag = "6")]
    pub document_schema: ::core::option::Option<DocumentSchema>,
    /// The document payload.
    #[prost(oneof = "review_document_request::Source", tags = "4")]
    pub source: ::core::option::Option<review_document_request::Source>,
}
/// Nested message and enum types in `ReviewDocumentRequest`.
pub mod review_document_request {
    /// The priority level of the human review task.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum Priority {
        /// The default priority level.
        Default = 0,
        /// The urgent priority level. The labeling manager should allocate labeler
        /// resource to the urgent task queue to respect this priority level.
        Urgent = 1,
    }
    impl Priority {
        /// 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 => "DEFAULT",
                Self::Urgent => "URGENT",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "DEFAULT" => Some(Self::Default),
                "URGENT" => Some(Self::Urgent),
                _ => None,
            }
        }
    }
    /// The document payload.
    #[derive(Clone, PartialEq, ::prost::Oneof)]
    pub enum Source {
        /// An inline document proto.
        #[prost(message, tag = "4")]
        InlineDocument(super::Document),
    }
}
/// Response message for the
/// \[ReviewDocument\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReviewDocumentResponse {
    /// The Cloud Storage uri for the human reviewed document if the review is
    /// succeeded.
    #[prost(string, tag = "1")]
    pub gcs_destination: ::prost::alloc::string::String,
    /// The state of the review operation.
    #[prost(enumeration = "review_document_response::State", tag = "2")]
    pub state: i32,
    /// The reason why the review is rejected by reviewer.
    #[prost(string, tag = "3")]
    pub rejection_reason: ::prost::alloc::string::String,
}
/// Nested message and enum types in `ReviewDocumentResponse`.
pub mod review_document_response {
    /// Possible states of the review operation.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// The default value. This value is used if the state is omitted.
        Unspecified = 0,
        /// The review operation is rejected by the reviewer.
        Rejected = 1,
        /// The review operation is succeeded.
        Succeeded = 2,
    }
    impl State {
        /// 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 => "STATE_UNSPECIFIED",
                Self::Rejected => "REJECTED",
                Self::Succeeded => "SUCCEEDED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "REJECTED" => Some(Self::Rejected),
                "SUCCEEDED" => Some(Self::Succeeded),
                _ => None,
            }
        }
    }
}
/// The long-running operation metadata for the
/// \[ReviewDocument\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ReviewDocument\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ReviewDocumentOperationMetadata {
    /// Used only when Operation.done is false.
    #[prost(enumeration = "review_document_operation_metadata::State", tag = "1")]
    pub state: i32,
    /// A message providing more details about the current state of processing.
    /// For example, the error message if the operation is failed.
    #[prost(string, tag = "2")]
    pub state_message: ::prost::alloc::string::String,
    /// The creation time of the operation.
    #[prost(message, optional, tag = "3")]
    pub create_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The last update time of the operation.
    #[prost(message, optional, tag = "4")]
    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "5")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
    /// The Crowd Compute question ID.
    #[prost(string, tag = "6")]
    pub question_id: ::prost::alloc::string::String,
}
/// Nested message and enum types in `ReviewDocumentOperationMetadata`.
pub mod review_document_operation_metadata {
    /// State of the long-running operation.
    #[derive(
        Clone,
        Copy,
        Debug,
        PartialEq,
        Eq,
        Hash,
        PartialOrd,
        Ord,
        ::prost::Enumeration
    )]
    #[repr(i32)]
    pub enum State {
        /// Unspecified state.
        Unspecified = 0,
        /// Operation is still running.
        Running = 1,
        /// Operation is being cancelled.
        Cancelling = 2,
        /// Operation succeeded.
        Succeeded = 3,
        /// Operation failed.
        Failed = 4,
        /// Operation is cancelled.
        Cancelled = 5,
    }
    impl State {
        /// 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 => "STATE_UNSPECIFIED",
                Self::Running => "RUNNING",
                Self::Cancelling => "CANCELLING",
                Self::Succeeded => "SUCCEEDED",
                Self::Failed => "FAILED",
                Self::Cancelled => "CANCELLED",
            }
        }
        /// Creates an enum from field names used in the ProtoBuf definition.
        pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
            match value {
                "STATE_UNSPECIFIED" => Some(Self::Unspecified),
                "RUNNING" => Some(Self::Running),
                "CANCELLING" => Some(Self::Cancelling),
                "SUCCEEDED" => Some(Self::Succeeded),
                "FAILED" => Some(Self::Failed),
                "CANCELLED" => Some(Self::Cancelled),
                _ => None,
            }
        }
    }
}
/// Evaluates the given
/// \[ProcessorVersion\]\[google.cloud.documentai.v1beta3.ProcessorVersion\] against
/// the supplied documents.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EvaluateProcessorVersionRequest {
    /// Required. The resource name of the
    /// \[ProcessorVersion\]\[google.cloud.documentai.v1beta3.ProcessorVersion\] to
    /// evaluate.
    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    #[prost(string, tag = "1")]
    pub processor_version: ::prost::alloc::string::String,
    /// Optional. The documents used in the evaluation. If unspecified, use the
    /// processor's dataset as evaluation input.
    #[prost(message, optional, tag = "3")]
    pub evaluation_documents: ::core::option::Option<BatchDocumentsInputConfig>,
}
/// Metadata of the
/// \[EvaluateProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EvaluateProcessorVersionMetadata {
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "1")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
}
/// Response of the
/// \[EvaluateProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.EvaluateProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct EvaluateProcessorVersionResponse {
    /// The resource name of the created evaluation.
    #[prost(string, tag = "2")]
    pub evaluation: ::prost::alloc::string::String,
}
/// Retrieves a specific Evaluation.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetEvaluationRequest {
    /// Required. The resource name of the
    /// \[Evaluation\]\[google.cloud.documentai.v1beta3.Evaluation\] to get.
    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}/evaluations/{evaluation}`
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
}
/// Retrieves a list of evaluations for a given
/// \[ProcessorVersion\]\[google.cloud.documentai.v1beta3.ProcessorVersion\].
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListEvaluationsRequest {
    /// Required. The resource name of the
    /// \[ProcessorVersion\]\[google.cloud.documentai.v1beta3.ProcessorVersion\] to
    /// list evaluations for.
    /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    /// The standard list page size.
    /// If unspecified, at most `5` evaluations are returned.
    /// The maximum value is `100`. Values above `100` are coerced to `100`.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// A page token, received from a previous `ListEvaluations` call.
    /// Provide this to retrieve the subsequent page.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
}
/// The response from `ListEvaluations`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListEvaluationsResponse {
    /// The evaluations requested.
    #[prost(message, repeated, tag = "1")]
    pub evaluations: ::prost::alloc::vec::Vec<Evaluation>,
    /// A token, which can be sent as `page_token` to retrieve the next page.
    /// If this field is omitted, there are no subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
}
/// The request message for the
/// \[ImportProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion\]
/// method.
///
/// The Document AI [Service
/// Agent](<https://cloud.google.com/iam/docs/service-agents>) of the destination
/// project must have [Document AI Editor
/// role](<https://cloud.google.com/document-ai/docs/access-control/iam-roles>) on
/// the source project.
///
/// The destination project is specified as part of the
/// \[parent\]\[google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.parent\]
/// field. The source project is specified as part of the
/// \[source\]\[google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.processor_version_source\]
/// or
/// \[external_processor_version_source\]\[google.cloud.documentai.v1beta3.ImportProcessorVersionRequest.external_processor_version_source\]
/// field.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ImportProcessorVersionRequest {
    /// Required. The destination processor name to create the processor version
    /// in. Format:
    /// `projects/{project}/locations/{location}/processors/{processor}`
    #[prost(string, tag = "1")]
    pub parent: ::prost::alloc::string::String,
    #[prost(oneof = "import_processor_version_request::Source", tags = "2, 3")]
    pub source: ::core::option::Option<import_processor_version_request::Source>,
}
/// Nested message and enum types in `ImportProcessorVersionRequest`.
pub mod import_processor_version_request {
    /// The external source processor version.
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
    pub struct ExternalProcessorVersionSource {
        /// Required. The processor version name. Format:
        /// `projects/{project}/locations/{location}/processors/{processor}/processorVersions/{processorVersion}`
        #[prost(string, tag = "1")]
        pub processor_version: ::prost::alloc::string::String,
        /// Optional. The Document AI service endpoint. For example,
        /// '<https://us-documentai.googleapis.com'>
        #[prost(string, tag = "2")]
        pub service_endpoint: ::prost::alloc::string::String,
    }
    #[derive(Clone, PartialEq, Eq, Hash, ::prost::Oneof)]
    pub enum Source {
        /// The source processor version to import from. The source processor version
        /// and destination processor need to be in the same environment and region.
        /// Note that ProcessorVersions with `model_type` `MODEL_TYPE_LLM` are not
        /// supported.
        #[prost(string, tag = "2")]
        ProcessorVersionSource(::prost::alloc::string::String),
        /// The source processor version to import from. It can be from a different
        /// environment and region than the destination processor.
        #[prost(message, tag = "3")]
        ExternalProcessorVersionSource(ExternalProcessorVersionSource),
    }
}
/// The response message for the
/// \[ImportProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ImportProcessorVersionResponse {
    /// The destination processor version name.
    #[prost(string, tag = "1")]
    pub processor_version: ::prost::alloc::string::String,
}
/// The long-running operation metadata for the
/// \[ImportProcessorVersion\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ImportProcessorVersion\]
/// method.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ImportProcessorVersionMetadata {
    /// The basic metadata for the long-running operation.
    #[prost(message, optional, tag = "1")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
}
/// Generated client implementations.
pub mod document_processor_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service to call Document AI to process documents according to the
    /// processor's definition. Processors are built using state-of-the-art Google
    /// AI such as natural language, computer vision, and translation to extract
    /// structured information from unstructured or semi-structured documents.
    #[derive(Debug, Clone)]
    pub struct DocumentProcessorServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl DocumentProcessorServiceClient<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> DocumentProcessorServiceClient<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,
        ) -> DocumentProcessorServiceClient<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,
        {
            DocumentProcessorServiceClient::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
        }
        /// Processes a single document.
        pub async fn process_document(
            &mut self,
            request: impl tonic::IntoRequest<super::ProcessRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ProcessResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/ProcessDocument",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "ProcessDocument",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// LRO endpoint to batch process many documents. The output is written
        /// to Cloud Storage as JSON in the \[Document\] format.
        pub async fn batch_process_documents(
            &mut self,
            request: impl tonic::IntoRequest<super::BatchProcessRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/BatchProcessDocuments",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "BatchProcessDocuments",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Fetches processor types. Note that we don't use
        /// \[ListProcessorTypes\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ListProcessorTypes\]
        /// here, because it isn't paginated.
        pub async fn fetch_processor_types(
            &mut self,
            request: impl tonic::IntoRequest<super::FetchProcessorTypesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::FetchProcessorTypesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/FetchProcessorTypes",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "FetchProcessorTypes",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists the processor types that exist.
        pub async fn list_processor_types(
            &mut self,
            request: impl tonic::IntoRequest<super::ListProcessorTypesRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListProcessorTypesResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessorTypes",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "ListProcessorTypes",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets a processor type detail.
        pub async fn get_processor_type(
            &mut self,
            request: impl tonic::IntoRequest<super::GetProcessorTypeRequest>,
        ) -> std::result::Result<tonic::Response<super::ProcessorType>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessorType",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "GetProcessorType",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists all processors which belong to this project.
        pub async fn list_processors(
            &mut self,
            request: impl tonic::IntoRequest<super::ListProcessorsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListProcessorsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessors",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "ListProcessors",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets a processor detail.
        pub async fn get_processor(
            &mut self,
            request: impl tonic::IntoRequest<super::GetProcessorRequest>,
        ) -> std::result::Result<tonic::Response<super::Processor>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessor",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "GetProcessor",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Trains a new processor version.
        /// Operation metadata is returned as
        /// \[TrainProcessorVersionMetadata\]\[google.cloud.documentai.v1beta3.TrainProcessorVersionMetadata\].
        pub async fn train_processor_version(
            &mut self,
            request: impl tonic::IntoRequest<super::TrainProcessorVersionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/TrainProcessorVersion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "TrainProcessorVersion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets a processor version detail.
        pub async fn get_processor_version(
            &mut self,
            request: impl tonic::IntoRequest<super::GetProcessorVersionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ProcessorVersion>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/GetProcessorVersion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "GetProcessorVersion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Lists all versions of a processor.
        pub async fn list_processor_versions(
            &mut self,
            request: impl tonic::IntoRequest<super::ListProcessorVersionsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListProcessorVersionsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/ListProcessorVersions",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "ListProcessorVersions",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes the processor version, all artifacts under the processor version
        /// will be deleted.
        pub async fn delete_processor_version(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteProcessorVersionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/DeleteProcessorVersion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "DeleteProcessorVersion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deploys the processor version.
        pub async fn deploy_processor_version(
            &mut self,
            request: impl tonic::IntoRequest<super::DeployProcessorVersionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/DeployProcessorVersion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "DeployProcessorVersion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Undeploys the processor version.
        pub async fn undeploy_processor_version(
            &mut self,
            request: impl tonic::IntoRequest<super::UndeployProcessorVersionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/UndeployProcessorVersion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "UndeployProcessorVersion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Creates a processor from the
        /// \[ProcessorType\]\[google.cloud.documentai.v1beta3.ProcessorType\] provided.
        /// The processor will be at `ENABLED` state by default after its creation.
        /// Note that this method requires the `documentai.processors.create`
        /// permission on the project, which is highly privileged. A user or service
        /// account with this permission can create new processors that can interact
        /// with any gcs bucket in your project.
        pub async fn create_processor(
            &mut self,
            request: impl tonic::IntoRequest<super::CreateProcessorRequest>,
        ) -> std::result::Result<tonic::Response<super::Processor>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/CreateProcessor",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "CreateProcessor",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes the processor, unloads all deployed model artifacts if it was
        /// enabled and then deletes all artifacts associated with this processor.
        pub async fn delete_processor(
            &mut self,
            request: impl tonic::IntoRequest<super::DeleteProcessorRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/DeleteProcessor",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "DeleteProcessor",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Enables a processor
        pub async fn enable_processor(
            &mut self,
            request: impl tonic::IntoRequest<super::EnableProcessorRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/EnableProcessor",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "EnableProcessor",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Disables a processor
        pub async fn disable_processor(
            &mut self,
            request: impl tonic::IntoRequest<super::DisableProcessorRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/DisableProcessor",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "DisableProcessor",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Set the default (active) version of a
        /// \[Processor\]\[google.cloud.documentai.v1beta3.Processor\] that will be used in
        /// \[ProcessDocument\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.ProcessDocument\]
        /// and
        /// \[BatchProcessDocuments\]\[google.cloud.documentai.v1beta3.DocumentProcessorService.BatchProcessDocuments\].
        pub async fn set_default_processor_version(
            &mut self,
            request: impl tonic::IntoRequest<super::SetDefaultProcessorVersionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/SetDefaultProcessorVersion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "SetDefaultProcessorVersion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Send a document for Human Review. The input document should be processed by
        /// the specified processor.
        pub async fn review_document(
            &mut self,
            request: impl tonic::IntoRequest<super::ReviewDocumentRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/ReviewDocument",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "ReviewDocument",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Evaluates a ProcessorVersion against annotated documents, producing an
        /// Evaluation.
        pub async fn evaluate_processor_version(
            &mut self,
            request: impl tonic::IntoRequest<super::EvaluateProcessorVersionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/EvaluateProcessorVersion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "EvaluateProcessorVersion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Retrieves a specific evaluation.
        pub async fn get_evaluation(
            &mut self,
            request: impl tonic::IntoRequest<super::GetEvaluationRequest>,
        ) -> std::result::Result<tonic::Response<super::Evaluation>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/GetEvaluation",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "GetEvaluation",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Retrieves a set of evaluations for a given processor version.
        pub async fn list_evaluations(
            &mut self,
            request: impl tonic::IntoRequest<super::ListEvaluationsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListEvaluationsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/ListEvaluations",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "ListEvaluations",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Imports a processor version from source processor version.
        pub async fn import_processor_version(
            &mut self,
            request: impl tonic::IntoRequest<super::ImportProcessorVersionRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentProcessorService/ImportProcessorVersion",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentProcessorService",
                        "ImportProcessorVersion",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateDatasetRequest {
    /// Required. The `name` field of the `Dataset` is used to identify the
    /// resource to be updated.
    #[prost(message, optional, tag = "1")]
    pub dataset: ::core::option::Option<Dataset>,
    /// The update mask applies to the resource.
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct UpdateDatasetOperationMetadata {
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "1")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImportDocumentsRequest {
    /// Required. The dataset resource name.
    /// Format:
    /// projects/{project}/locations/{location}/processors/{processor}/dataset
    #[prost(string, tag = "1")]
    pub dataset: ::prost::alloc::string::String,
    /// Required. The Cloud Storage uri containing raw documents that must be
    /// imported.
    #[prost(message, repeated, tag = "4")]
    pub batch_documents_import_configs: ::prost::alloc::vec::Vec<
        import_documents_request::BatchDocumentsImportConfig,
    >,
}
/// Nested message and enum types in `ImportDocumentsRequest`.
pub mod import_documents_request {
    /// Config for importing documents.
    /// Each batch can have its own dataset split type.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct BatchDocumentsImportConfig {
        /// The common config to specify a set of documents used as input.
        #[prost(message, optional, tag = "1")]
        pub batch_input_config: ::core::option::Option<super::BatchDocumentsInputConfig>,
        #[prost(oneof = "batch_documents_import_config::SplitTypeConfig", tags = "2, 3")]
        pub split_type_config: ::core::option::Option<
            batch_documents_import_config::SplitTypeConfig,
        >,
    }
    /// Nested message and enum types in `BatchDocumentsImportConfig`.
    pub mod batch_documents_import_config {
        /// The config for auto-split.
        #[derive(Clone, Copy, PartialEq, ::prost::Message)]
        pub struct AutoSplitConfig {
            /// Ratio of training dataset split.
            #[prost(float, tag = "1")]
            pub training_split_ratio: f32,
        }
        #[derive(Clone, Copy, PartialEq, ::prost::Oneof)]
        pub enum SplitTypeConfig {
            /// Target dataset split where the documents must be stored.
            #[prost(enumeration = "super::super::DatasetSplitType", tag = "2")]
            DatasetSplit(i32),
            /// If set, documents will be automatically split into training and test
            /// split category with the specified ratio.
            #[prost(message, tag = "3")]
            AutoSplitConfig(AutoSplitConfig),
        }
    }
}
/// Response of the import document operation.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ImportDocumentsResponse {}
/// Metadata of the import document operation.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ImportDocumentsMetadata {
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "1")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
    /// The list of response details of each document.
    #[prost(message, repeated, tag = "2")]
    pub individual_import_statuses: ::prost::alloc::vec::Vec<
        import_documents_metadata::IndividualImportStatus,
    >,
    /// Validation statuses of the batch documents import config.
    #[prost(message, repeated, tag = "4")]
    pub import_config_validation_results: ::prost::alloc::vec::Vec<
        import_documents_metadata::ImportConfigValidationResult,
    >,
    /// Total number of the documents that are qualified for importing.
    #[prost(int32, tag = "3")]
    pub total_document_count: i32,
}
/// Nested message and enum types in `ImportDocumentsMetadata`.
pub mod import_documents_metadata {
    /// The status of each individual document in the import process.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct IndividualImportStatus {
        /// The source Cloud Storage URI of the document.
        #[prost(string, tag = "1")]
        pub input_gcs_source: ::prost::alloc::string::String,
        /// The status of the importing of the document.
        #[prost(message, optional, tag = "2")]
        pub status: ::core::option::Option<super::super::super::super::rpc::Status>,
        /// The document id of imported document if it was successful, otherwise
        /// empty.
        #[prost(message, optional, tag = "4")]
        pub output_document_id: ::core::option::Option<super::DocumentId>,
    }
    /// The validation status of each import config. Status is set to an error if
    /// there are no documents to import in the `import_config`, or `OK` if the
    /// operation will try to proceed with at least one document.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct ImportConfigValidationResult {
        /// The source Cloud Storage URI specified in the import config.
        #[prost(string, tag = "1")]
        pub input_gcs_source: ::prost::alloc::string::String,
        /// The validation status of import config.
        #[prost(message, optional, tag = "2")]
        pub status: ::core::option::Option<super::super::super::super::rpc::Status>,
    }
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetDocumentRequest {
    /// Required. The resource name of the dataset that the document belongs to .
    /// Format:
    /// projects/{project}/locations/{location}/processors/{processor}/dataset
    #[prost(string, tag = "1")]
    pub dataset: ::prost::alloc::string::String,
    /// Required. Document identifier.
    #[prost(message, optional, tag = "2")]
    pub document_id: ::core::option::Option<DocumentId>,
    /// If set, only fields listed here will be returned. Otherwise, all fields
    /// will be returned by default.
    #[prost(message, optional, tag = "3")]
    pub read_mask: ::core::option::Option<::prost_types::FieldMask>,
    /// List of pages for which the fields specified in the `read_mask` must
    /// be served.
    #[prost(message, optional, tag = "4")]
    pub page_range: ::core::option::Option<DocumentPageRange>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetDocumentResponse {
    #[prost(message, optional, tag = "1")]
    pub document: ::core::option::Option<Document>,
}
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct ListDocumentsRequest {
    /// Required. The resource name of the dataset to be listed.
    /// Format:
    /// projects/{project}/locations/{location}/processors/{processor}/dataset
    #[prost(string, tag = "1")]
    pub dataset: ::prost::alloc::string::String,
    /// The maximum number of documents to return. The service may return
    /// fewer than this value.
    /// If unspecified, at most 20 documents will be returned.
    /// The maximum value is 100; values above 100 will be coerced to 100.
    #[prost(int32, tag = "2")]
    pub page_size: i32,
    /// A page token, received from a previous `ListDocuments` call.
    /// Provide this to retrieve the subsequent page.
    ///
    /// When paginating, all other parameters provided to `ListDocuments`
    /// must match the call that provided the page token.
    #[prost(string, tag = "3")]
    pub page_token: ::prost::alloc::string::String,
    /// Optional. Query to filter the documents based on
    /// <https://google.aip.dev/160.>
    ///
    /// ## Currently support query strings are:
    ///
    /// `SplitType=DATASET_SPLIT_TEST|DATASET_SPLIT_TRAIN|DATASET_SPLIT_UNASSIGNED`
    ///
    /// * `LabelingState=DOCUMENT_LABELED|DOCUMENT_UNLABELED|DOCUMENT_AUTO_LABELED`
    /// * `DisplayName=\"file_name.pdf\"`
    /// * `EntityType=abc/def`
    /// * `TagName=\"auto-labeling-running\"|\"sampled\"`
    ///
    /// Note:
    ///
    /// * Only `AND`, `=` and `!=` are supported.
    ///   e.g. `DisplayName=file_name AND EntityType!=abc` IS supported.
    /// * Wildcard `*` is supported only in `DisplayName` filter
    /// * No duplicate filter keys are allowed,
    ///   e.g. `EntityType=a AND EntityType=b` is NOT supported.
    /// * String match is case sensitive (for filter `DisplayName` & `EntityType`).
    #[prost(string, tag = "4")]
    pub filter: ::prost::alloc::string::String,
    /// Optional. Controls if the request requires a total size of matched
    /// documents. See
    /// \[ListDocumentsResponse.total_size\]\[google.cloud.documentai.v1beta3.ListDocumentsResponse.total_size\].
    ///
    /// Enabling this flag may adversely impact performance.
    ///
    /// Defaults to false.
    #[prost(bool, tag = "6")]
    pub return_total_size: bool,
    /// Optional. Number of results to skip beginning from the `page_token` if
    /// provided. <https://google.aip.dev/158#skipping-results.> It must be a
    /// non-negative integer. Negative values will be rejected. Note that this is
    /// not the number of pages to skip. If this value causes the cursor to move
    /// past the end of results,
    /// \[ListDocumentsResponse.document_metadata\]\[google.cloud.documentai.v1beta3.ListDocumentsResponse.document_metadata\]
    /// and
    /// \[ListDocumentsResponse.next_page_token\]\[google.cloud.documentai.v1beta3.ListDocumentsResponse.next_page_token\]
    /// will be empty.
    #[prost(int32, tag = "8")]
    pub skip: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ListDocumentsResponse {
    /// Document metadata corresponding to the listed documents.
    #[prost(message, repeated, tag = "1")]
    pub document_metadata: ::prost::alloc::vec::Vec<DocumentMetadata>,
    /// A token, which can be sent as
    /// \[ListDocumentsRequest.page_token\]\[google.cloud.documentai.v1beta3.ListDocumentsRequest.page_token\]
    /// to retrieve the next page. If this field is omitted, there are no
    /// subsequent pages.
    #[prost(string, tag = "2")]
    pub next_page_token: ::prost::alloc::string::String,
    /// Total count of documents queried.
    #[prost(int32, tag = "3")]
    pub total_size: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchDeleteDocumentsRequest {
    /// Required. The dataset resource name.
    /// Format:
    /// projects/{project}/locations/{location}/processors/{processor}/dataset
    #[prost(string, tag = "1")]
    pub dataset: ::prost::alloc::string::String,
    /// Required. Dataset documents input. If given `filter`, all documents
    /// satisfying the filter will be deleted. If given documentIds, a maximum of
    /// 50 documents can be deleted in a batch. The request will be rejected if
    /// more than 50 document_ids are provided.
    #[prost(message, optional, tag = "3")]
    pub dataset_documents: ::core::option::Option<BatchDatasetDocuments>,
}
/// Response of the delete documents operation.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct BatchDeleteDocumentsResponse {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct BatchDeleteDocumentsMetadata {
    /// The basic metadata of the long-running operation.
    #[prost(message, optional, tag = "1")]
    pub common_metadata: ::core::option::Option<CommonOperationMetadata>,
    /// The list of response details of each document.
    #[prost(message, repeated, tag = "2")]
    pub individual_batch_delete_statuses: ::prost::alloc::vec::Vec<
        batch_delete_documents_metadata::IndividualBatchDeleteStatus,
    >,
    /// Total number of documents deleting from dataset.
    #[prost(int32, tag = "3")]
    pub total_document_count: i32,
    /// Total number of documents that failed to be deleted in storage.
    #[prost(int32, tag = "4")]
    pub error_document_count: i32,
}
/// Nested message and enum types in `BatchDeleteDocumentsMetadata`.
pub mod batch_delete_documents_metadata {
    /// The status of each individual document in the batch delete process.
    #[derive(Clone, PartialEq, ::prost::Message)]
    pub struct IndividualBatchDeleteStatus {
        /// The document id of the document.
        #[prost(message, optional, tag = "1")]
        pub document_id: ::core::option::Option<super::DocumentId>,
        /// The status of deleting the document in storage.
        #[prost(message, optional, tag = "2")]
        pub status: ::core::option::Option<super::super::super::super::rpc::Status>,
    }
}
/// Request for `GetDatasetSchema`.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct GetDatasetSchemaRequest {
    /// Required. The dataset schema resource name.
    /// Format:
    /// projects/{project}/locations/{location}/processors/{processor}/dataset/datasetSchema
    #[prost(string, tag = "1")]
    pub name: ::prost::alloc::string::String,
    /// If set, only returns the visible fields of the schema.
    #[prost(bool, tag = "2")]
    pub visible_fields_only: bool,
}
/// Request for `UpdateDatasetSchema`.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateDatasetSchemaRequest {
    /// Required. The name field of the `DatasetSchema` is used to identify the
    /// resource to be updated.
    #[prost(message, optional, tag = "1")]
    pub dataset_schema: ::core::option::Option<DatasetSchema>,
    /// The update mask applies to the resource.
    #[prost(message, optional, tag = "2")]
    pub update_mask: ::core::option::Option<::prost_types::FieldMask>,
}
/// Range of pages present in a document.
#[derive(Clone, Copy, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DocumentPageRange {
    /// First page number (one-based index) to be returned.
    #[prost(int32, tag = "1")]
    pub start: i32,
    /// Last page number (one-based index) to be returned.
    #[prost(int32, tag = "2")]
    pub end: i32,
}
/// Metadata about a document.
#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
pub struct DocumentMetadata {
    /// Document identifier.
    #[prost(message, optional, tag = "1")]
    pub document_id: ::core::option::Option<DocumentId>,
    /// Number of pages in the document.
    #[prost(int32, tag = "2")]
    pub page_count: i32,
    /// Type of the dataset split to which the document belongs.
    #[prost(enumeration = "DatasetSplitType", tag = "3")]
    pub dataset_type: i32,
    /// Labeling state of the document.
    #[prost(enumeration = "DocumentLabelingState", tag = "5")]
    pub labeling_state: i32,
    /// The display name of the document.
    #[prost(string, tag = "6")]
    pub display_name: ::prost::alloc::string::String,
}
/// Documents belonging to a dataset will be split into different groups
/// referred to as splits: train, test.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DatasetSplitType {
    /// Default value if the enum is not set.
    Unspecified = 0,
    /// Identifies the train documents.
    DatasetSplitTrain = 1,
    /// Identifies the test documents.
    DatasetSplitTest = 2,
    /// Identifies the unassigned documents.
    DatasetSplitUnassigned = 3,
}
impl DatasetSplitType {
    /// 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 => "DATASET_SPLIT_TYPE_UNSPECIFIED",
            Self::DatasetSplitTrain => "DATASET_SPLIT_TRAIN",
            Self::DatasetSplitTest => "DATASET_SPLIT_TEST",
            Self::DatasetSplitUnassigned => "DATASET_SPLIT_UNASSIGNED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "DATASET_SPLIT_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
            "DATASET_SPLIT_TRAIN" => Some(Self::DatasetSplitTrain),
            "DATASET_SPLIT_TEST" => Some(Self::DatasetSplitTest),
            "DATASET_SPLIT_UNASSIGNED" => Some(Self::DatasetSplitUnassigned),
            _ => None,
        }
    }
}
/// Describes the labeling status of a document.
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum DocumentLabelingState {
    /// Default value if the enum is not set.
    Unspecified = 0,
    /// Document has been labeled.
    DocumentLabeled = 1,
    /// Document has not been labeled.
    DocumentUnlabeled = 2,
    /// Document has been auto-labeled.
    DocumentAutoLabeled = 3,
}
impl DocumentLabelingState {
    /// 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 => "DOCUMENT_LABELING_STATE_UNSPECIFIED",
            Self::DocumentLabeled => "DOCUMENT_LABELED",
            Self::DocumentUnlabeled => "DOCUMENT_UNLABELED",
            Self::DocumentAutoLabeled => "DOCUMENT_AUTO_LABELED",
        }
    }
    /// Creates an enum from field names used in the ProtoBuf definition.
    pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
        match value {
            "DOCUMENT_LABELING_STATE_UNSPECIFIED" => Some(Self::Unspecified),
            "DOCUMENT_LABELED" => Some(Self::DocumentLabeled),
            "DOCUMENT_UNLABELED" => Some(Self::DocumentUnlabeled),
            "DOCUMENT_AUTO_LABELED" => Some(Self::DocumentAutoLabeled),
            _ => None,
        }
    }
}
/// Generated client implementations.
pub mod document_service_client {
    #![allow(
        unused_variables,
        dead_code,
        missing_docs,
        clippy::wildcard_imports,
        clippy::let_unit_value,
    )]
    use tonic::codegen::*;
    use tonic::codegen::http::Uri;
    /// Service to call Cloud DocumentAI to manage document collection (dataset).
    #[derive(Debug, Clone)]
    pub struct DocumentServiceClient<T> {
        inner: tonic::client::Grpc<T>,
    }
    impl DocumentServiceClient<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> DocumentServiceClient<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,
        ) -> DocumentServiceClient<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,
        {
            DocumentServiceClient::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
        }
        /// Updates metadata associated with a dataset.
        /// Note that this method requires the
        /// `documentai.googleapis.com/datasets.update` permission on the project,
        /// which is highly privileged. A user or service account with this permission
        /// can create new processors that can interact with any gcs bucket in your
        /// project.
        pub async fn update_dataset(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateDatasetRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentService/UpdateDataset",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentService",
                        "UpdateDataset",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Import documents into a dataset.
        pub async fn import_documents(
            &mut self,
            request: impl tonic::IntoRequest<super::ImportDocumentsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentService/ImportDocuments",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentService",
                        "ImportDocuments",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Returns relevant fields present in the requested document.
        pub async fn get_document(
            &mut self,
            request: impl tonic::IntoRequest<super::GetDocumentRequest>,
        ) -> std::result::Result<
            tonic::Response<super::GetDocumentResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentService/GetDocument",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentService",
                        "GetDocument",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Returns a list of documents present in the dataset.
        pub async fn list_documents(
            &mut self,
            request: impl tonic::IntoRequest<super::ListDocumentsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::ListDocumentsResponse>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentService/ListDocuments",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentService",
                        "ListDocuments",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Deletes a set of documents.
        pub async fn batch_delete_documents(
            &mut self,
            request: impl tonic::IntoRequest<super::BatchDeleteDocumentsRequest>,
        ) -> std::result::Result<
            tonic::Response<super::super::super::super::longrunning::Operation>,
            tonic::Status,
        > {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentService/BatchDeleteDocuments",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentService",
                        "BatchDeleteDocuments",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Gets the `DatasetSchema` of a `Dataset`.
        pub async fn get_dataset_schema(
            &mut self,
            request: impl tonic::IntoRequest<super::GetDatasetSchemaRequest>,
        ) -> std::result::Result<tonic::Response<super::DatasetSchema>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentService/GetDatasetSchema",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentService",
                        "GetDatasetSchema",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
        /// Updates a `DatasetSchema`.
        pub async fn update_dataset_schema(
            &mut self,
            request: impl tonic::IntoRequest<super::UpdateDatasetSchemaRequest>,
        ) -> std::result::Result<tonic::Response<super::DatasetSchema>, tonic::Status> {
            self.inner
                .ready()
                .await
                .map_err(|e| {
                    tonic::Status::unknown(
                        format!("Service was not ready: {}", e.into()),
                    )
                })?;
            let codec = tonic_prost::ProstCodec::default();
            let path = http::uri::PathAndQuery::from_static(
                "/google.cloud.documentai.v1beta3.DocumentService/UpdateDatasetSchema",
            );
            let mut req = request.into_request();
            req.extensions_mut()
                .insert(
                    GrpcMethod::new(
                        "google.cloud.documentai.v1beta3.DocumentService",
                        "UpdateDatasetSchema",
                    ),
                );
            self.inner.unary(req, path, codec).await
        }
    }
}
