getDocument method
Retrieves details of a document.
May throw EntityNotExistsException.
May throw FailedDependencyException.
May throw InvalidArgumentException.
May throw InvalidPasswordException.
May throw ServiceUnavailableException.
May throw UnauthorizedOperationException.
May throw UnauthorizedResourceAccessException.
Parameter documentId :
The ID of the document.
Parameter authenticationToken :
Amazon WorkDocs authentication token. Not required when using Amazon Web
Services administrator credentials to access the API.
Parameter includeCustomMetadata :
Set this to TRUE to include custom metadata in the response.
Implementation
Future<GetDocumentResponse> getDocument({
required String documentId,
String? authenticationToken,
bool? includeCustomMetadata,
}) async {
final headers = <String, String>{
if (authenticationToken != null)
'Authentication': authenticationToken.toString(),
};
final $query = <String, List<String>>{
if (includeCustomMetadata != null)
'includeCustomMetadata': [includeCustomMetadata.toString()],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/api/v1/documents/${Uri.encodeComponent(documentId)}',
queryParams: $query,
headers: headers,
exceptionFnMap: _exceptionFns,
);
return GetDocumentResponse.fromJson(response);
}