Skip to content

delete_entity_recognizer async

delete_entity_recognizer(
    entity_recognizer_arn: EntityRecognizerArn,
    *,
    config_overrides: Optional[AsyncComprehendClientConfig] = None,
) -> DeleteEntityRecognizerResponse

Deletes an entity recognizer.

Only those recognizers that are in terminated states (IN_ERROR, TRAINED) will be deleted. If an active inference job is using the model, a ResourceInUseException will be returned.

This is an asynchronous action that puts the recognizer into a DELETING state, and it is then removed by a background job. Once removed, the recognizer disappears from your account and is no longer available for use.

Parameters:

  • entity_recognizer_arn (EntityRecognizerArn) –

    The Amazon Resource Name (ARN) that identifies the entity recognizer.

Raises:

Source code in docs_src/capo_comprehend/_services/async_comprehend.py
async def delete_entity_recognizer(
    self,
    entity_recognizer_arn: "capo_comprehend.types.entity_recognizer_arn.EntityRecognizerArn",
    *,
    config_overrides: Optional[AsyncComprehendClientConfig] = None,
) -> "capo_comprehend.types.delete_entity_recognizer_response.DeleteEntityRecognizerResponse":
    """<p>Deletes an entity recognizer.</p> <p>Only those recognizers that are in terminated states (IN_ERROR, TRAINED) will be deleted. If an active inference job is using the model, a <code>ResourceInUseException</code> will be returned.</p> <p>This is an asynchronous action that puts the recognizer into a DELETING state, and it is then removed by a background job. Once removed, the recognizer disappears from your account and is no longer available for use. </p>

    Args:
        entity_recognizer_arn: <p>The Amazon Resource Name (ARN) that identifies the entity recognizer.</p>

    Raises:
        capo_comprehend.errors.internal_server_exception.InternalServerException: <p>An internal server error occurred. Retry your request.</p>
        capo_comprehend.errors.invalid_request_exception.InvalidRequestException: <p>The request is invalid.</p>
        capo_comprehend.errors.resource_in_use_exception.ResourceInUseException: <p>The specified resource name is already in use. Use a different name and try your request again.</p>
        capo_comprehend.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource ARN was not found. Check the ARN and try your request again.</p>
        capo_comprehend.errors.resource_unavailable_exception.ResourceUnavailableException: <p>The specified resource is not available. Check the resource and try your request again.</p>
        capo_comprehend.errors.too_many_requests_exception.TooManyRequestsException: <p>The number of requests exceeds the limit. Resubmit your request later.</p>
        capo_comprehend.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_comprehend.types.delete_entity_recognizer_request.DeleteEntityRecognizerRequest]",
    ) -> AsyncOperationResponse[
        "capo_comprehend.types.delete_entity_recognizer_response.DeleteEntityRecognizerResponse"
    ]:
        import capo_comprehend._operations.comprehend_20171127.delete_entity_recognizer

        (
            output,
            http_response,
        ) = await capo_comprehend._operations.comprehend_20171127.delete_entity_recognizer.async_delete_entity_recognizer(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteEntityRecognizer")
    )
    input_: capo_comprehend.types.delete_entity_recognizer_request.DeleteEntityRecognizerRequest = {
        "entity_recognizer_arn": entity_recognizer_arn
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output