Class: Google::Cloud::DocumentAI::V1beta3::Document

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/documentai/v1beta3/document.rb

Overview

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.

Defined Under Namespace

Classes: Entity, EntityRelation, Page, PageAnchor, Provenance, Revision, ShardInfo, Style, TextAnchor, TextChange, Translation

Instance Attribute Summary collapse

Instance Attribute Details

#content::String

Returns 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.

Returns:

  • (::String)

    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.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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

#entities::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Entity>

Returns A list of entities detected on Document.text. For document shards, entities in this list may cross shard boundaries.

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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

#entity_relations::Array<::Google::Cloud::DocumentAI::V1beta3::Document::EntityRelation>

Returns Relationship among Document.entities.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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

#error::Google::Rpc::Status

Returns Any error that occurred while processing this document.

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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

#mime_type::String

Returns 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.

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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

#pages::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Page>

Returns Visual page layout for the Document.

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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

#revisions::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Revision>

Returns Revision history of this document.

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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

#shard_info::Google::Cloud::DocumentAI::V1beta3::Document::ShardInfo

Returns 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.

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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

#text::String

Returns UTF-8 encoded text in reading order from the document.

Returns:

  • (::String)

    UTF-8 encoded text in reading order from the document.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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

#text_changes::Array<::Google::Cloud::DocumentAI::V1beta3::Document::TextChange>

Returns 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.

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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

#text_styles::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Style>

Returns Styles for the Document.text.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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

#translations::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Translation>

Returns A list of translations on Document.text. For document shards, translations in this list may cross shard boundaries.

Returns:



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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

#uri::String

Returns 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 for more info.

Returns:

  • (::String)

    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 for more info.



81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
# File 'proto_docs/google/cloud/documentai/v1beta3/document.rb', line 81

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]
  #     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]
  #     Text value in the document e.g. `1600 Amphitheatre Pkwy`.
  # @!attribute [rw] mention_id
  #   @return [::String]
  #     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

  # A translation of the text segment.
  # @!attribute [rw] text_anchor
  #   @return [::Google::Cloud::DocumentAI::V1beta3::Document::TextAnchor]
  #     Provenance of the translation.
  #     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] 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] translated_text
  #   @return [::String]
  #     Text translated into the target language.
  # @!attribute [rw] provenance
  #   @return [::Array<::Google::Cloud::DocumentAI::V1beta3::Document::Provenance>]
  #     The history of this annotation.
  class Translation
    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 review and approved at human review, confidence will be set
      # to 1.0
      EVAL_APPROVED = 5
    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