Skip to content

update_dictionary

update_dictionary(
    id: DictionaryId,
    *,
    config_overrides: Optional[ElementalInferenceClientConfig] = None,
    name: Optional[ResourceName] = None,
    language: Optional[DictionaryLanguage] = None,
    entries: Optional[DictionaryEntriesPayload] = None,
) -> UpdateDictionaryResponse

Updates the specified dictionary.

Parameters:

  • id (DictionaryId) –

    The ID of the dictionary to update.

  • name (Optional[ResourceName], default: None ) –

    A new name for the dictionary. If not specified, the name is not changed.

  • language (Optional[DictionaryLanguage], default: None ) –

    A new language for the dictionary. If not specified, the language is not changed.

  • entries (Optional[DictionaryEntriesPayload], default: None ) –

    New dictionary entries. If not specified, the entries are not changed.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • ConflictException –

    The request could not be completed due to a conflict.

  • InternalServerErrorException –

    An internal server error occurred. This is a temporary condition and the request can be retried. If the problem persists, contact AWS Support.

  • ResourceNotFoundException –

    The resource specified in the action doesn't exist.

  • TooManyRequestException –

    The request was denied due to request throttling. Too many requests have been made within a given time period. Reduce the frequency of requests and use exponential backoff when retrying.

  • ValidationException –

    The input fails to satisfy the constraints specified by the service. Check the error message for details about which parameter or field is invalid and correct the request before retrying.

  • UnknownServiceError –

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

Source code in docs_src/capo_elementalinference/_services/elemental_inference.py
def update_dictionary(
    self,
    id: "capo_elementalinference.types.dictionary_id.DictionaryId",
    *,
    config_overrides: Optional[ElementalInferenceClientConfig] = None,
    name: Optional[
        "capo_elementalinference.types.resource_name.ResourceName"
    ] = None,
    language: Optional[
        "capo_elementalinference.types.dictionary_language.DictionaryLanguage"
    ] = None,
    entries: Optional[
        "capo_elementalinference.types.dictionary_entries_payload.DictionaryEntriesPayload"
    ] = None,
) -> "capo_elementalinference.types.update_dictionary_response.UpdateDictionaryResponse":
    """<p>Updates the specified dictionary.</p>

    Args:
        id: <p>The ID of the dictionary to update.</p>
        name: <p>A new name for the dictionary. If not specified, the name is not changed.</p>
        language: <p>A new language for the dictionary. If not specified, the language is not changed.</p>
        entries: <p>New dictionary entries. If not specified, the entries are not changed.</p>

    Raises:
        capo_elementalinference.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_elementalinference.errors.conflict_exception.ConflictException: <p>The request could not be completed due to a conflict.</p>
        capo_elementalinference.errors.internal_server_error_exception.InternalServerErrorException: <p>An internal server error occurred. This is a temporary condition and the request can be retried. If the problem persists, contact AWS Support. </p>
        capo_elementalinference.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the action doesn't exist.</p>
        capo_elementalinference.errors.too_many_request_exception.TooManyRequestException: <p>The request was denied due to request throttling. Too many requests have been made within a given time period. Reduce the frequency of requests and use exponential backoff when retrying. </p>
        capo_elementalinference.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the service. Check the error message for details about which parameter or field is invalid and correct the request before retrying. </p>
        capo_elementalinference.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_elementalinference.types.update_dictionary_request.UpdateDictionaryRequest]",
    ) -> OperationResponse[
        "capo_elementalinference.types.update_dictionary_response.UpdateDictionaryResponse"
    ]:
        import capo_elementalinference._operations.elemental_inference.update_dictionary

        output, http_response = (
            capo_elementalinference._operations.elemental_inference.update_dictionary.update_dictionary(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDictionary")
    )
    input_: capo_elementalinference.types.update_dictionary_request.UpdateDictionaryRequest = {
        "id": id
    }
    if name is not None:
        input_["name"] = name
    if language is not None:
        input_["language"] = language
    if entries is not None:
        input_["entries"] = entries

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