abortDocumentVersionUpload method

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

Aborts the upload of the specified document version that was previously initiated by InitiateDocumentVersionUpload. The client should make this call only when it no longer intends to upload the document version, or fails to do so.

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

Parameter documentId : The ID of the document.

Parameter versionId : The ID of the version.

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

Implementation

Future<void> abortDocumentVersionUpload({
  required String documentId,
  required String versionId,
  String? authenticationToken,
}) 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,
  );
  final headers = <String, String>{
    if (authenticationToken != null)
      'Authentication': authenticationToken.toString(),
  };
  await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/api/v1/documents/${Uri.encodeComponent(documentId)}/versions/${Uri.encodeComponent(versionId)}',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}