# frozen_string_literal: true

# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Auto-generated by gapic-generator-ruby. DO NOT EDIT!


module Google
  module Cloud
    module DocumentAI
      module V1beta3
        # Document represents the canonical document resource in Document Understanding
        # AI.
        # It is an interchange format that provides insights into documents and allows
        # for collaboration between users and Document Understanding AI to iterate and
        # optimize for quality.
        # @!attribute [rw] uri
        #   @return [::String]
        #     Optional. Currently supports Google Cloud Storage URI of the form
        #        `gs://bucket_name/object_name`. Object versioning is not supported.
        #        See [Google Cloud Storage Request
        #        URIs](https://cloud.google.com/storage/docs/reference-uris) for more
        #        info.
        # @!attribute [rw] content
        #   @return [::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.
        # @!attribute [rw] mime_type
        #   @return [::String]
        #     An IANA published MIME type (also referred to as media type). For more
        #     information, see
        #     https://www.iana.org/assignments/media-types/media-types.xhtml.
        # @!attribute [rw] text
        #   @return [::String]
        #     Optional. UTF-8 encoded text in reading order from the document.
        # @!attribute [rw] text_styles
        #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Style>]
        #     Styles for the {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}.
        # @!attribute [rw] pages
        #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page>]
        #     Visual page layout for the {::Google::Cloud::DocumentAI::V1beta3::Document Document}.
        # @!attribute [rw] entities
        #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Entity>]
        #     A list of entities detected on {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. For document shards,
        #     entities in this list may cross shard boundaries.
        # @!attribute [rw] entity_relations
        #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::EntityRelation>]
        #     Relationship among {::Google::Cloud::DocumentAI::V1beta3::Document#entities Document.entities}.
        # @!attribute [rw] text_changes
        #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::TextChange>]
        #     A list of text corrections made to [Document.text].  This is usually
        #     used for annotating corrections to OCR mistakes.  Text changes for a given
        #     revision may not overlap with each other.
        # @!attribute [rw] shard_info
        #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::ShardInfo]
        #     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.
        # @!attribute [rw] error
        #   @return [::Google::Rpc::Status]
        #     Any error that occurred while processing this document.
        # @!attribute [rw] revisions
        #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Revision>]
        #     Revision history of this document.
        class Document
          include ::Google::Protobuf::MessageExts
          extend ::Google::Protobuf::MessageExts::ClassMethods

          # 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.
          # @!attribute [rw] shard_index
          #   @return [::Integer]
          #     The 0-based index of this shard.
          # @!attribute [rw] shard_count
          #   @return [::Integer]
          #     Total number of shards.
          # @!attribute [rw] text_offset
          #   @return [::Integer]
          #     The index of the first character in {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text} in the overall
          #     document global text.
          class ShardInfo
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Annotation for common text style attributes. This adheres to CSS
          # conventions as much as possible.
          # @!attribute [rw] text_anchor
          #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
          #     Text anchor indexing into the {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}.
          # @!attribute [rw] color
          #   @return [::Google::Type::Color]
          #     Text color.
          # @!attribute [rw] background_color
          #   @return [::Google::Type::Color]
          #     Text background color.
          # @!attribute [rw] font_weight
          #   @return [::String]
          #     Font weight. Possible values are normal, bold, bolder, and lighter.
          #     https://www.w3schools.com/cssref/pr_font_weight.asp
          # @!attribute [rw] text_style
          #   @return [::String]
          #     Text style. Possible values are normal, italic, and oblique.
          #     https://www.w3schools.com/cssref/pr_font_font-style.asp
          # @!attribute [rw] text_decoration
          #   @return [::String]
          #     Text decoration. Follows CSS standard.
          #     <text-decoration-line> <text-decoration-color> <text-decoration-style>
          #     https://www.w3schools.com/cssref/pr_text_text-decoration.asp
          # @!attribute [rw] font_size
          #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Style::FontSize]
          #     Font size.
          class Style
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods

            # Font size with unit.
            # @!attribute [rw] size
            #   @return [::Float]
            #     Font size for the text.
            # @!attribute [rw] unit
            #   @return [::String]
            #     Unit for the font size. Follows CSS naming (in, px, pt, etc.).
            class FontSize
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end
          end

          # A page in a {::Google::Cloud::DocumentAI::V1beta3::Document Document}.
          # @!attribute [rw] page_number
          #   @return [::Integer]
          #     1-based index for current {::Google::Cloud::DocumentAI::V1beta3::Document::Page Page} in a parent {::Google::Cloud::DocumentAI::V1beta3::Document Document}.
          #     Useful when a page is taken out of a {::Google::Cloud::DocumentAI::V1beta3::Document Document} for individual
          #     processing.
          # @!attribute [rw] image
          #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Image]
          #     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.
          # @!attribute [rw] transforms
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Matrix>]
          #     Transformation matrices that were applied to the original document image
          #     to produce {::Google::Cloud::DocumentAI::V1beta3::Document::Page#image Page.image}.
          # @!attribute [rw] dimension
          #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Dimension]
          #     Physical dimension of the page.
          # @!attribute [rw] layout
          #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout]
          #     {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the page.
          # @!attribute [rw] detected_languages
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>]
          #     A list of detected languages together with confidence.
          # @!attribute [rw] blocks
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Block>]
          #     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.
          # @!attribute [rw] paragraphs
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Paragraph>]
          #     A list of visually detected text paragraphs on the page.
          #     A collection of lines that a human would perceive as a paragraph.
          # @!attribute [rw] lines
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Line>]
          #     A list of visually detected text lines on the page.
          #     A collection of tokens that a human would perceive as a line.
          # @!attribute [rw] tokens
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token>]
          #     A list of visually detected tokens on the page.
          # @!attribute [rw] visual_elements
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement>]
          #     A list of detected non-text visual elements e.g. checkbox,
          #     signature etc. on the page.
          # @!attribute [rw] tables
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table>]
          #     A list of visually detected tables on the page.
          # @!attribute [rw] form_fields
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField>]
          #     A list of visually detected form fields on the page.
          class Page
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods

            # Dimension for the page.
            # @!attribute [rw] width
            #   @return [::Float]
            #     Page width.
            # @!attribute [rw] height
            #   @return [::Float]
            #     Page height.
            # @!attribute [rw] unit
            #   @return [::String]
            #     Dimension unit.
            class Dimension
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end

            # Rendered image contents for this page.
            # @!attribute [rw] content
            #   @return [::String]
            #     Raw byte content of the image.
            # @!attribute [rw] mime_type
            #   @return [::String]
            #     Encoding mime type for the image.
            # @!attribute [rw] width
            #   @return [::Integer]
            #     Width of the image in pixels.
            # @!attribute [rw] height
            #   @return [::Integer]
            #     Height of the image in pixels.
            class Image
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end

            # Representation for transformation matrix, intended to be compatible and
            # used with OpenCV format for image manipulation.
            # @!attribute [rw] rows
            #   @return [::Integer]
            #     Number of rows in the matrix.
            # @!attribute [rw] cols
            #   @return [::Integer]
            #     Number of columns in the matrix.
            # @!attribute [rw] type
            #   @return [::Integer]
            #     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
            # @!attribute [rw] data
            #   @return [::String]
            #     The matrix data.
            class Matrix
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end

            # Visual element describing a layout unit on a page.
            # @!attribute [rw] text_anchor
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
            #     Text anchor indexing into the {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}.
            # @!attribute [rw] confidence
            #   @return [::Float]
            #     Confidence of the current {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout 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].
            # @!attribute [rw] bounding_poly
            #   @return [::Google::Cloud::DocumentAI::V1beta3::BoundingPoly]
            #     The bounding polygon for the {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout}.
            # @!attribute [rw] orientation
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout::Orientation]
            #     Detected orientation for the {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout}.
            class Layout
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods

              # Detected human reading orientation.
              module Orientation
                # Unspecified orientation.
                ORIENTATION_UNSPECIFIED = 0

                # Orientation is aligned with page up.
                PAGE_UP = 1

                # Orientation is aligned with page right.
                # Turn the head 90 degrees clockwise from upright to read.
                PAGE_RIGHT = 2

                # Orientation is aligned with page down.
                # Turn the head 180 degrees from upright to read.
                PAGE_DOWN = 3

                # Orientation is aligned with page left.
                # Turn the head 90 degrees counterclockwise from upright to read.
                PAGE_LEFT = 4
              end
            end

            # A block has a set of lines (collected into paragraphs) that have a
            # common line-spacing and orientation.
            # @!attribute [rw] layout
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout]
            #     {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Block Block}.
            # @!attribute [rw] detected_languages
            #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>]
            #     A list of detected languages together with confidence.
            # @!attribute [rw] provenance
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance]
            #     The history of this annotation.
            class Block
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end

            # A collection of lines that a human would perceive as a paragraph.
            # @!attribute [rw] layout
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout]
            #     {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Paragraph Paragraph}.
            # @!attribute [rw] detected_languages
            #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>]
            #     A list of detected languages together with confidence.
            # @!attribute [rw] provenance
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance]
            #     The  history of this annotation.
            class Paragraph
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end

            # A collection of tokens that a human would perceive as a line.
            # Does not cross column boundaries, can be horizontal, vertical, etc.
            # @!attribute [rw] layout
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout]
            #     {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Line Line}.
            # @!attribute [rw] detected_languages
            #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>]
            #     A list of detected languages together with confidence.
            # @!attribute [rw] provenance
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance]
            #     The  history of this annotation.
            class Line
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end

            # A detected token.
            # @!attribute [rw] layout
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout]
            #     {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}.
            # @!attribute [rw] detected_break
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::DetectedBreak]
            #     Detected break at the end of a {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}.
            # @!attribute [rw] detected_languages
            #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>]
            #     A list of detected languages together with confidence.
            # @!attribute [rw] provenance
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance]
            #     The  history of this annotation.
            class Token
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods

              # Detected break at the end of a {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token Token}.
              # @!attribute [rw] type
              #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Token::DetectedBreak::Type]
              #     Detected break type.
              class DetectedBreak
                include ::Google::Protobuf::MessageExts
                extend ::Google::Protobuf::MessageExts::ClassMethods

                # Enum to denote the type of break found.
                module Type
                  # Unspecified break type.
                  TYPE_UNSPECIFIED = 0

                  # A single whitespace.
                  SPACE = 1

                  # A wider whitespace.
                  WIDE_SPACE = 2

                  # A hyphen that indicates that a token has been split across lines.
                  HYPHEN = 3
                end
              end
            end

            # Detected non-text visual elements e.g. checkbox, signature etc. on the
            # page.
            # @!attribute [rw] layout
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout]
            #     {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement VisualElement}.
            # @!attribute [rw] type
            #   @return [::String]
            #     Type of the {::Google::Cloud::DocumentAI::V1beta3::Document::Page::VisualElement VisualElement}.
            # @!attribute [rw] detected_languages
            #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>]
            #     A list of detected languages together with confidence.
            class VisualElement
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end

            # A table representation similar to HTML table structure.
            # @!attribute [rw] layout
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout]
            #     {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table Table}.
            # @!attribute [rw] header_rows
            #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableRow>]
            #     Header rows of the table.
            # @!attribute [rw] body_rows
            #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableRow>]
            #     Body rows of the table.
            # @!attribute [rw] detected_languages
            #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>]
            #     A list of detected languages together with confidence.
            class Table
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods

              # A row of table cells.
              # @!attribute [rw] cells
              #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableCell>]
              #     Cells that make up this row.
              class TableRow
                include ::Google::Protobuf::MessageExts
                extend ::Google::Protobuf::MessageExts::ClassMethods
              end

              # A cell representation inside the table.
              # @!attribute [rw] layout
              #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout]
              #     {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Table::TableCell TableCell}.
              # @!attribute [rw] row_span
              #   @return [::Integer]
              #     How many rows this cell spans.
              # @!attribute [rw] col_span
              #   @return [::Integer]
              #     How many columns this cell spans.
              # @!attribute [rw] detected_languages
              #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>]
              #     A list of detected languages together with confidence.
              class TableCell
                include ::Google::Protobuf::MessageExts
                extend ::Google::Protobuf::MessageExts::ClassMethods
              end
            end

            # A form field detected on the page.
            # @!attribute [rw] field_name
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout]
            #     {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the {::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField FormField} name. e.g. `Address`, `Email`,
            #     `Grand total`, `Phone number`, etc.
            # @!attribute [rw] field_value
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout]
            #     {::Google::Cloud::DocumentAI::V1beta3::Document::Page::Layout Layout} for the {::Google::Cloud::DocumentAI::V1beta3::Document::Page::FormField FormField} value.
            # @!attribute [rw] name_detected_languages
            #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>]
            #     A list of detected languages for name together with confidence.
            # @!attribute [rw] value_detected_languages
            #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page::DetectedLanguage>]
            #     A list of detected languages for value together with confidence.
            # @!attribute [rw] value_type
            #   @return [::String]
            #     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"
            class FormField
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end

            # Detected language for a structural component.
            # @!attribute [rw] language_code
            #   @return [::String]
            #     The BCP-47 language code, such as "en-US" or "sr-Latn". For more
            #     information, see
            #     http://www.unicode.org/reports/tr35/#Unicode_locale_identifier.
            # @!attribute [rw] confidence
            #   @return [::Float]
            #     Confidence of detected language. Range [0, 1].
            class DetectedLanguage
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end
          end

          # A phrase in the text that is a known entity type, such as a person, an
          # organization, or location.
          # @!attribute [rw] text_anchor
          #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
          #     Optional. Provenance of the entity.
          #     Text anchor indexing into the {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}.
          # @!attribute [rw] type
          #   @return [::String]
          #     Entity type from a schema e.g. `Address`.
          # @!attribute [rw] mention_text
          #   @return [::String]
          #     Optional. Text value in the document e.g. `1600 Amphitheatre Pkwy`.
          # @!attribute [rw] mention_id
          #   @return [::String]
          #     Optional. Deprecated.  Use `id` field instead.
          # @!attribute [rw] confidence
          #   @return [::Float]
          #     Optional. Confidence of detected Schema entity. Range [0, 1].
          # @!attribute [rw] page_anchor
          #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor]
          #     Optional. Represents the provenance of this entity wrt. the location on the
          #     page where it was found.
          # @!attribute [rw] id
          #   @return [::String]
          #     Optional. Canonical id. This will be a unique value in the entity list
          #     for this document.
          # @!attribute [rw] normalized_value
          #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Entity::NormalizedValue]
          #     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.
          # @!attribute [rw] properties
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Entity>]
          #     Optional. Entities can be nested to form a hierarchical data structure representing
          #     the content in the document.
          # @!attribute [rw] provenance
          #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance]
          #     Optional. The history of this annotation.
          # @!attribute [rw] redacted
          #   @return [::Boolean]
          #     Optional. Whether the entity will be redacted for de-identification purposes.
          class Entity
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods

            # Parsed and normalized entity value.
            # @!attribute [rw] money_value
            #   @return [::Google::Type::Money]
            #     Money value. See also:
            #     https://github.com/googleapis/googleapis/blob/master/google/type/money.proto
            # @!attribute [rw] date_value
            #   @return [::Google::Type::Date]
            #     Date value. Includes year, month, day. See also:
            #     https://github.com/googleapis/googleapis/blob/master/google/type/date.proto
            # @!attribute [rw] datetime_value
            #   @return [::Google::Type::DateTime]
            #     DateTime value. Includes date, time, and timezone. See also:
            #     https://github.com/googleapis/googleapis/blob/master/google/type/datetime.proto
            # @!attribute [rw] address_value
            #   @return [::Google::Type::PostalAddress]
            #     Postal address. See also:
            #     https://github.com/googleapis/googleapis/blob/master/google/type/postal_address.proto
            # @!attribute [rw] boolean_value
            #   @return [::Boolean]
            #     Boolean value. Can be used for entities with binary values, or for
            #     checkboxes.
            # @!attribute [rw] text
            #   @return [::String]
            #     Required. Normalized entity value stored as a string. This field is populated for
            #     supported document type (e.g. Invoice). For some entity types, one of
            #     respective 'structured_value' fields may also be populated.
            #
            #     - 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.
            class NormalizedValue
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end
          end

          # Relationship between {::Google::Cloud::DocumentAI::V1beta3::Document::Entity Entities}.
          # @!attribute [rw] subject_id
          #   @return [::String]
          #     Subject entity id.
          # @!attribute [rw] object_id
          #   @return [::String]
          #     Object entity id.
          # @!attribute [rw] relation
          #   @return [::String]
          #     Relationship description.
          class EntityRelation
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end

          # Text reference indexing into the {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}.
          # @!attribute [rw] text_segments
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment>]
          #     The text segments from the {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}.
          # @!attribute [rw] content
          #   @return [::String]
          #     Contains the content of the text span so that users do
          #     not have to look it up in the text_segments.
          class TextAnchor
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods

            # A text segment in the {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}. The indices may be out of bounds
            # which indicate that the text extends into another document shard for
            # large sharded documents. See {::Google::Cloud::DocumentAI::V1beta3::Document::ShardInfo#text_offset ShardInfo.text_offset}
            # @!attribute [rw] start_index
            #   @return [::Integer]
            #     {::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment TextSegment} start UTF-8 char index in the {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}.
            # @!attribute [rw] end_index
            #   @return [::Integer]
            #     {::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor::TextSegment TextSegment} half open end UTF-8 char index in the
            #     {::Google::Cloud::DocumentAI::V1beta3::Document#text Document.text}.
            class TextSegment
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end
          end

          # Referencing the visual context of the entity in the {::Google::Cloud::DocumentAI::V1beta3::Document#pages Document.pages}.
          # Page anchors can be cross-page, consist of multiple bounding polygons and
          # optionally reference specific layout element types.
          # @!attribute [rw] page_refs
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef>]
          #     One or more references to visual page elements
          class PageAnchor
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods

            # Represents a weak reference to a page element within a document.
            # @!attribute [rw] page
            #   @return [::Integer]
            #     Required. Index into the {::Google::Cloud::DocumentAI::V1beta3::Document#pages Document.pages} element, for example using
            #     [Document.pages][page_refs.page] to locate the related page element.
            # @!attribute [rw] layout_type
            #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef::LayoutType]
            #     Optional. The type of the layout element that is being referenced if any.
            # @!attribute [rw] layout_id
            #   @return [::String]
            #     Optional. Deprecated.  Use {::Google::Cloud::DocumentAI::V1beta3::Document::PageAnchor::PageRef#bounding_poly PageRef.bounding_poly} instead.
            # @!attribute [rw] bounding_poly
            #   @return [::Google::Cloud::DocumentAI::V1beta3::BoundingPoly]
            #     Optional. Identifies the bounding polygon of a layout element on the page.
            class PageRef
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods

              # The type of layout that is being referenced.
              module LayoutType
                # Layout Unspecified.
                LAYOUT_TYPE_UNSPECIFIED = 0

                # References a {::Google::Cloud::DocumentAI::V1beta3::Document::Page#blocks Page.blocks} element.
                BLOCK = 1

                # References a {::Google::Cloud::DocumentAI::V1beta3::Document::Page#paragraphs Page.paragraphs} element.
                PARAGRAPH = 2

                # References a {::Google::Cloud::DocumentAI::V1beta3::Document::Page#lines Page.lines} element.
                LINE = 3

                # References a {::Google::Cloud::DocumentAI::V1beta3::Document::Page#tokens Page.tokens} element.
                TOKEN = 4

                # References a {::Google::Cloud::DocumentAI::V1beta3::Document::Page#visual_elements Page.visual_elements} element.
                VISUAL_ELEMENT = 5

                # Refrrences a {::Google::Cloud::DocumentAI::V1beta3::Document::Page#tables Page.tables} element.
                TABLE = 6

                # References a {::Google::Cloud::DocumentAI::V1beta3::Document::Page#form_fields Page.form_fields} element.
                FORM_FIELD = 7
              end
            end
          end

          # Structure to identify provenance relationships between annotations in
          # different revisions.
          # @!attribute [rw] revision
          #   @return [::Integer]
          #     The index of the revision that produced this element.
          # @!attribute [rw] id
          #   @return [::Integer]
          #     The Id of this operation.  Needs to be unique within the scope of the
          #     revision.
          # @!attribute [rw] parents
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance::Parent>]
          #     References to the original elements that are replaced.
          # @!attribute [rw] type
          #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Provenance::OperationType]
          #     The type of provenance operation.
          class Provenance
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods

            # Structure for referencing parent provenances.  When an element replaces
            # one of more other elements parent references identify the elements that
            # are replaced.
            # @!attribute [rw] revision
            #   @return [::Integer]
            #     The index of the [Document.revisions] identifying the parent revision.
            # @!attribute [rw] id
            #   @return [::Integer]
            #     The id of the parent provenance.
            class Parent
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end

            # If a processor or agent does an explicit operation on existing elements.
            module OperationType
              # Operation type unspecified.
              OPERATION_TYPE_UNSPECIFIED = 0

              # Add an element.  Implicit if no `parents` are set for the provenance.
              ADD = 1

              # The element is removed.  No `parents` should be set.
              REMOVE = 2

              # Explicitly replaces the element(s) identified by `parents`.
              REPLACE = 3

              # Element is requested for human review.
              EVAL_REQUESTED = 4

              # Element is reviewed and approved at human review, confidence will be
              # set to 1.0.
              EVAL_APPROVED = 5

              # Element is skipped in the validation process.
              EVAL_SKIPPED = 6
            end
          end

          # Contains past or forward revisions of this document.
          # @!attribute [rw] agent
          #   @return [::String]
          #     If the change was made by a person specify the name or id of that
          #     person.
          # @!attribute [rw] processor
          #   @return [::String]
          #     If the annotation was made by processor identify the processor by its
          #     resource name.
          # @!attribute [rw] id
          #   @return [::String]
          #     Id of the revision.  Unique within the context of the document.
          # @!attribute [rw] parent
          #   @return [::Array<::Integer>]
          #     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.
          # @!attribute [rw] create_time
          #   @return [::Google::Protobuf::Timestamp]
          #     The time that the revision was created.
          # @!attribute [rw] human_review
          #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::Revision::HumanReview]
          #     Human Review information of this revision.
          class Revision
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods

            # Human Review information of the document.
            # @!attribute [rw] state
            #   @return [::String]
            #     Human review state. e.g. `requested`, `succeeded`, `rejected`.
            # @!attribute [rw] state_message
            #   @return [::String]
            #     A message providing more details about the current state of processing.
            #     For example, the rejection reason when the state is `rejected`.
            class HumanReview
              include ::Google::Protobuf::MessageExts
              extend ::Google::Protobuf::MessageExts::ClassMethods
            end
          end

          # This message is used for text changes aka. OCR corrections.
          # @!attribute [rw] text_anchor
          #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
          #     Provenance of the correction.
          #     Text anchor indexing into the {::Google::Cloud::DocumentAI::V1beta3::Document#text 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.
          # @!attribute [rw] changed_text
          #   @return [::String]
          #     The text that replaces the text identified in the `text_anchor`.
          # @!attribute [rw] provenance
          #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
          #     The history of this annotation.
          class TextChange
            include ::Google::Protobuf::MessageExts
            extend ::Google::Protobuf::MessageExts::ClassMethods
          end
        end
      end
    end
  end
end