Skip to main content

document_versions

Creates, updates, deletes, gets or lists a document_versions resource.

Overview

Namedocument_versions
TypeResource
Idaws.workdocs.document_versions

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
custom_metadataobjectThe custom metadata on the document version.
metadataobjectThe version metadata.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_document_versionselectdocument_id, version_id, regionAuthentication, fields, includeCustomMetadataRetrieves version metadata for the specified document.
describe_document_versionsselectdocument_id, regionAuthentication, marker, limit, include, fieldsRetrieves the document versions for the specified document. By default, only active versions are returned.
update_document_versionupdatedocument_id, version_id, regionAuthenticationChanges 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_versiondeletedocument_id, version_id, deletePriorVersions, regionAuthenticationDeletes a specific version of a document.
restore_document_versionsexecdocument_id, regionAuthenticationRecovers 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.

NameDatatypeDescription
deletePriorVersionsbooleanDeletes all versions of a document prior to the current version.
document_idstringThe ID of the document.
regionstringAWS region (default: us-east-1)
version_idstringThe ID of the version being deleted.
AuthenticationstringAmazon WorkDocs authentication token. Not required when using Amazon Web Services administrator credentials to access the API.
fieldsstringSpecify "SOURCE" to include initialized versions and a URL for the source document.
includestringA comma-separated list of values. Specify "INITIALIZED" to include incomplete versions.
includeCustomMetadatabooleanSet this to TRUE to include custom metadata in the response.
limitintegerThe maximum number of versions to return with this call.
markerstringThe marker for the next set of results. (You received this marker from a previous call.)

SELECT examples

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 }}'
;

UPDATE examples

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

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

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 }}'
;