updateBot method
Updates the configuration of an existing bot.
May throw ConflictException.
May throw InternalServerException.
May throw PreconditionFailedException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter botId :
The unique identifier of the bot to update. This identifier is returned by
the CreateBot
operation.
Parameter botName :
The new name of the bot. The name must be unique in the account that
creates the bot.
Parameter dataPrivacy :
Provides information on additional privacy protections Amazon Lex should
use with the bot's data.
Parameter idleSessionTTLInSeconds :
The time, in seconds, that Amazon Lex should keep information about a
user's conversation with the bot.
A user interaction remains active for the amount of time specified. If no conversation occurs during this time, the session expires and Amazon Lex deletes any data provided before the timeout.
You can specify between 60 (1 minute) and 86,400 (24 hours) seconds.
Parameter roleArn :
The Amazon Resource Name (ARN) of an IAM role that has permissions to
access the bot.
Parameter botMembers :
The list of bot members in the network associated with the update action.
Parameter botType :
The type of the bot to be updated.
Parameter description :
A description of the bot.
Parameter errorLogSettings :
Allows you to modify how Amazon Lex logs errors during bot interactions,
including destinations for error logs and the types of errors to be
captured.
Implementation
Future<UpdateBotResponse> updateBot({
required String botId,
required String botName,
required DataPrivacy dataPrivacy,
required int idleSessionTTLInSeconds,
required String roleArn,
List<BotMember>? botMembers,
BotType? botType,
String? description,
ErrorLogSettings? errorLogSettings,
}) async {
_s.validateNumRange(
'idleSessionTTLInSeconds',
idleSessionTTLInSeconds,
60,
86400,
isRequired: true,
);
final $payload = <String, dynamic>{
'botName': botName,
'dataPrivacy': dataPrivacy,
'idleSessionTTLInSeconds': idleSessionTTLInSeconds,
'roleArn': roleArn,
if (botMembers != null) 'botMembers': botMembers,
if (botType != null) 'botType': botType.value,
if (description != null) 'description': description,
if (errorLogSettings != null) 'errorLogSettings': errorLogSettings,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/bots/${Uri.encodeComponent(botId)}',
exceptionFnMap: _exceptionFns,
);
return UpdateBotResponse.fromJson(response);
}