listViolationEvents method
Lists the Device Defender security profile violations discovered during the given time period. You can use filters to limit the results to those alerts issued for a particular security profile, behavior, or thing (device).
May throw InvalidRequestException. May throw ThrottlingException. May throw InternalFailureException.
Parameter endTime
:
The end time for the alerts to be listed.
Parameter startTime
:
The start time for the alerts to be listed.
Parameter behaviorCriteriaType
:
The criteria for a behavior.
Parameter listSuppressedAlerts
:
A list of all suppressed alerts.
Parameter maxResults
:
The maximum number of results to return at one time.
Parameter nextToken
:
The token for the next set of results.
Parameter securityProfileName
:
A filter to limit results to those alerts generated by the specified
security profile.
Parameter thingName
:
A filter to limit results to those alerts caused by the specified thing.
Implementation
Future<ListViolationEventsResponse> listViolationEvents({
required DateTime endTime,
required DateTime startTime,
BehaviorCriteriaType? behaviorCriteriaType,
bool? listSuppressedAlerts,
int? maxResults,
String? nextToken,
String? securityProfileName,
String? thingName,
}) async {
ArgumentError.checkNotNull(endTime, 'endTime');
ArgumentError.checkNotNull(startTime, 'startTime');
_s.validateNumRange(
'maxResults',
maxResults,
1,
250,
);
_s.validateStringLength(
'securityProfileName',
securityProfileName,
1,
128,
);
_s.validateStringLength(
'thingName',
thingName,
1,
128,
);
final $query = <String, List<String>>{
'endTime': [_s.iso8601ToJson(endTime).toString()],
'startTime': [_s.iso8601ToJson(startTime).toString()],
if (behaviorCriteriaType != null)
'behaviorCriteriaType': [behaviorCriteriaType.toValue()],
if (listSuppressedAlerts != null)
'listSuppressedAlerts': [listSuppressedAlerts.toString()],
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
if (securityProfileName != null)
'securityProfileName': [securityProfileName],
if (thingName != null) 'thingName': [thingName],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/violation-events',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListViolationEventsResponse.fromJson(response);
}