createBotAlias method

Future<CreateBotAliasResponse> createBotAlias({
  1. required String botAliasName,
  2. required String botId,
  3. Map<String, BotAliasLocaleSettings>? botAliasLocaleSettings,
  4. String? botVersion,
  5. ConversationLogSettings? conversationLogSettings,
  6. String? description,
  7. SentimentAnalysisSettings? sentimentAnalysisSettings,
  8. Map<String, String>? tags,
})

Creates an alias for the specified version of a bot. Use an alias to enable you to change the version of a bot without updating applications that use the bot.

For example, you can create an alias called "PROD" that your applications use to call the Amazon Lex bot.

May throw ConflictException. May throw InternalServerException. May throw PreconditionFailedException. May throw ServiceQuotaExceededException. May throw ThrottlingException. May throw ValidationException.

Parameter botAliasName : The alias to create. The name must be unique for the bot.

Parameter botId : The unique identifier of the bot that the alias applies to.

Parameter botAliasLocaleSettings : Maps configuration information to a specific locale. You can use this parameter to specify a specific Lambda function to run different functions in different locales.

Parameter botVersion : The version of the bot that this alias points to. You can use the UpdateBotAlias operation to change the bot version associated with the alias.

Parameter conversationLogSettings : Specifies whether Amazon Lex logs text and audio for a conversation with the bot. When you enable conversation logs, text logs store text input, transcripts of audio input, and associated metadata in Amazon CloudWatch Logs. Audio logs store audio input in Amazon S3.

Parameter description : A description of the alias. Use this description to help identify the alias.

Parameter tags : A list of tags to add to the bot alias. You can only add tags when you create an alias, you can't use the UpdateBotAlias operation to update the tags on a bot alias. To update tags, use the TagResource operation.

Implementation

Future<CreateBotAliasResponse> createBotAlias({
  required String botAliasName,
  required String botId,
  Map<String, BotAliasLocaleSettings>? botAliasLocaleSettings,
  String? botVersion,
  ConversationLogSettings? conversationLogSettings,
  String? description,
  SentimentAnalysisSettings? sentimentAnalysisSettings,
  Map<String, String>? tags,
}) async {
  final $payload = <String, dynamic>{
    'botAliasName': botAliasName,
    if (botAliasLocaleSettings != null)
      'botAliasLocaleSettings': botAliasLocaleSettings,
    if (botVersion != null) 'botVersion': botVersion,
    if (conversationLogSettings != null)
      'conversationLogSettings': conversationLogSettings,
    if (description != null) 'description': description,
    if (sentimentAnalysisSettings != null)
      'sentimentAnalysisSettings': sentimentAnalysisSettings,
    if (tags != null) 'tags': tags,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/bots/${Uri.encodeComponent(botId)}/botaliases',
    exceptionFnMap: _exceptionFns,
  );
  return CreateBotAliasResponse.fromJson(response);
}