Skip to content

delete_external_model async

delete_external_model(
    model_endpoint: sageMakerEndpointIdentifier,
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
) -> DeleteExternalModelResult

Removes a SageMaker model from Amazon Fraud Detector.

You can remove an Amazon SageMaker model if it is not associated with a detector version. Removing a SageMaker model disconnects it from Amazon Fraud Detector, but the model remains available in SageMaker.

Parameters:

Raises:

  • AccessDeniedException –

    An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as PutExternalModel, that specifies a role that is not in your account.

  • ConflictException –

    An exception indicating there was a conflict during a delete operation.

  • InternalServerException –

    An exception indicating an internal server error.

  • ThrottlingException –

    An exception indicating a throttling error.

  • ValidationException –

    An exception indicating a specified value is not allowed.

  • UnknownServiceError –

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

Source code in docs_src/capo_frauddetector/_services/async_fraud_detector.py
async def delete_external_model(
    self,
    model_endpoint: "capo_frauddetector.types.sage_maker_endpoint_identifier.sageMakerEndpointIdentifier",
    *,
    config_overrides: Optional[AsyncFraudDetectorClientConfig] = None,
) -> "capo_frauddetector.types.delete_external_model_result.DeleteExternalModelResult":
    """<p>Removes a SageMaker model from Amazon Fraud Detector.</p> <p>You can remove an Amazon SageMaker model if it is not associated with a detector version. Removing a SageMaker model disconnects it from Amazon Fraud Detector, but the model remains available in SageMaker.</p>

    Args:
        model_endpoint: <p>The endpoint of the Amazon Sagemaker model to delete.</p>

    Raises:
        capo_frauddetector.errors.access_denied_exception.AccessDeniedException: <p>An exception indicating Amazon Fraud Detector does not have the needed permissions. This can occur if you submit a request, such as <code>PutExternalModel</code>, that specifies a role that is not in your account.</p>
        capo_frauddetector.errors.conflict_exception.ConflictException: <p>An exception indicating there was a conflict during a delete operation.</p>
        capo_frauddetector.errors.internal_server_exception.InternalServerException: <p>An exception indicating an internal server error.</p>
        capo_frauddetector.errors.throttling_exception.ThrottlingException: <p>An exception indicating a throttling error.</p>
        capo_frauddetector.errors.validation_exception.ValidationException: <p>An exception indicating a specified value is not allowed.</p>
        capo_frauddetector.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_frauddetector.types.delete_external_model_request.DeleteExternalModelRequest]",
    ) -> AsyncOperationResponse[
        "capo_frauddetector.types.delete_external_model_result.DeleteExternalModelResult"
    ]:
        import capo_frauddetector._operations.aws_hawks_nest_service_facade.delete_external_model

        (
            output,
            http_response,
        ) = await capo_frauddetector._operations.aws_hawks_nest_service_facade.delete_external_model.async_delete_external_model(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteExternalModel")
    )
    input_: capo_frauddetector.types.delete_external_model_request.DeleteExternalModelRequest = {
        "model_endpoint": model_endpoint
    }

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