listSlots method

Future<ListSlotsResponse> listSlots({
  1. required String botId,
  2. required String botVersion,
  3. required String intentId,
  4. required String localeId,
  5. List<SlotFilter>? filters,
  6. int? maxResults,
  7. String? nextToken,
  8. SlotSortBy? sortBy,
})

Gets a list of slots that match the specified criteria.

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

Parameter botId : The identifier of the bot that contains the slot.

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

Parameter intentId : The unique identifier of the intent that contains the slot.

Parameter localeId : The identifier of the language and locale of the slots 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 slots 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 slots 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 ListSlots 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.

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

Implementation

Future<ListSlotsResponse> listSlots({
  required String botId,
  required String botVersion,
  required String intentId,
  required String localeId,
  List<SlotFilter>? filters,
  int? maxResults,
  String? nextToken,
  SlotSortBy? 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/${Uri.encodeComponent(intentId)}/slots',
    exceptionFnMap: _exceptionFns,
  );
  return ListSlotsResponse.fromJson(response);
}