listModels method

Future<ListModelsResponse> listModels({
  1. String? datasetNameBeginsWith,
  2. int? maxResults,
  3. String? modelNameBeginsWith,
  4. String? nextToken,
  5. ModelStatus? status,
})

Generates a list of all models in the account, including model name and ARN, dataset, and status.

May throw AccessDeniedException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter datasetNameBeginsWith : The beginning of the name of the dataset of the machine learning models to be listed.

Parameter maxResults : Specifies the maximum number of machine learning models to list.

Parameter modelNameBeginsWith : The beginning of the name of the machine learning models being listed.

Parameter nextToken : An opaque pagination token indicating where to continue the listing of machine learning models.

Parameter status : The status of the machine learning model.

Implementation

Future<ListModelsResponse> listModels({
  String? datasetNameBeginsWith,
  int? maxResults,
  String? modelNameBeginsWith,
  String? nextToken,
  ModelStatus? status,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    500,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'AWSLookoutEquipmentFrontendService.ListModels'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (datasetNameBeginsWith != null)
        'DatasetNameBeginsWith': datasetNameBeginsWith,
      if (maxResults != null) 'MaxResults': maxResults,
      if (modelNameBeginsWith != null)
        'ModelNameBeginsWith': modelNameBeginsWith,
      if (nextToken != null) 'NextToken': nextToken,
      if (status != null) 'Status': status.value,
    },
  );

  return ListModelsResponse.fromJson(jsonResponse.body);
}