startMigration method

Future<StartMigrationResponse> startMigration({
  1. required MigrationStrategy migrationStrategy,
  2. required String v1BotName,
  3. required String v1BotVersion,
  4. required String v2BotName,
  5. required String v2BotRole,
})

Starts migrating a bot from Amazon Lex V1 to Amazon Lex V2. Migrate your bot when you want to take advantage of the new features of Amazon Lex V2.

For more information, see Migrating a bot in the Amazon Lex developer guide.

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

Parameter migrationStrategy : The strategy used to conduct the migration.

  • CREATE_NEW - Creates a new Amazon Lex V2 bot and migrates the Amazon Lex V1 bot to the new bot.
  • UPDATE_EXISTING - Overwrites the existing Amazon Lex V2 bot metadata and the locale being migrated. It doesn't change any other locales in the Amazon Lex V2 bot. If the locale doesn't exist, a new locale is created in the Amazon Lex V2 bot.

Parameter v1BotName : The name of the Amazon Lex V1 bot that you are migrating to Amazon Lex V2.

Parameter v1BotVersion : The version of the bot to migrate to Amazon Lex V2. You can migrate the $LATEST version as well as any numbered version.

Parameter v2BotName : The name of the Amazon Lex V2 bot that you are migrating the Amazon Lex V1 bot to.

  • If the Amazon Lex V2 bot doesn't exist, you must use the CREATE_NEW migration strategy.
  • If the Amazon Lex V2 bot exists, you must use the UPDATE_EXISTING migration strategy to change the contents of the Amazon Lex V2 bot.

Parameter v2BotRole : The IAM role that Amazon Lex uses to run the Amazon Lex V2 bot.

Implementation

Future<StartMigrationResponse> startMigration({
  required MigrationStrategy migrationStrategy,
  required String v1BotName,
  required String v1BotVersion,
  required String v2BotName,
  required String v2BotRole,
}) async {
  final $payload = <String, dynamic>{
    'migrationStrategy': migrationStrategy.value,
    'v1BotName': v1BotName,
    'v1BotVersion': v1BotVersion,
    'v2BotName': v2BotName,
    'v2BotRole': v2BotRole,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri: '/migrations',
    exceptionFnMap: _exceptionFns,
  );
  return StartMigrationResponse.fromJson(response);
}