listDetectors method
Lists detectors (the instances of a detector model).
May throw InternalFailureException.
May throw InvalidRequestException.
May throw ResourceNotFoundException.
May throw ServiceUnavailableException.
May throw ThrottlingException.
Parameter detectorModelName :
The name of the detector model whose detectors (instances) are listed.
Parameter maxResults :
The maximum number of results to be returned per request.
Parameter nextToken :
The token that you can use to return the next set of results.
Parameter stateName :
A filter that limits results to those detectors (instances) in the given
state.
Implementation
Future<ListDetectorsResponse> listDetectors({
required String detectorModelName,
int? maxResults,
String? nextToken,
String? stateName,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
250,
);
final $query = <String, List<String>>{
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
if (stateName != null) 'stateName': [stateName],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/detectors/${Uri.encodeComponent(detectorModelName)}',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListDetectorsResponse.fromJson(response);
}