deleteDocument method

Future<void> deleteDocument({
  1. required String documentId,
  2. String? authenticationToken,
})

Permanently deletes the specified document and its associated metadata.

May throw EntityNotExistsException. May throw ProhibitedStateException. May throw ConflictingOperationException. May throw ConcurrentModificationException. May throw UnauthorizedOperationException. May throw UnauthorizedResourceAccessException. May throw FailedDependencyException. May throw ServiceUnavailableException.

Parameter documentId : The ID of the document.

Parameter authenticationToken : Amazon WorkDocs authentication token. Not required when using AWS administrator credentials to access the API.

Implementation

Future<void> deleteDocument({
  required String documentId,
  String? authenticationToken,
}) async {
  ArgumentError.checkNotNull(documentId, 'documentId');
  _s.validateStringLength(
    'documentId',
    documentId,
    1,
    128,
    isRequired: true,
  );
  _s.validateStringLength(
    'authenticationToken',
    authenticationToken,
    1,
    8199,
  );
  final headers = <String, String>{
    if (authenticationToken != null)
      'Authentication': authenticationToken.toString(),
  };
  await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/api/v1/documents/${Uri.encodeComponent(documentId)}',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}