updateDocumentVersion method
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.
May throw ConcurrentModificationException.
May throw EntityNotExistsException.
May throw FailedDependencyException.
May throw InvalidOperationException.
May throw ProhibitedStateException.
May throw ServiceUnavailableException.
May throw UnauthorizedOperationException.
May throw UnauthorizedResourceAccessException.
Parameter documentId :
The ID of the document.
Parameter versionId :
The version ID of the document.
Parameter authenticationToken :
Amazon WorkDocs authentication token. Not required when using Amazon Web
Services administrator credentials to access the API.
Parameter versionStatus :
The status of the version.
Implementation
Future<void> updateDocumentVersion({
required String documentId,
required String versionId,
String? authenticationToken,
DocumentVersionStatus? versionStatus,
}) async {
final headers = <String, String>{
if (authenticationToken != null)
'Authentication': authenticationToken.toString(),
};
final $payload = <String, dynamic>{
if (versionStatus != null) 'VersionStatus': versionStatus.value,
};
await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri:
'/api/v1/documents/${Uri.encodeComponent(documentId)}/versions/${Uri.encodeComponent(versionId)}',
headers: headers,
exceptionFnMap: _exceptionFns,
);
}