deleteUtterances method

Future<void> deleteUtterances({
  1. required String botId,
  2. String? localeId,
  3. String? sessionId,
})

Deletes stored utterances.

Amazon Lex stores the utterances that users send to your bot. Utterances are stored for 15 days for use with the ListAggregatedUtterances operation, and then stored indefinitely for use in improving the ability of your bot to respond to user input..

Use the DeleteUtterances operation to manually delete utterances for a specific session. When you use the DeleteUtterances operation, utterances stored for improving your bot's ability to respond to user input are deleted immediately. Utterances stored for use with the ListAggregatedUtterances operation are deleted after 15 days.

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

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

Parameter localeId : The identifier of the language and locale where the utterances were collected. The string must match one of the supported locales. For more information, see Supported languages.

Parameter sessionId : The unique identifier of the session with the user. The ID is returned in the response from the RecognizeText and RecognizeUtterance operations.

Implementation

Future<void> deleteUtterances({
  required String botId,
  String? localeId,
  String? sessionId,
}) async {
  final $query = <String, List<String>>{
    if (localeId != null) 'localeId': [localeId],
    if (sessionId != null) 'sessionId': [sessionId],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri: '/bots/${Uri.encodeComponent(botId)}/utterances',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
}