getDocumentVersion method
Retrieves version metadata for the specified document.
May throw EntityNotExistsException.
May throw FailedDependencyException.
May throw InvalidPasswordException.
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 fields :
A comma-separated list of values. Specify "SOURCE" to include a URL for
the source document.
Parameter includeCustomMetadata :
Set this to TRUE to include custom metadata in the response.
Implementation
Future<GetDocumentVersionResponse> getDocumentVersion({
required String documentId,
required String versionId,
String? authenticationToken,
String? fields,
bool? includeCustomMetadata,
}) async {
final headers = <String, String>{
if (authenticationToken != null)
'Authentication': authenticationToken.toString(),
};
final $query = <String, List<String>>{
if (fields != null) 'fields': [fields],
if (includeCustomMetadata != null)
'includeCustomMetadata': [includeCustomMetadata.toString()],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri:
'/api/v1/documents/${Uri.encodeComponent(documentId)}/versions/${Uri.encodeComponent(versionId)}',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
return GetDocumentVersionResponse.fromJson(response);
}