document_versions
Creates, updates, deletes, gets or lists a document_versions resource.
Overview
| Name | document_versions |
| Type | Resource |
| Id | aws.workdocs.document_versions |
Fields
The following fields are returned by SELECT queries:
- get_document_version
- describe_document_versions
| Name | Datatype | Description |
|---|---|---|
custom_metadata | object | The custom metadata on the document version. |
metadata | object | The version metadata. |
| Name | Datatype | Description |
|---|---|---|
content_created_timestamp | string (date-time) | The timestamp when the content of the document was originally created. |
content_modified_timestamp | string (date-time) | The timestamp when the content of the document was modified. |
content_type | string | The content type of the document. |
created_timestamp | string (date-time) | The timestamp when the document was first uploaded. |
creator_id | string | The ID of the creator. (pattern: <code>[&\w+-.@]+</code>) |
id | string | The ID of the version. (pattern: <code>[\w+-.@]+</code>) |
modified_timestamp | string (date-time) | The timestamp when the document was last uploaded. |
name | string | The name of the version. (pattern: <code>[\u0020-\u202D\u202F-\uFFFF]+</code>) |
signature | string | The signature of the document. (pattern: <code>[&\w+-.@]+</code>) |
size | integer (int64) | The size of the document, in bytes. |
source | object | The source of the document. |
status | string | The status of the document. (INITIALIZED, ACTIVE) |
thumbnail | object | The thumbnail of the document. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get_document_version | select | document_id, version_id, region | Authentication, fields, includeCustomMetadata | Retrieves version metadata for the specified document. |
describe_document_versions | select | document_id, region | Authentication, marker, limit, include, fields | Retrieves the document versions for the specified document. By default, only active versions are returned. |
update_document_version | update | document_id, version_id, region | Authentication | Changes the status of the document version to ACTIVE. Amazon WorkDocs also sets its document container to ACTIVE. This is the last step in a document upload, after the client uploads the document to an S3-presigned URL returned by InitiateDocumentVersionUpload. |
delete_document_version | delete | document_id, version_id, deletePriorVersions, region | Authentication | Deletes a specific version of a document. |
restore_document_versions | exec | document_id, region | Authentication | Recovers a deleted version of an Amazon WorkDocs document. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
deletePriorVersions | boolean | Deletes all versions of a document prior to the current version. |
document_id | string | The ID of the document. |
region | string | AWS region (default: us-east-1) |
version_id | string | The ID of the version being deleted. |
Authentication | string | Amazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API. |
fields | string | Specify "SOURCE" to include initialized versions and a URL for the source document. |
include | string | A comma-separated list of values. Specify "INITIALIZED" to include incomplete versions. |
includeCustomMetadata | boolean | Set this to TRUE to include custom metadata in the response. |
limit | integer | The maximum number of versions to return with this call. |
marker | string | The marker for the next set of results. (You received this marker from a previous call.) |
SELECT examples
- get_document_version
- describe_document_versions
Retrieves version metadata for the specified document.
SELECT
custom_metadata,
metadata
FROM aws.workdocs.document_versions
WHERE document_id = '{{ document_id }}' -- required
AND version_id = '{{ version_id }}' -- required
AND region = '{{ region }}' -- required
AND Authentication = '{{ Authentication }}'
AND fields = '{{ fields }}'
AND includeCustomMetadata = '{{ includeCustomMetadata }}'
;
Retrieves the document versions for the specified document. By default, only active versions are returned.
SELECT
content_created_timestamp,
content_modified_timestamp,
content_type,
created_timestamp,
creator_id,
id,
modified_timestamp,
name,
signature,
size,
source,
status,
thumbnail
FROM aws.workdocs.document_versions
WHERE document_id = '{{ document_id }}' -- required
AND region = '{{ region }}' -- required
AND Authentication = '{{ Authentication }}'
AND marker = '{{ marker }}'
AND limit = '{{ limit }}'
AND include = '{{ include }}'
AND fields = '{{ fields }}'
;
UPDATE examples
- update_document_version
Changes the status of the document version to ACTIVE. Amazon WorkDocs also sets its document container to ACTIVE. This is the last step in a document upload, after the client uploads the document to an S3-presigned URL returned by InitiateDocumentVersionUpload.
UPDATE aws.workdocs.document_versions
SET
VersionStatus = '{{ VersionStatus }}'
WHERE
document_id = '{{ document_id }}' --required
AND version_id = '{{ version_id }}' --required
AND region = '{{ region }}' --required
AND Authentication = '{{ Authentication}}';
DELETE examples
- delete_document_version
Deletes a specific version of a document.
DELETE FROM aws.workdocs.document_versions
WHERE document_id = '{{ document_id }}' --required
AND version_id = '{{ version_id }}' --required
AND deletePriorVersions = '{{ deletePriorVersions }}' --required
AND region = '{{ region }}' --required
AND Authentication = '{{ Authentication }}'
;
Lifecycle Methods
- restore_document_versions
Recovers a deleted version of an Amazon WorkDocs document.
EXEC aws.workdocs.document_versions.restore_document_versions
@document_id='{{ document_id }}' --required,
@region='{{ region }}' --required,
@Authentication='{{ Authentication }}'
;