updateDocument method
Updates the specified attributes of a document. The user must have access to both the document and its parent folder, if applicable.
May throw ConcurrentModificationException.
May throw ConflictingOperationException.
May throw EntityAlreadyExistsException.
May throw EntityNotExistsException.
May throw FailedDependencyException.
May throw LimitExceededException.
May throw ProhibitedStateException.
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 name :
The name of the document.
Parameter parentFolderId :
The ID of the parent folder.
Parameter resourceState :
The resource state of the document. Only ACTIVE and RECYCLED are
supported.
Implementation
Future<void> updateDocument({
required String documentId,
String? authenticationToken,
String? name,
String? parentFolderId,
ResourceStateType? resourceState,
}) async {
final headers = <String, String>{
if (authenticationToken != null)
'Authentication': authenticationToken.toString(),
};
final $payload = <String, dynamic>{
if (name != null) 'Name': name,
if (parentFolderId != null) 'ParentFolderId': parentFolderId,
if (resourceState != null) 'ResourceState': resourceState.value,
};
await _protocol.send(
payload: $payload,
method: 'PATCH',
requestUri: '/api/v1/documents/${Uri.encodeComponent(documentId)}',
headers: headers,
exceptionFnMap: _exceptionFns,
);
}