describeImportTasks method

Future<DescribeImportTasksResponse> describeImportTasks({
  1. String? importId,
  2. String? importSourceArn,
  3. ImportStatus? importStatus,
  4. int? limit,
  5. String? nextToken,
})

Lists and describes import tasks, with optional filtering by import status and source ARN.

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

Parameter importId : Optional filter to describe a specific import task by its ID.

Parameter importSourceArn : Optional filter to list imports from a specific source

Parameter importStatus : Optional filter to list imports by their status. Valid values are IN_PROGRESS, CANCELLED, COMPLETED and FAILED.

Parameter limit : The maximum number of import tasks to return in the response. Default: 50

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

Implementation

Future<DescribeImportTasksResponse> describeImportTasks({
  String? importId,
  String? importSourceArn,
  ImportStatus? importStatus,
  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.DescribeImportTasks'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (importId != null) 'importId': importId,
      if (importSourceArn != null) 'importSourceArn': importSourceArn,
      if (importStatus != null) 'importStatus': importStatus.value,
      if (limit != null) 'limit': limit,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return DescribeImportTasksResponse.fromJson(jsonResponse.body);
}