listRecommendedIntents method

Future<ListRecommendedIntentsResponse> listRecommendedIntents({
  1. required String botId,
  2. required String botRecommendationId,
  3. required String botVersion,
  4. required String localeId,
  5. int? maxResults,
  6. String? nextToken,
})

Gets a list of recommended intents provided by the bot recommendation that you can use in your bot. Intents in the response are ordered by relevance.

May throw InternalServerException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter botId : The unique identifier of the bot associated with the recommended intents.

Parameter botRecommendationId : The identifier of the bot recommendation that contains the recommended intents.

Parameter botVersion : The version of the bot that contains the recommended intents.

Parameter localeId : The identifier of the language and locale of the recommended intents.

Parameter maxResults : The maximum number of bot recommendations to return in each page of results. If there are fewer results than the max page size, only the actual number of results are returned.

Parameter nextToken : If the response from the ListRecommendedIntents operation contains more results than specified in the maxResults parameter, a token is returned in the response. Use that token in the nextToken parameter to return the next page of results.

Implementation

Future<ListRecommendedIntentsResponse> listRecommendedIntents({
  required String botId,
  required String botRecommendationId,
  required String botVersion,
  required String localeId,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    1000,
  );
  final $payload = <String, dynamic>{
    if (maxResults != null) 'maxResults': maxResults,
    if (nextToken != null) 'nextToken': nextToken,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/bots/${Uri.encodeComponent(botId)}/botversions/${Uri.encodeComponent(botVersion)}/botlocales/${Uri.encodeComponent(localeId)}/botrecommendations/${Uri.encodeComponent(botRecommendationId)}/intents',
    exceptionFnMap: _exceptionFns,
  );
  return ListRecommendedIntentsResponse.fromJson(response);
}