batchDeleteDocument method

Future<BatchDeleteDocumentResponse> batchDeleteDocument({
  1. required String applicationId,
  2. required List<DeleteDocument> documents,
  3. required String indexId,
  4. String? dataSourceSyncId,
})

Asynchronously deletes one or more documents added using the BatchPutDocument API from an Amazon Q Business index.

You can see the progress of the deletion, and any error messages related to the process, by using CloudWatch.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter applicationId : The identifier of the Amazon Q Business application.

Parameter documents : Documents deleted from the Amazon Q Business index.

Parameter indexId : The identifier of the Amazon Q Business index that contains the documents to delete.

Parameter dataSourceSyncId : The identifier of the data source sync during which the documents were deleted.

Implementation

Future<BatchDeleteDocumentResponse> batchDeleteDocument({
  required String applicationId,
  required List<DeleteDocument> documents,
  required String indexId,
  String? dataSourceSyncId,
}) async {
  final $payload = <String, dynamic>{
    'documents': documents,
    if (dataSourceSyncId != null) 'dataSourceSyncId': dataSourceSyncId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/applications/${Uri.encodeComponent(applicationId)}/indices/${Uri.encodeComponent(indexId)}/documents/delete',
    exceptionFnMap: _exceptionFns,
  );
  return BatchDeleteDocumentResponse.fromJson(response);
}