listIntents method

Future<ListIntentsResponse> listIntents({
  1. required String botId,
  2. required String botVersion,
  3. required String localeId,
  4. List<IntentFilter>? filters,
  5. int? maxResults,
  6. String? nextToken,
  7. IntentSortBy? sortBy,
})

Get a list of intents that meet the specified criteria.

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

Parameter botId : The unique identifier of the bot that contains the intent.

Parameter botVersion : The version of the bot that contains the intent.

Parameter localeId : The identifier of the language and locale of the intents to list. The string must match one of the supported locales. For more information, see Supported languages.

Parameter filters : Provides the specification of a filter used to limit the intents in the response to only those that match the filter specification. You can only specify one filter and only one string to filter on.

Parameter maxResults : The maximum number of intents 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 ListIntents operation contains more results than specified in the maxResults parameter, a token is returned in the response.

Use the returned token in the nextToken parameter of a ListIntents request to return the next page of results. For a complete set of results, call the ListIntents operation until the nextToken returned in the response is null.

Parameter sortBy : Determines the sort order for the response from the ListIntents operation. You can choose to sort by the intent name or last updated date in either ascending or descending order.

Implementation

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