createBotVersion method
Creates an immutable version of the bot. When you create the first version of a bot, Amazon Lex sets the version number to 1. Subsequent bot versions increase in an increment of 1. The version number will always represent the total number of versions created of the bot, not the current number of versions. If a bot version is deleted, that bot version number will not be reused.
May throw ConflictException.
May throw InternalServerException.
May throw PreconditionFailedException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter botId :
The identifier of the bot to create the version for.
Parameter botVersionLocaleSpecification :
Specifies the locales that Amazon Lex adds to this version. You can choose
the Draft version or any other previously published version
for each locale. When you specify a source version, the locale data is
copied from the source version to the new version.
Parameter description :
A description of the version. Use the description to help identify the
version in lists.
Implementation
Future<CreateBotVersionResponse> createBotVersion({
required String botId,
required Map<String, BotVersionLocaleDetails> botVersionLocaleSpecification,
String? description,
}) async {
final $payload = <String, dynamic>{
'botVersionLocaleSpecification': botVersionLocaleSpecification,
if (description != null) 'description': description,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/bots/${Uri.encodeComponent(botId)}/botversions',
exceptionFnMap: _exceptionFns,
);
return CreateBotVersionResponse.fromJson(response);
}