updateMedicalVocabulary method

Future<UpdateMedicalVocabularyResponse> updateMedicalVocabulary({
  1. required LanguageCode languageCode,
  2. required String vocabularyFileUri,
  3. required String vocabularyName,
})

Updates an existing custom medical vocabulary with new values. This operation overwrites all existing information with your new values; you cannot append new terms onto an existing custom vocabulary.

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

Parameter languageCode : The language code that represents the language of the entries in the custom vocabulary you want to update. US English (en-US) is the only language supported with Amazon Transcribe Medical.

Parameter vocabularyFileUri : The Amazon S3 location of the text file that contains your custom medical vocabulary. The URI must be located in the same Amazon Web Services Region as the resource you're calling.

Here's an example URI path: s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txt

Parameter vocabularyName : The name of the custom medical vocabulary you want to update. Custom medical vocabulary names are case sensitive.

Implementation

Future<UpdateMedicalVocabularyResponse> updateMedicalVocabulary({
  required LanguageCode languageCode,
  required String vocabularyFileUri,
  required String vocabularyName,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'Transcribe.UpdateMedicalVocabulary'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'LanguageCode': languageCode.value,
      'VocabularyFileUri': vocabularyFileUri,
      'VocabularyName': vocabularyName,
    },
  );

  return UpdateMedicalVocabularyResponse.fromJson(jsonResponse.body);
}