batchGetDocumentStatus method

Future<BatchGetDocumentStatusResponse> batchGetDocumentStatus({
  1. required List<DocumentInfo> documentInfoList,
  2. required String indexId,
})

Returns the indexing status for one or more documents submitted with the BatchPutDocument API.

When you use the BatchPutDocument API, documents are indexed asynchronously. You can use the BatchGetDocumentStatus API to get the current status of a list of documents so that you can determine if they have been successfully indexed.

You can also use the BatchGetDocumentStatus API to check the status of the BatchDeleteDocument API. When a document is deleted from the index, Amazon Kendra returns NOT_FOUND as the status.

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

Parameter documentInfoList : A list of DocumentInfo objects that identify the documents for which to get the status. You identify the documents by their document ID and optional attributes.

Parameter indexId : The identifier of the index to add documents to. The index ID is returned by the CreateIndex API.

Implementation

Future<BatchGetDocumentStatusResponse> batchGetDocumentStatus({
  required List<DocumentInfo> documentInfoList,
  required String indexId,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSKendraFrontendService.BatchGetDocumentStatus'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'DocumentInfoList': documentInfoList,
      'IndexId': indexId,
    },
  );

  return BatchGetDocumentStatusResponse.fromJson(jsonResponse.body);
}