listDatasetLabels method
Lists the labels in a dataset. Amazon Rekognition Custom Labels uses labels to describe images. For more information, see Labeling images in the Amazon Rekognition Custom Labels Developer Guide.
May throw AccessDeniedException.
May throw InternalServerError.
May throw InvalidPaginationTokenException.
May throw InvalidParameterException.
May throw ProvisionedThroughputExceededException.
May throw ResourceInUseException.
May throw ResourceNotFoundException.
May throw ResourceNotReadyException.
May throw ThrottlingException.
Parameter datasetArn :
The Amazon Resource Name (ARN) of the dataset that you want to use.
Parameter maxResults :
The maximum number of results to return per paginated call. The largest
value you can specify is 100. If you specify a value greater than 100, a
ValidationException error occurs. The default value is 100.
Parameter nextToken :
If the previous response was incomplete (because there is more results to
retrieve), Amazon Rekognition Custom Labels returns a pagination token in
the response. You can use this pagination token to retrieve the next set
of results.
Implementation
Future<ListDatasetLabelsResponse> listDatasetLabels({
required String datasetArn,
int? maxResults,
String? nextToken,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.1',
'X-Amz-Target': 'RekognitionService.ListDatasetLabels'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'DatasetArn': datasetArn,
if (maxResults != null) 'MaxResults': maxResults,
if (nextToken != null) 'NextToken': nextToken,
},
);
return ListDatasetLabelsResponse.fromJson(jsonResponse.body);
}