listModelVersions method
Generates a list of all model versions for a given model, including the
model version, model version ARN, and status. To list a subset of
versions, use the MaxModelVersion and
MinModelVersion fields.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
May throw ValidationException.
Parameter modelName :
Then name of the machine learning model for which the model versions are
to be listed.
Parameter createdAtEndTime :
Filter results to return all the model versions created before this time.
Parameter createdAtStartTime :
Filter results to return all the model versions created after this time.
Parameter maxModelVersion :
Specifies the highest version of the model to return in the list.
Parameter maxResults :
Specifies the maximum number of machine learning model versions to list.
Parameter minModelVersion :
Specifies the lowest version of the model to return in the list.
Parameter nextToken :
If the total number of results exceeds the limit that the response can
display, the response returns an opaque pagination token indicating where
to continue the listing of machine learning model versions. Use this token
in the NextToken field in the request to list the next page
of results.
Parameter sourceType :
Filter the results based on the way the model version was generated.
Parameter status :
Filter the results based on the current status of the model version.
Implementation
Future<ListModelVersionsResponse> listModelVersions({
required String modelName,
DateTime? createdAtEndTime,
DateTime? createdAtStartTime,
int? maxModelVersion,
int? maxResults,
int? minModelVersion,
String? nextToken,
ModelVersionSourceType? sourceType,
ModelVersionStatus? status,
}) async {
_s.validateNumRange(
'maxModelVersion',
maxModelVersion,
1,
1152921504606846976,
);
_s.validateNumRange(
'maxResults',
maxResults,
1,
500,
);
_s.validateNumRange(
'minModelVersion',
minModelVersion,
1,
1152921504606846976,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AWSLookoutEquipmentFrontendService.ListModelVersions'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ModelName': modelName,
if (createdAtEndTime != null)
'CreatedAtEndTime': unixTimestampToJson(createdAtEndTime),
if (createdAtStartTime != null)
'CreatedAtStartTime': unixTimestampToJson(createdAtStartTime),
if (maxModelVersion != null) 'MaxModelVersion': maxModelVersion,
if (maxResults != null) 'MaxResults': maxResults,
if (minModelVersion != null) 'MinModelVersion': minModelVersion,
if (nextToken != null) 'NextToken': nextToken,
if (sourceType != null) 'SourceType': sourceType.value,
if (status != null) 'Status': status.value,
},
);
return ListModelVersionsResponse.fromJson(jsonResponse.body);
}