describeImportTaskBatches method

Future<DescribeImportTaskBatchesResponse> describeImportTaskBatches({
  1. required String importId,
  2. List<ImportStatus>? batchImportStatus,
  3. int? limit,
  4. String? nextToken,
})

Gets detailed information about the individual batches within an import task, including their status and any error messages. For CloudTrail Event Data Store sources, a batch refers to a subset of stored events grouped by their eventTime.

May throw AccessDeniedException. May throw InvalidOperationException. May throw InvalidParameterException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter importId : The ID of the import task to get batch information for.

Parameter batchImportStatus : Optional filter to list import batches by their status. Accepts multiple status values: IN_PROGRESS, CANCELLED, COMPLETED and FAILED.

Parameter limit : The maximum number of import batches to return in the response. Default: 10

Parameter nextToken : The pagination token for the next set of results.

Implementation

Future<DescribeImportTaskBatchesResponse> describeImportTaskBatches({
  required String importId,
  List<ImportStatus>? batchImportStatus,
  int? limit,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'limit',
    limit,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Logs_20140328.DescribeImportTaskBatches'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'importId': importId,
      if (batchImportStatus != null)
        'batchImportStatus': batchImportStatus.map((e) => e.value).toList(),
      if (limit != null) 'limit': limit,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return DescribeImportTaskBatchesResponse.fromJson(jsonResponse.body);
}