deleteDocumentVersion method

Future<void> deleteDocumentVersion({
  1. required bool deletePriorVersions,
  2. required String documentId,
  3. required String versionId,
  4. String? authenticationToken,
})

Deletes a specific version of a document.

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

Parameter deletePriorVersions : Deletes all versions of a document prior to the current version.

Parameter documentId : The ID of the document associated with the version being deleted.

Parameter versionId : The ID of the version being deleted.

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

Implementation

Future<void> deleteDocumentVersion({
  required bool deletePriorVersions,
  required String documentId,
  required String versionId,
  String? authenticationToken,
}) async {
  final headers = <String, String>{
    if (authenticationToken != null)
      'Authentication': authenticationToken.toString(),
  };
  final $query = <String, List<String>>{
    'deletePriorVersions': [deletePriorVersions.toString()],
  };
  await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/api/v1/documentVersions/${Uri.encodeComponent(documentId)}/versions/${Uri.encodeComponent(versionId)}',
    queryParams: $query,
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}