getDocumentVersion method
Retrieves version metadata for the specified document.
May throw EntityNotExistsException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException. May throw FailedDependencyException. May throw ServiceUnavailableException. May throw ProhibitedStateException. May throw InvalidPasswordException.
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 AWS
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 {
ArgumentError.checkNotNull(documentId, 'documentId');
_s.validateStringLength(
'documentId',
documentId,
1,
128,
isRequired: true,
);
ArgumentError.checkNotNull(versionId, 'versionId');
_s.validateStringLength(
'versionId',
versionId,
1,
128,
isRequired: true,
);
_s.validateStringLength(
'authenticationToken',
authenticationToken,
1,
8199,
);
_s.validateStringLength(
'fields',
fields,
1,
256,
);
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);
}