-
Notifications
You must be signed in to change notification settings - Fork 461
Expand file tree
/
Copy pathDocument.php
More file actions
835 lines (759 loc) · 30.7 KB
/
Document.php
File metadata and controls
835 lines (759 loc) · 30.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/cloud/documentai/v1/document.proto
namespace Google\Cloud\DocumentAI\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;
/**
* Document represents the canonical document resource in Document AI. It is an
* interchange format that provides insights into documents and allows for
* collaboration between users and Document AI to iterate and optimize for
* quality.
*
* Generated from protobuf message <code>google.cloud.documentai.v1.Document</code>
*/
class Document extends \Google\Protobuf\Internal\Message
{
/**
* Optional. An internal identifier for document. Should be loggable (no PII).
*
* Generated from protobuf field <code>string docid = 15 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $docid = '';
/**
* An IANA published [media type (MIME
* type)](https://www.iana.org/assignments/media-types/media-types.xhtml).
*
* Generated from protobuf field <code>string mime_type = 3;</code>
*/
protected $mime_type = '';
/**
* Optional. UTF-8 encoded text in reading order from the document.
*
* Generated from protobuf field <code>string text = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
protected $text = '';
/**
* Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Style text_styles = 5 [deprecated = true];</code>
* @deprecated
*/
private $text_styles;
/**
* Visual page layout for the [Document][google.cloud.documentai.v1.Document].
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Page pages = 6;</code>
*/
private $pages;
/**
* A list of entities detected on
* [Document.text][google.cloud.documentai.v1.Document.text]. For document
* shards, entities in this list may cross shard boundaries.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Entity entities = 7;</code>
*/
private $entities;
/**
* Placeholder. Relationship among
* [Document.entities][google.cloud.documentai.v1.Document.entities].
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8;</code>
*/
private $entity_relations;
/**
* Placeholder. A list of text corrections made to
* [Document.text][google.cloud.documentai.v1.Document.text]. This is usually
* used for annotating corrections to OCR mistakes. Text changes for a given
* revision may not overlap with each other.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14;</code>
*/
private $text_changes;
/**
* 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.
*
* Generated from protobuf field <code>.google.cloud.documentai.v1.Document.ShardInfo shard_info = 9;</code>
*/
protected $shard_info = null;
/**
* Any error that occurred while processing this document.
*
* Generated from protobuf field <code>.google.rpc.Status error = 10;</code>
*/
protected $error = null;
/**
* Placeholder. Revision history of this document.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Revision revisions = 13;</code>
*/
private $revisions;
/**
* Parsed layout of the document.
*
* Generated from protobuf field <code>.google.cloud.documentai.v1.Document.DocumentLayout document_layout = 17;</code>
*/
protected $document_layout = null;
/**
* Document chunked based on chunking config.
*
* Generated from protobuf field <code>.google.cloud.documentai.v1.Document.ChunkedDocument chunked_document = 18;</code>
*/
protected $chunked_document = null;
/**
* Optional. The blob assets in this document. This is used to store the
* content of the inline blobs in this document, for example, image bytes,
* such that it can be referenced by other fields in the document via asset
* id.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.BlobAsset blob_assets = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
*/
private $blob_assets;
/**
* The entity validation output for the document. This is the validation
* output for `document.entities` field.
*
* Generated from protobuf field <code>.google.cloud.documentai.v1.Document.EntityValidationOutput entity_validation_output = 21;</code>
*/
protected $entity_validation_output = null;
/**
* A list of entity revisions. The entity revisions are appended to the
* document in the processing order. This field can be used for comparing the
* entity extraction results at different stages of the processing.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.EntitiesRevision entities_revisions = 22;</code>
*/
private $entities_revisions;
/**
* The entity revision ID that `document.entities` field is based on.
* If this field is set and `entities_revisions` is not empty, the entities in
* `document.entities` field are the entities in the entity revision with this
* id and `document.entity_validation_output` field is the
* `entity_validation_output` field in this entity revision.
*
* Generated from protobuf field <code>string entities_revision_id = 23;</code>
*/
protected $entities_revision_id = '';
protected $source;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $uri
* Optional. Currently supports Google Cloud Storage URI of the form
* `gs://bucket_name/object_name`. Object versioning is not supported.
* For more information, refer to [Google Cloud Storage Request
* URIs](https://cloud.google.com/storage/docs/reference-uris).
* @type string $content
* Optional. Inline document content, represented as a stream of bytes.
* Note: As with all `bytes` fields, protobuffers use a pure binary
* representation, whereas JSON representations use base64.
* @type string $docid
* Optional. An internal identifier for document. Should be loggable (no PII).
* @type string $mime_type
* An IANA published [media type (MIME
* type)](https://www.iana.org/assignments/media-types/media-types.xhtml).
* @type string $text
* Optional. UTF-8 encoded text in reading order from the document.
* @type \Google\Cloud\DocumentAI\V1\Document\Style[] $text_styles
* Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
* @type \Google\Cloud\DocumentAI\V1\Document\Page[] $pages
* Visual page layout for the [Document][google.cloud.documentai.v1.Document].
* @type \Google\Cloud\DocumentAI\V1\Document\Entity[] $entities
* A list of entities detected on
* [Document.text][google.cloud.documentai.v1.Document.text]. For document
* shards, entities in this list may cross shard boundaries.
* @type \Google\Cloud\DocumentAI\V1\Document\EntityRelation[] $entity_relations
* Placeholder. Relationship among
* [Document.entities][google.cloud.documentai.v1.Document.entities].
* @type \Google\Cloud\DocumentAI\V1\Document\TextChange[] $text_changes
* Placeholder. A list of text corrections made to
* [Document.text][google.cloud.documentai.v1.Document.text]. This is usually
* used for annotating corrections to OCR mistakes. Text changes for a given
* revision may not overlap with each other.
* @type \Google\Cloud\DocumentAI\V1\Document\ShardInfo $shard_info
* 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.
* @type \Google\Rpc\Status $error
* Any error that occurred while processing this document.
* @type \Google\Cloud\DocumentAI\V1\Document\Revision[] $revisions
* Placeholder. Revision history of this document.
* @type \Google\Cloud\DocumentAI\V1\Document\DocumentLayout $document_layout
* Parsed layout of the document.
* @type \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument $chunked_document
* Document chunked based on chunking config.
* @type \Google\Cloud\DocumentAI\V1\Document\BlobAsset[] $blob_assets
* Optional. The blob assets in this document. This is used to store the
* content of the inline blobs in this document, for example, image bytes,
* such that it can be referenced by other fields in the document via asset
* id.
* @type \Google\Cloud\DocumentAI\V1\Document\EntityValidationOutput $entity_validation_output
* The entity validation output for the document. This is the validation
* output for `document.entities` field.
* @type \Google\Cloud\DocumentAI\V1\Document\EntitiesRevision[] $entities_revisions
* A list of entity revisions. The entity revisions are appended to the
* document in the processing order. This field can be used for comparing the
* entity extraction results at different stages of the processing.
* @type string $entities_revision_id
* The entity revision ID that `document.entities` field is based on.
* If this field is set and `entities_revisions` is not empty, the entities in
* `document.entities` field are the entities in the entity revision with this
* id and `document.entity_validation_output` field is the
* `entity_validation_output` field in this entity revision.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Google\Cloud\Documentai\V1\Document::initOnce();
parent::__construct($data);
}
/**
* Optional. Currently supports Google Cloud Storage URI of the form
* `gs://bucket_name/object_name`. Object versioning is not supported.
* For more information, refer to [Google Cloud Storage Request
* URIs](https://cloud.google.com/storage/docs/reference-uris).
*
* Generated from protobuf field <code>string uri = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return string
*/
public function getUri()
{
return $this->readOneof(1);
}
public function hasUri()
{
return $this->hasOneof(1);
}
/**
* Optional. Currently supports Google Cloud Storage URI of the form
* `gs://bucket_name/object_name`. Object versioning is not supported.
* For more information, refer to [Google Cloud Storage Request
* URIs](https://cloud.google.com/storage/docs/reference-uris).
*
* Generated from protobuf field <code>string uri = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param string $var
* @return $this
*/
public function setUri($var)
{
GPBUtil::checkString($var, True);
$this->writeOneof(1, $var);
return $this;
}
/**
* Optional. Inline document content, represented as a stream of bytes.
* Note: As with all `bytes` fields, protobuffers use a pure binary
* representation, whereas JSON representations use base64.
*
* Generated from protobuf field <code>bytes content = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return string
*/
public function getContent()
{
return $this->readOneof(2);
}
public function hasContent()
{
return $this->hasOneof(2);
}
/**
* Optional. Inline document content, represented as a stream of bytes.
* Note: As with all `bytes` fields, protobuffers use a pure binary
* representation, whereas JSON representations use base64.
*
* Generated from protobuf field <code>bytes content = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param string $var
* @return $this
*/
public function setContent($var)
{
GPBUtil::checkString($var, False);
$this->writeOneof(2, $var);
return $this;
}
/**
* Optional. An internal identifier for document. Should be loggable (no PII).
*
* Generated from protobuf field <code>string docid = 15 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return string
*/
public function getDocid()
{
return $this->docid;
}
/**
* Optional. An internal identifier for document. Should be loggable (no PII).
*
* Generated from protobuf field <code>string docid = 15 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param string $var
* @return $this
*/
public function setDocid($var)
{
GPBUtil::checkString($var, True);
$this->docid = $var;
return $this;
}
/**
* An IANA published [media type (MIME
* type)](https://www.iana.org/assignments/media-types/media-types.xhtml).
*
* Generated from protobuf field <code>string mime_type = 3;</code>
* @return string
*/
public function getMimeType()
{
return $this->mime_type;
}
/**
* An IANA published [media type (MIME
* type)](https://www.iana.org/assignments/media-types/media-types.xhtml).
*
* Generated from protobuf field <code>string mime_type = 3;</code>
* @param string $var
* @return $this
*/
public function setMimeType($var)
{
GPBUtil::checkString($var, True);
$this->mime_type = $var;
return $this;
}
/**
* Optional. UTF-8 encoded text in reading order from the document.
*
* Generated from protobuf field <code>string text = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return string
*/
public function getText()
{
return $this->text;
}
/**
* Optional. UTF-8 encoded text in reading order from the document.
*
* Generated from protobuf field <code>string text = 4 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param string $var
* @return $this
*/
public function setText($var)
{
GPBUtil::checkString($var, True);
$this->text = $var;
return $this;
}
/**
* Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Style text_styles = 5 [deprecated = true];</code>
* @return RepeatedField<\Google\Cloud\DocumentAI\V1\Document\Style>
* @deprecated
*/
public function getTextStyles()
{
if ($this->text_styles->count() !== 0) {
@trigger_error('text_styles is deprecated.', E_USER_DEPRECATED);
}
return $this->text_styles;
}
/**
* Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Style text_styles = 5 [deprecated = true];</code>
* @param \Google\Cloud\DocumentAI\V1\Document\Style[] $var
* @return $this
* @deprecated
*/
public function setTextStyles($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Style::class);
if (count($arr) !== 0) {
@trigger_error('text_styles is deprecated.', E_USER_DEPRECATED);
}
$this->text_styles = $arr;
return $this;
}
/**
* Visual page layout for the [Document][google.cloud.documentai.v1.Document].
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Page pages = 6;</code>
* @return RepeatedField<\Google\Cloud\DocumentAI\V1\Document\Page>
*/
public function getPages()
{
return $this->pages;
}
/**
* Visual page layout for the [Document][google.cloud.documentai.v1.Document].
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Page pages = 6;</code>
* @param \Google\Cloud\DocumentAI\V1\Document\Page[] $var
* @return $this
*/
public function setPages($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Page::class);
$this->pages = $arr;
return $this;
}
/**
* A list of entities detected on
* [Document.text][google.cloud.documentai.v1.Document.text]. For document
* shards, entities in this list may cross shard boundaries.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Entity entities = 7;</code>
* @return RepeatedField<\Google\Cloud\DocumentAI\V1\Document\Entity>
*/
public function getEntities()
{
return $this->entities;
}
/**
* A list of entities detected on
* [Document.text][google.cloud.documentai.v1.Document.text]. For document
* shards, entities in this list may cross shard boundaries.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Entity entities = 7;</code>
* @param \Google\Cloud\DocumentAI\V1\Document\Entity[] $var
* @return $this
*/
public function setEntities($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Entity::class);
$this->entities = $arr;
return $this;
}
/**
* Placeholder. Relationship among
* [Document.entities][google.cloud.documentai.v1.Document.entities].
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8;</code>
* @return RepeatedField<\Google\Cloud\DocumentAI\V1\Document\EntityRelation>
*/
public function getEntityRelations()
{
return $this->entity_relations;
}
/**
* Placeholder. Relationship among
* [Document.entities][google.cloud.documentai.v1.Document.entities].
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.EntityRelation entity_relations = 8;</code>
* @param \Google\Cloud\DocumentAI\V1\Document\EntityRelation[] $var
* @return $this
*/
public function setEntityRelations($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\EntityRelation::class);
$this->entity_relations = $arr;
return $this;
}
/**
* Placeholder. A list of text corrections made to
* [Document.text][google.cloud.documentai.v1.Document.text]. This is usually
* used for annotating corrections to OCR mistakes. Text changes for a given
* revision may not overlap with each other.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14;</code>
* @return RepeatedField<\Google\Cloud\DocumentAI\V1\Document\TextChange>
*/
public function getTextChanges()
{
return $this->text_changes;
}
/**
* Placeholder. A list of text corrections made to
* [Document.text][google.cloud.documentai.v1.Document.text]. This is usually
* used for annotating corrections to OCR mistakes. Text changes for a given
* revision may not overlap with each other.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.TextChange text_changes = 14;</code>
* @param \Google\Cloud\DocumentAI\V1\Document\TextChange[] $var
* @return $this
*/
public function setTextChanges($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\TextChange::class);
$this->text_changes = $arr;
return $this;
}
/**
* 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.
*
* Generated from protobuf field <code>.google.cloud.documentai.v1.Document.ShardInfo shard_info = 9;</code>
* @return \Google\Cloud\DocumentAI\V1\Document\ShardInfo|null
*/
public function getShardInfo()
{
return $this->shard_info;
}
public function hasShardInfo()
{
return isset($this->shard_info);
}
public function clearShardInfo()
{
unset($this->shard_info);
}
/**
* 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.
*
* Generated from protobuf field <code>.google.cloud.documentai.v1.Document.ShardInfo shard_info = 9;</code>
* @param \Google\Cloud\DocumentAI\V1\Document\ShardInfo $var
* @return $this
*/
public function setShardInfo($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ShardInfo::class);
$this->shard_info = $var;
return $this;
}
/**
* Any error that occurred while processing this document.
*
* Generated from protobuf field <code>.google.rpc.Status error = 10;</code>
* @return \Google\Rpc\Status|null
*/
public function getError()
{
return $this->error;
}
public function hasError()
{
return isset($this->error);
}
public function clearError()
{
unset($this->error);
}
/**
* Any error that occurred while processing this document.
*
* Generated from protobuf field <code>.google.rpc.Status error = 10;</code>
* @param \Google\Rpc\Status $var
* @return $this
*/
public function setError($var)
{
GPBUtil::checkMessage($var, \Google\Rpc\Status::class);
$this->error = $var;
return $this;
}
/**
* Placeholder. Revision history of this document.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Revision revisions = 13;</code>
* @return RepeatedField<\Google\Cloud\DocumentAI\V1\Document\Revision>
*/
public function getRevisions()
{
return $this->revisions;
}
/**
* Placeholder. Revision history of this document.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.Revision revisions = 13;</code>
* @param \Google\Cloud\DocumentAI\V1\Document\Revision[] $var
* @return $this
*/
public function setRevisions($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\Revision::class);
$this->revisions = $arr;
return $this;
}
/**
* Parsed layout of the document.
*
* Generated from protobuf field <code>.google.cloud.documentai.v1.Document.DocumentLayout document_layout = 17;</code>
* @return \Google\Cloud\DocumentAI\V1\Document\DocumentLayout|null
*/
public function getDocumentLayout()
{
return $this->document_layout;
}
public function hasDocumentLayout()
{
return isset($this->document_layout);
}
public function clearDocumentLayout()
{
unset($this->document_layout);
}
/**
* Parsed layout of the document.
*
* Generated from protobuf field <code>.google.cloud.documentai.v1.Document.DocumentLayout document_layout = 17;</code>
* @param \Google\Cloud\DocumentAI\V1\Document\DocumentLayout $var
* @return $this
*/
public function setDocumentLayout($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\DocumentLayout::class);
$this->document_layout = $var;
return $this;
}
/**
* Document chunked based on chunking config.
*
* Generated from protobuf field <code>.google.cloud.documentai.v1.Document.ChunkedDocument chunked_document = 18;</code>
* @return \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument|null
*/
public function getChunkedDocument()
{
return $this->chunked_document;
}
public function hasChunkedDocument()
{
return isset($this->chunked_document);
}
public function clearChunkedDocument()
{
unset($this->chunked_document);
}
/**
* Document chunked based on chunking config.
*
* Generated from protobuf field <code>.google.cloud.documentai.v1.Document.ChunkedDocument chunked_document = 18;</code>
* @param \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument $var
* @return $this
*/
public function setChunkedDocument($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\ChunkedDocument::class);
$this->chunked_document = $var;
return $this;
}
/**
* Optional. The blob assets in this document. This is used to store the
* content of the inline blobs in this document, for example, image bytes,
* such that it can be referenced by other fields in the document via asset
* id.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.BlobAsset blob_assets = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
* @return RepeatedField<\Google\Cloud\DocumentAI\V1\Document\BlobAsset>
*/
public function getBlobAssets()
{
return $this->blob_assets;
}
/**
* Optional. The blob assets in this document. This is used to store the
* content of the inline blobs in this document, for example, image bytes,
* such that it can be referenced by other fields in the document via asset
* id.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.BlobAsset blob_assets = 19 [(.google.api.field_behavior) = OPTIONAL];</code>
* @param \Google\Cloud\DocumentAI\V1\Document\BlobAsset[] $var
* @return $this
*/
public function setBlobAssets($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\BlobAsset::class);
$this->blob_assets = $arr;
return $this;
}
/**
* The entity validation output for the document. This is the validation
* output for `document.entities` field.
*
* Generated from protobuf field <code>.google.cloud.documentai.v1.Document.EntityValidationOutput entity_validation_output = 21;</code>
* @return \Google\Cloud\DocumentAI\V1\Document\EntityValidationOutput|null
*/
public function getEntityValidationOutput()
{
return $this->entity_validation_output;
}
public function hasEntityValidationOutput()
{
return isset($this->entity_validation_output);
}
public function clearEntityValidationOutput()
{
unset($this->entity_validation_output);
}
/**
* The entity validation output for the document. This is the validation
* output for `document.entities` field.
*
* Generated from protobuf field <code>.google.cloud.documentai.v1.Document.EntityValidationOutput entity_validation_output = 21;</code>
* @param \Google\Cloud\DocumentAI\V1\Document\EntityValidationOutput $var
* @return $this
*/
public function setEntityValidationOutput($var)
{
GPBUtil::checkMessage($var, \Google\Cloud\DocumentAI\V1\Document\EntityValidationOutput::class);
$this->entity_validation_output = $var;
return $this;
}
/**
* A list of entity revisions. The entity revisions are appended to the
* document in the processing order. This field can be used for comparing the
* entity extraction results at different stages of the processing.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.EntitiesRevision entities_revisions = 22;</code>
* @return RepeatedField<\Google\Cloud\DocumentAI\V1\Document\EntitiesRevision>
*/
public function getEntitiesRevisions()
{
return $this->entities_revisions;
}
/**
* A list of entity revisions. The entity revisions are appended to the
* document in the processing order. This field can be used for comparing the
* entity extraction results at different stages of the processing.
*
* Generated from protobuf field <code>repeated .google.cloud.documentai.v1.Document.EntitiesRevision entities_revisions = 22;</code>
* @param \Google\Cloud\DocumentAI\V1\Document\EntitiesRevision[] $var
* @return $this
*/
public function setEntitiesRevisions($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\DocumentAI\V1\Document\EntitiesRevision::class);
$this->entities_revisions = $arr;
return $this;
}
/**
* The entity revision ID that `document.entities` field is based on.
* If this field is set and `entities_revisions` is not empty, the entities in
* `document.entities` field are the entities in the entity revision with this
* id and `document.entity_validation_output` field is the
* `entity_validation_output` field in this entity revision.
*
* Generated from protobuf field <code>string entities_revision_id = 23;</code>
* @return string
*/
public function getEntitiesRevisionId()
{
return $this->entities_revision_id;
}
/**
* The entity revision ID that `document.entities` field is based on.
* If this field is set and `entities_revisions` is not empty, the entities in
* `document.entities` field are the entities in the entity revision with this
* id and `document.entity_validation_output` field is the
* `entity_validation_output` field in this entity revision.
*
* Generated from protobuf field <code>string entities_revision_id = 23;</code>
* @param string $var
* @return $this
*/
public function setEntitiesRevisionId($var)
{
GPBUtil::checkString($var, True);
$this->entities_revision_id = $var;
return $this;
}
/**
* @return string
*/
public function getSource()
{
return $this->whichOneof("source");
}
}