listLogAnomalyDetectors method

Future<ListLogAnomalyDetectorsResponse> listLogAnomalyDetectors({
  1. String? filterLogGroupArn,
  2. int? limit,
  3. String? nextToken,
})

Retrieves a list of the log anomaly detectors in the account.

May throw InvalidParameterException. May throw OperationAbortedException. May throw ResourceNotFoundException. May throw ServiceUnavailableException.

Parameter filterLogGroupArn : Use this to optionally filter the results to only include anomaly detectors that are associated with the specified log group.

Parameter limit : The maximum number of items to return. If you don't specify a value, the default maximum value of 50 items is used.

Implementation

Future<ListLogAnomalyDetectorsResponse> listLogAnomalyDetectors({
  String? filterLogGroupArn,
  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.ListLogAnomalyDetectors'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (filterLogGroupArn != null) 'filterLogGroupArn': filterLogGroupArn,
      if (limit != null) 'limit': limit,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListLogAnomalyDetectorsResponse.fromJson(jsonResponse.body);
}