Deletes a previously created document classifier
Only those classifiers 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 classifier into a DELETING state, and it is then removed by a background job. Once removed, the classifier disappears from your account and is no longer available for use.
Parameters:
-
document_classifier_arn
(DocumentClassifierArn)
–
The Amazon Resource Name (ARN) that identifies the document classifier.
Raises:
Source code in docs_src/capo_comprehend/_services/comprehend.py
| def delete_document_classifier(
self,
document_classifier_arn: "capo_comprehend.types.document_classifier_arn.DocumentClassifierArn",
*,
config_overrides: Optional[ComprehendClientConfig] = None,
) -> "capo_comprehend.types.delete_document_classifier_response.DeleteDocumentClassifierResponse":
"""<p>Deletes a previously created document classifier</p> <p>Only those classifiers 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 classifier into a DELETING state, and it is then removed by a background job. Once removed, the classifier disappears from your account and is no longer available for use. </p>
Args:
document_classifier_arn: <p>The Amazon Resource Name (ARN) that identifies the document classifier. </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.
"""
def _handler(
req: "OperationRequest[capo_comprehend.types.delete_document_classifier_request.DeleteDocumentClassifierRequest]",
) -> OperationResponse[
"capo_comprehend.types.delete_document_classifier_response.DeleteDocumentClassifierResponse"
]:
import capo_comprehend._operations.comprehend_20171127.delete_document_classifier
output, http_response = (
capo_comprehend._operations.comprehend_20171127.delete_document_classifier.delete_document_classifier(
req.options, req.input
)
)
return OperationResponse(output=output, response=http_response)
interceptors_, options_ = self.operation_options(
config_overrides, OperationLogging("DeleteDocumentClassifier")
)
input_: capo_comprehend.types.delete_document_classifier_request.DeleteDocumentClassifierRequest = {
"document_classifier_arn": document_classifier_arn
}
response = execute_pipeline(
OperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
response.response.close()
return response.output
|