listAuditMitigationActionsTasks method

Future<ListAuditMitigationActionsTasksResponse> listAuditMitigationActionsTasks({
  1. required DateTime endTime,
  2. required DateTime startTime,
  3. String? auditTaskId,
  4. String? findingId,
  5. int? maxResults,
  6. String? nextToken,
  7. AuditMitigationActionsTaskStatus? taskStatus,
})

Gets a list of audit mitigation action tasks that match the specified filters.

May throw InvalidRequestException. May throw ThrottlingException. May throw InternalFailureException.

Parameter endTime : Specify this filter to limit results to tasks that were completed or canceled on or before a specific date and time.

Parameter startTime : Specify this filter to limit results to tasks that began on or after a specific date and time.

Parameter auditTaskId : Specify this filter to limit results to tasks that were applied to results for a specific audit.

Parameter findingId : Specify this filter to limit results to tasks that were applied to a specific audit finding.

Parameter maxResults : The maximum number of results to return at one time. The default is 25.

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

Parameter taskStatus : Specify this filter to limit results to tasks that are in a specific state.

Implementation

Future<ListAuditMitigationActionsTasksResponse>
    listAuditMitigationActionsTasks({
  required DateTime endTime,
  required DateTime startTime,
  String? auditTaskId,
  String? findingId,
  int? maxResults,
  String? nextToken,
  AuditMitigationActionsTaskStatus? taskStatus,
}) async {
  ArgumentError.checkNotNull(endTime, 'endTime');
  ArgumentError.checkNotNull(startTime, 'startTime');
  _s.validateStringLength(
    'auditTaskId',
    auditTaskId,
    1,
    40,
  );
  _s.validateStringLength(
    'findingId',
    findingId,
    1,
    128,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  final $query = <String, List<String>>{
    'endTime': [_s.iso8601ToJson(endTime).toString()],
    'startTime': [_s.iso8601ToJson(startTime).toString()],
    if (auditTaskId != null) 'auditTaskId': [auditTaskId],
    if (findingId != null) 'findingId': [findingId],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (taskStatus != null) 'taskStatus': [taskStatus.toValue()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/audit/mitigationactions/tasks',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListAuditMitigationActionsTasksResponse.fromJson(response);
}