NAME
Google::Cloud::Documentai::V1::Document - Compiled Protocol Buffers messages for google/cloud/documentai/v1/document.proto
SYNOPSIS
use Google::Cloud::Documentai::V1::Document;
my $msg = Google::Cloud::Documentai::V1::Document::Document->new({
uri => $uri,
content => $content,
docid => $docid,
mime_type => $mime_type,
});
# Read or update a field
my $val = $msg->uri();
# Binary wire-format roundtrip
my $bytes = $msg->serialize();
my $decoded = Google::Cloud::Documentai::V1::Document::Document->parse($bytes);
# Canonical ProtoJSON
my $json = $msg->to_json();
DESCRIPTION
Auto-generated Protobuf message classes compiled from google/cloud/documentai/v1/document.proto. All message classes inherit from Protobuf::Message and support new(), serialize(), parse(), to_json(), from_json(), to_text(), and to_perl().
MESSAGES
Google::Cloud::Documentai::V1::Document::Document
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.
Inherits from Protobuf::Message.
Accessors
$msg->uri()/$msg->uri($value)Type:
StringOptional. 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).
$msg->content()/$msg->content($value)Type:
BytesOptional. 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.
$msg->docid()/$msg->docid($value)Type:
StringOptional. An internal identifier for document. Should be loggable (no PII).
$msg->mime_type()/$msg->mime_type($value)Type:
StringAn IANA published [media type (MIME type)](https://www.iana.org/assignments/media-types/media-types.xhtml).
$msg->text()/$msg->text($value)Type:
StringOptional. UTF-8 encoded text in reading order from the document.
$msg->text_styles()/$msg->text_styles($value)Type:
Message(Google::Cloud::Documentai::V1::Document::Document::Style)Styles for the [Document.text][google.cloud.documentai.v1.Document.text].
$msg->pages()/$msg->pages($value)Type:
Message(Google::Cloud::Documentai::V1::Document::Document::Page)Visual page layout for the [Document][google.cloud.documentai.v1.Document].
$msg->entities()/$msg->entities($value)Type:
Message(Google::Cloud::Documentai::V1::Document::Document::Entity)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.
$msg->entity_relations()/$msg->entity_relations($value)Type:
Message(Google::Cloud::Documentai::V1::Document::Document::EntityRelation)Placeholder. Relationship among [Document.entities][google.cloud.documentai.v1.Document.entities].
$msg->text_changes()/$msg->text_changes($value)Type:
Message(Google::Cloud::Documentai::V1::Document::Document::TextChange)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.
$msg->shard_info()/$msg->shard_info($value)Type:
Message(Google::Cloud::Documentai::V1::Document::Document::ShardInfo)Information about the sharding if this document is sharded part of a larger document. If the document is not sharded, this message is not specified.
$msg->error()/$msg->error($value)Type:
Message(Google::Rpc::Status::Status)Any error that occurred while processing this document.
$msg->revisions()/$msg->revisions($value)Type:
Message(Google::Cloud::Documentai::V1::Document::Document::Revision)Placeholder. Revision history of this document.
$msg->document_layout()/$msg->document_layout($value)Type:
Message(Google::Cloud::Documentai::V1::Document::Document::DocumentLayout)Parsed layout of the document.
$msg->chunked_document()/$msg->chunked_document($value)Type:
Message(Google::Cloud::Documentai::V1::Document::Document::ChunkedDocument)Document chunked based on chunking config.
$msg->blob_assets()/$msg->blob_assets($value)Type:
Message(Google::Cloud::Documentai::V1::Document::Document::BlobAsset)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.
$msg->entity_validation_output()/$msg->entity_validation_output($value)Type:
Message(Google::Cloud::Documentai::V1::Document::Document::EntityValidationOutput)The entity validation output for the document. This is the validation output for `document.entities` field.
$msg->entities_revisions()/$msg->entities_revisions($value)Type:
Message(Google::Cloud::Documentai::V1::Document::Document::EntitiesRevision)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.
$msg->entities_revision_id()/$msg->entities_revision_id($value)Type:
StringThe 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.
SEE ALSO
Protobuf, Protobuf::Message, Google::Cloud::Documentai::V1::Document::Types, https://protobuf.dev/
LICENSE AND COPYRIGHT
Copyright (C) 2026 Google LLC
This program is released under the Apache 2.0 license.