listRecommenders method

Future<ListRecommendersResponse> listRecommenders({
  1. String? datasetGroupArn,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of recommenders in a given Domain dataset group. When a Domain dataset group is not specified, all the recommenders associated with the account are listed. The response provides the properties for each recommender, including the Amazon Resource Name (ARN). For more information on recommenders, see CreateRecommender.

May throw InvalidInputException. May throw InvalidNextTokenException.

Parameter datasetGroupArn : The Amazon Resource Name (ARN) of the Domain dataset group to list the recommenders for. When a Domain dataset group is not specified, all the recommenders associated with the account are listed.

Parameter maxResults : The maximum number of recommenders to return.

Parameter nextToken : A token returned from the previous call to ListRecommenders for getting the next set of recommenders (if they exist).

Implementation

Future<ListRecommendersResponse> listRecommenders({
  String? datasetGroupArn,
  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': 'AmazonPersonalize.ListRecommenders'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (datasetGroupArn != null) 'datasetGroupArn': datasetGroupArn,
      if (maxResults != null) 'maxResults': maxResults,
      if (nextToken != null) 'nextToken': nextToken,
    },
  );

  return ListRecommendersResponse.fromJson(jsonResponse.body);
}