Skip to content

update_medical_vocabulary

update_medical_vocabulary(
    vocabulary_name: VocabularyName,
    language_code: LanguageCode,
    vocabulary_file_uri: Uri,
    *,
    config_overrides: Optional[TranscribeClientConfig] = None,
) -> UpdateMedicalVocabularyResponse

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.

Parameters:

  • vocabulary_name (VocabularyName) –

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

  • language_code (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.

  • vocabulary_file_uri (Uri) –

    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

Raises:

  • BadRequestException –

    Your request didn't pass one or more validation tests. This can occur when the entity you're trying to delete doesn't exist or if it's in a non-terminal state (such as IN PROGRESS). See the exception message field for more information.

  • ConflictException –

    A resource already exists with this name. Resource names must be unique within an Amazon Web Services account.

  • InternalFailureException –

    There was an internal error. Check the error message, correct the issue, and try your request again.

  • LimitExceededException –

    You've either sent too many requests or your input file is too long. Wait before retrying your request, or use a smaller file and try your request again.

  • NotFoundException –

    We can't find the requested resource. Check that the specified name is correct and try your request again.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_transcribe/_services/transcribe.py
def update_medical_vocabulary(
    self,
    vocabulary_name: "capo_transcribe.types.vocabulary_name.VocabularyName",
    language_code: "capo_transcribe.types.language_code.LanguageCode",
    vocabulary_file_uri: "capo_transcribe.types.uri.Uri",
    *,
    config_overrides: Optional[TranscribeClientConfig] = None,
) -> "capo_transcribe.types.update_medical_vocabulary_response.UpdateMedicalVocabularyResponse":
    """<p>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.</p>

    Args:
        vocabulary_name: <p>The name of the custom medical vocabulary you want to update. Custom medical vocabulary names are case sensitive.</p>
        language_code: <p>The language code that represents the language of the entries in the custom vocabulary you want to update. US English (<code>en-US</code>) is the only language supported with Amazon Transcribe Medical.</p>
        vocabulary_file_uri: <p>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.</p> <p>Here's an example URI path: <code>s3://DOC-EXAMPLE-BUCKET/my-vocab-file.txt</code> </p>

    Raises:
        capo_transcribe.errors.bad_request_exception.BadRequestException: <p>Your request didn't pass one or more validation tests. This can occur when the entity you're trying to delete doesn't exist or if it's in a non-terminal state (such as <code>IN PROGRESS</code>). See the exception message field for more information.</p>
        capo_transcribe.errors.conflict_exception.ConflictException: <p>A resource already exists with this name. Resource names must be unique within an Amazon Web Services account.</p>
        capo_transcribe.errors.internal_failure_exception.InternalFailureException: <p>There was an internal error. Check the error message, correct the issue, and try your request again.</p>
        capo_transcribe.errors.limit_exceeded_exception.LimitExceededException: <p>You've either sent too many requests or your input file is too long. Wait before retrying your request, or use a smaller file and try your request again.</p>
        capo_transcribe.errors.not_found_exception.NotFoundException: <p>We can't find the requested resource. Check that the specified name is correct and try your request again.</p>
        capo_transcribe.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_transcribe.types.update_medical_vocabulary_request.UpdateMedicalVocabularyRequest]",
    ) -> OperationResponse[
        "capo_transcribe.types.update_medical_vocabulary_response.UpdateMedicalVocabularyResponse"
    ]:
        import capo_transcribe._operations.transcribe.update_medical_vocabulary

        output, http_response = (
            capo_transcribe._operations.transcribe.update_medical_vocabulary.update_medical_vocabulary(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateMedicalVocabulary")
    )
    input_: capo_transcribe.types.update_medical_vocabulary_request.UpdateMedicalVocabularyRequest = {
        "vocabulary_name": vocabulary_name,
        "language_code": language_code,
        "vocabulary_file_uri": vocabulary_file_uri,
    }

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output