createBotVersion method

Future<CreateBotVersionResponse> createBotVersion({
  1. required String name,
  2. String? checksum,
})

Creates a new version of the bot based on the $LATEST version. If the $LATEST version of this resource hasn't changed since you created the last version, Amazon Lex doesn't create a new version. It returns the last created version. When you create the first version of a bot, Amazon Lex sets the version to

  1. Subsequent versions increment by 1. For more information, see versioning-intro.

This operation requires permission for the lex:CreateBotVersion action.

May throw NotFoundException. May throw ConflictException. May throw LimitExceededException. May throw InternalFailureException. May throw BadRequestException. May throw PreconditionFailedException.

Parameter name : The name of the bot that you want to create a new version of. The name is case sensitive.

Parameter checksum : Identifies a specific revision of the $LATEST version of the bot. If you specify a checksum and the $LATEST version of the bot has a different checksum, a PreconditionFailedException exception is returned and Amazon Lex doesn't publish a new version. If you don't specify a checksum, Amazon Lex publishes the $LATEST version.

Implementation

Future<CreateBotVersionResponse> createBotVersion({
  required String name,
  String? checksum,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    2,
    50,
    isRequired: true,
  );
  final $payload = <String, dynamic>{
    if (checksum != null) 'checksum': checksum,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/bots/${Uri.encodeComponent(name)}/versions',
    exceptionFnMap: _exceptionFns,
  );
  return CreateBotVersionResponse.fromJson(response);
}