deleteUtterances method

Future<void> deleteUtterances({
  1. required String botName,
  2. required String userId,
})

Deletes stored utterances.

Amazon Lex stores the utterances that users send to your bot. Utterances are stored for 15 days for use with the GetUtterancesView 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 stored utterances for a specific user. 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 GetUtterancesView operation are deleted after 15 days.

This operation requires permissions for the lex:DeleteUtterances action.

May throw NotFoundException. May throw LimitExceededException. May throw InternalFailureException. May throw BadRequestException.

Parameter botName : The name of the bot that stored the utterances.

Parameter userId : The unique identifier for the user that made the utterances. This is the user ID that was sent in the PostContent or PostText operation request that contained the utterance.

Implementation

Future<void> deleteUtterances({
  required String botName,
  required String userId,
}) async {
  ArgumentError.checkNotNull(botName, 'botName');
  _s.validateStringLength(
    'botName',
    botName,
    2,
    50,
    isRequired: true,
  );
  ArgumentError.checkNotNull(userId, 'userId');
  _s.validateStringLength(
    'userId',
    userId,
    2,
    100,
    isRequired: true,
  );
  await _protocol.send(
    payload: null,
    method: 'DELETE',
    requestUri:
        '/bots/${Uri.encodeComponent(botName)}/utterances/${Uri.encodeComponent(userId)}',
    exceptionFnMap: _exceptionFns,
  );
}