# DocumentLink

A document-link between source and target document.

| JSON representation |
|---|
| ``` { "name": string, "sourceDocumentReference": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/DocumentLink#DocumentReference`) }, "targetDocumentReference": { object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/DocumentLink#DocumentReference`) }, "description": string, "updateTime": string, "createTime": string, "state": enum (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/DocumentLink#State`) } ``` |

| Fields ||
|---|---|
| `name` | `string` name of this document-link. It is required that the parent derived form the name to be consistent with the source document reference. Otherwise an exception will be thrown. Format: projects/{projectNumber}/locations/{location}/documents/{source_document_id}/documentLinks/{document_link_id}. |
| `sourceDocumentReference` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/DocumentLink#DocumentReference`)`` Document references of the source document. |
| `targetDocumentReference` | ``object (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/DocumentLink#DocumentReference`)`` Document references of the target document. |
| `description` | `string` description of this document-link. |
| `updateTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. The time when the documentLink is last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `createTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. The time when the documentLink is created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `state` | ``enum (`https://docs.cloud.google.com/document-warehouse/docs/reference/rest/v1/DocumentLink#State`)`` The state of the documentlink. If target node has been deleted, the link is marked as invalid. Removing a source node will result in removal of all associated links. |

## DocumentReference

References to the documents.

| JSON representation |
|---|
| ``` { "documentName": string, "displayName": string, "snippet": string, "documentIsFolder": boolean, "updateTime": string, "createTime": string, "deleteTime": string, "documentIsRetentionFolder": boolean, "documentIsLegalHoldFolder": boolean } ``` |

| Fields ||
|---|---|
| `documentName` | `string` Required. name of the referenced document. |
| `displayName` | `string` displayName of the referenced document; this name does not need to be consistent to the displayName in the Document proto, depending on the ACL constraint. |
| `snippet` | `string` Stores the subset of the referenced document's content. This is useful to allow user peek the information of the referenced document. |
| `documentIsFolder` | `boolean` The document type of the document being referenced. |
| `updateTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. The time when the document is last updated. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `createTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. The time when the document is created. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `deleteTime` | ``string (`https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#google.protobuf.Timestamp` format)`` Output only. The time when the document is deleted. A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: `"2014-10-02T15:01:23Z"` and `"2014-10-02T15:01:23.045123456Z"`. |
| `documentIsRetentionFolder` | `boolean` Document is a folder with retention policy. |
| `documentIsLegalHoldFolder` | `boolean` Document is a folder with legal hold. |

## State

The state of a document-link.

| Enums ||
|---|---|
| `STATE_UNSPECIFIED` | Unknown state of documentlink. |
| `ACTIVE` | The documentlink has both source and target documents detected. |
| `SOFT_DELETED` | target document is deleted, and mark the documentlink as soft-deleted. |