listAuditFindings method

Future<ListAuditFindingsResponse> listAuditFindings({
  1. String? checkName,
  2. DateTime? endTime,
  3. bool? listSuppressedFindings,
  4. int? maxResults,
  5. String? nextToken,
  6. ResourceIdentifier? resourceIdentifier,
  7. DateTime? startTime,
  8. String? taskId,
})

Lists the findings (results) of a Device Defender audit or of the audits performed during a specified time period. (Findings are retained for 90 days.)

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

Parameter checkName : A filter to limit results to the findings for the specified audit check.

Parameter endTime : A filter to limit results to those found before the specified time. You must specify either the startTime and endTime or the taskId, but not both.

Parameter listSuppressedFindings : Boolean flag indicating whether only the suppressed findings or the unsuppressed findings should be listed. If this parameter isn't provided, the response will list both suppressed and unsuppressed findings.

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 resourceIdentifier : Information identifying the noncompliant resource.

Parameter startTime : A filter to limit results to those found after the specified time. You must specify either the startTime and endTime or the taskId, but not both.

Parameter taskId : A filter to limit results to the audit with the specified ID. You must specify either the taskId or the startTime and endTime, but not both.

Implementation

Future<ListAuditFindingsResponse> listAuditFindings({
  String? checkName,
  DateTime? endTime,
  bool? listSuppressedFindings,
  int? maxResults,
  String? nextToken,
  ResourceIdentifier? resourceIdentifier,
  DateTime? startTime,
  String? taskId,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  _s.validateStringLength(
    'taskId',
    taskId,
    1,
    40,
  );
  final $payload = <String, dynamic>{
    if (checkName != null) 'checkName': checkName,
    if (endTime != null) 'endTime': unixTimestampToJson(endTime),
    if (listSuppressedFindings != null)
      'listSuppressedFindings': listSuppressedFindings,
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
    if (resourceIdentifier != null) 'resourceIdentifier': resourceIdentifier,
    if (startTime != null) 'startTime': unixTimestampToJson(startTime),
    if (taskId != null) 'taskId': taskId,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/audit/findings',
    exceptionFnMap: _exceptionFns,
  );
  return ListAuditFindingsResponse.fromJson(response);
}