listModelCardVersions method
List existing versions of an Amazon SageMaker Model Card.
May throw ResourceNotFound.
Parameter modelCardName :
List model card versions for the model card with the specified name or
Amazon Resource Name (ARN).
Parameter creationTimeAfter :
Only list model card versions that were created after the time specified.
Parameter creationTimeBefore :
Only list model card versions that were created before the time specified.
Parameter maxResults :
The maximum number of model card versions to list.
Parameter modelCardStatus :
Only list model card versions with the specified approval status.
Parameter nextToken :
If the response to a previous ListModelCardVersions request
was truncated, the response includes a NextToken. To retrieve
the next set of model card versions, use the token in the next request.
Parameter sortBy :
Sort listed model card versions by version. Sorts by version by default.
Parameter sortOrder :
Sort model card versions by ascending or descending order.
Implementation
Future<ListModelCardVersionsResponse> listModelCardVersions({
required String modelCardName,
DateTime? creationTimeAfter,
DateTime? creationTimeBefore,
int? maxResults,
ModelCardStatus? modelCardStatus,
String? nextToken,
ModelCardVersionSortBy? sortBy,
ModelCardSortOrder? sortOrder,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'SageMaker.ListModelCardVersions'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'ModelCardName': modelCardName,
if (creationTimeAfter != null)
'CreationTimeAfter': unixTimestampToJson(creationTimeAfter),
if (creationTimeBefore != null)
'CreationTimeBefore': unixTimestampToJson(creationTimeBefore),
if (maxResults != null) 'MaxResults': maxResults,
if (modelCardStatus != null) 'ModelCardStatus': modelCardStatus.value,
if (nextToken != null) 'NextToken': nextToken,
if (sortBy != null) 'SortBy': sortBy.value,
if (sortOrder != null) 'SortOrder': sortOrder.value,
},
);
return ListModelCardVersionsResponse.fromJson(jsonResponse.body);
}