# Cloud Document AI v1 API - Class Document (3.25.0)

3.25.0 (latest) 3.24.0 3.23.0 3.22.0 3.21.0 3.20.0 3.19.0 3.18.0 3.17.0 3.16.0 3.15.0 3.14.0 3.13.0 3.12.0 3.11.0 3.10.0 3.9.0 3.8.0 3.7.0 3.6.0 3.5.0 3.4.0 3.3.0 3.2.0 3.1.0 3.0.0 2.0.0 1.5.0 1.4.0 1.3.0 1.2.0 1.1.0 1.0.0

    public sealed class Document : IMessage<Document>, IEquatable<Document>, IDeepCloneable<Document>, IBufferMessage, IMessage

Reference documentation and code samples for the Cloud Document AI v1 API class 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.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> Document

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[Document](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[Document](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[Document](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.DocumentAI.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1)

## Assembly

Google.Cloud.DocumentAI.V1.dll

## Constructors

### Document()

    public Document()

### Document(Document)

    public Document(Document other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document` |

## Properties

### BlobAssets

    public RepeatedField<Document.Types.BlobAsset> BlobAssets { get; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Types.BlobAsset` |   |

### ChunkedDocument

    public Document.Types.ChunkedDocument ChunkedDocument { get; set; }

Document chunked based on chunking config.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Types.ChunkedDocument` |   |

### Content

    public ByteString Content { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.ByteString.html` |   |

### Docid

    public string Docid { get; set; }

Optional. An internal identifier for document. Should be loggable (no PII).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### DocumentLayout

    public Document.Types.DocumentLayout DocumentLayout { get; set; }

Parsed layout of the document.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Types.DocumentLayout` |   |

### Entities

    public RepeatedField<Document.Types.Entity> Entities { get; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Types.Entity` |   |

### EntitiesRevisionId

    public string EntitiesRevisionId { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### EntitiesRevisions

    public RepeatedField<Document.Types.EntitiesRevision> EntitiesRevisions { get; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Types.EntitiesRevision` |   |

### EntityRelations

    public RepeatedField<Document.Types.EntityRelation> EntityRelations { get; }

Placeholder. Relationship among
\[Document.entities\]\[google.cloud.documentai.v1.Document.entities\].

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Types.EntityRelation` |   |

### EntityValidationOutput

    public Document.Types.EntityValidationOutput EntityValidationOutput { get; set; }

The entity validation output for the document. This is the validation
output for `document.entities` field.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Types.EntityValidationOutput` |   |

### Error

    public Status Error { get; set; }

Any error that occurred while processing this document.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Api.CommonProtos/latest/Google.Rpc.Status.html` |   |

### HasContent

    public bool HasContent { get; }

Gets whether the "content" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### HasUri

    public bool HasUri { get; }

Gets whether the "uri" field is set

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.boolean` |   |

### MimeType

    public string MimeType { get; set; }

An IANA published [media type (MIME
type)](https://www.iana.org/assignments/media-types/media-types.xhtml).

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### Pages

    public RepeatedField<Document.Types.Page> Pages { get; }

Visual page layout for the \[Document\]\[google.cloud.documentai.v1.Document\].

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Types.Page` |   |

### Revisions

    public RepeatedField<Document.Types.Revision> Revisions { get; }

Placeholder. Revision history of this document.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Types.Revision` |   |

### ShardInfo

    public Document.Types.ShardInfo ShardInfo { get; set; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Types.ShardInfo` |   |

### SourceCase

    public Document.SourceOneofCase SourceCase { get; }

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.SourceOneofCase` |   |

### Text

    public string Text { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |

### TextChanges

    public RepeatedField<Document.Types.TextChange> TextChanges { get; }

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.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Types.TextChange` |   |

### TextStyles

    [Obsolete]
    public RepeatedField<Document.Types.Style> TextStyles { get; }

Styles for the \[Document.text\]\[google.cloud.documentai.v1.Document.text\].

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Documenthttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.DocumentAI.V1/latest/Google.Cloud.DocumentAI.V1.Document.Types.Style` |   |

### Uri

    public string Uri { get; set; }

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

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.string` |   |