listActiveViolations method

Future<ListActiveViolationsResponse> listActiveViolations({
  1. BehaviorCriteriaType? behaviorCriteriaType,
  2. bool? listSuppressedAlerts,
  3. int? maxResults,
  4. String? nextToken,
  5. String? securityProfileName,
  6. String? thingName,
})

Lists the active violations for a given Device Defender security profile.

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

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 : The name of the Device Defender security profile for which violations are listed.

Parameter thingName : The name of the thing whose active violations are listed.

Implementation

Future<ListActiveViolationsResponse> listActiveViolations({
  BehaviorCriteriaType? behaviorCriteriaType,
  bool? listSuppressedAlerts,
  int? maxResults,
  String? nextToken,
  String? securityProfileName,
  String? thingName,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  _s.validateStringLength(
    'securityProfileName',
    securityProfileName,
    1,
    128,
  );
  _s.validateStringLength(
    'thingName',
    thingName,
    1,
    128,
  );
  final $query = <String, List<String>>{
    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: '/active-violations',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListActiveViolationsResponse.fromJson(response);
}