listDetectorModelVersions method

Future<ListDetectorModelVersionsResponse> listDetectorModelVersions({
  1. required String detectorModelName,
  2. int? maxResults,
  3. String? nextToken,
})

Lists all the versions of a detector model. Only the metadata associated with each detector model version is returned.

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

Parameter detectorModelName : The name of the detector model whose versions are returned.

Parameter maxResults : The maximum number of results to return at one time.

Parameter nextToken : The token for the next set of results.

Implementation

Future<ListDetectorModelVersionsResponse> listDetectorModelVersions({
  required String detectorModelName,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(detectorModelName, 'detectorModelName');
  _s.validateStringLength(
    'detectorModelName',
    detectorModelName,
    1,
    128,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    250,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri:
        '/detector-models/${Uri.encodeComponent(detectorModelName)}/versions',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListDetectorModelVersionsResponse.fromJson(response);
}