startImport method

Future<StartImportResponse> startImport({
  1. required String importId,
  2. required MergeStrategy mergeStrategy,
  3. required ImportResourceSpecification resourceSpecification,
  4. String? filePassword,
})

Starts importing a bot, bot locale, or custom vocabulary from a zip archive that you uploaded to an S3 bucket.

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

Parameter importId : The unique identifier for the import. It is included in the response from the CreateUploadUrl operation.

Parameter mergeStrategy : The strategy to use when there is a name conflict between the imported resource and an existing resource. When the merge strategy is FailOnConflict existing resources are not overwritten and the import fails.

Parameter resourceSpecification : Parameters for creating the bot, bot locale or custom vocabulary.

Parameter filePassword : The password used to encrypt the zip archive that contains the resource definition. You should always encrypt the zip archive to protect it during transit between your site and Amazon Lex.

Implementation

Future<StartImportResponse> startImport({
  required String importId,
  required MergeStrategy mergeStrategy,
  required ImportResourceSpecification resourceSpecification,
  String? filePassword,
}) async {
  final $payload = <String, dynamic>{
    'importId': importId,
    'mergeStrategy': mergeStrategy.value,
    'resourceSpecification': resourceSpecification,
    if (filePassword != null) 'filePassword': filePassword,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/imports',
    exceptionFnMap: _exceptionFns,
  );
  return StartImportResponse.fromJson(response);
}