Skip to content

delete_human_loop async

delete_human_loop(
    human_loop_name: HumanLoopName,
    *,
    config_overrides: Optional[AsyncSageMakerA2IRuntimeClientConfig] = None,
) -> DeleteHumanLoopResponse

Deletes the specified human loop for a flow definition.

If the human loop was deleted, this operation will return a ResourceNotFoundException.

Parameters:

  • human_loop_name (HumanLoopName) –

    The name of the human loop that you want to delete.

Raises:

  • InternalServerException –

    We couldn't process your request because of an issue with the server. Try again later.

  • ResourceNotFoundException –

    We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again.

  • ThrottlingException –

    You exceeded the maximum number of requests.

  • ValidationException –

    The request isn't valid. Check the syntax and try again.

  • UnknownServiceError –

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

Source code in docs_src/capo_sagemaker_a2i_runtime/_services/async_sage_maker_a2_i_runtime.py
async def delete_human_loop(
    self,
    human_loop_name: "capo_sagemaker_a2i_runtime.types.human_loop_name.HumanLoopName",
    *,
    config_overrides: Optional[AsyncSageMakerA2IRuntimeClientConfig] = None,
) -> "capo_sagemaker_a2i_runtime.types.delete_human_loop_response.DeleteHumanLoopResponse":
    """<p>Deletes the specified human loop for a flow definition.</p> <p>If the human loop was deleted, this operation will return a <code>ResourceNotFoundException</code>. </p>

    Args:
        human_loop_name: <p>The name of the human loop that you want to delete.</p>

    Raises:
        capo_sagemaker_a2i_runtime.errors.internal_server_exception.InternalServerException: <p>We couldn't process your request because of an issue with the server. Try again later.</p>
        capo_sagemaker_a2i_runtime.errors.resource_not_found_exception.ResourceNotFoundException: <p>We couldn't find the requested resource. Check that your resources exists and were created in the same AWS Region as your request, and try your request again. </p>
        capo_sagemaker_a2i_runtime.errors.throttling_exception.ThrottlingException: <p>You exceeded the maximum number of requests.</p>
        capo_sagemaker_a2i_runtime.errors.validation_exception.ValidationException: <p>The request isn't valid. Check the syntax and try again.</p>
        capo_sagemaker_a2i_runtime.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_sagemaker_a2i_runtime.types.delete_human_loop_request.DeleteHumanLoopRequest]",
    ) -> AsyncOperationResponse[
        "capo_sagemaker_a2i_runtime.types.delete_human_loop_response.DeleteHumanLoopResponse"
    ]:
        import capo_sagemaker_a2i_runtime._operations.amazon_sage_maker_a2_i_runtime.delete_human_loop

        (
            output,
            http_response,
        ) = await capo_sagemaker_a2i_runtime._operations.amazon_sage_maker_a2_i_runtime.delete_human_loop.async_delete_human_loop(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteHumanLoop")
    )
    input_: capo_sagemaker_a2i_runtime.types.delete_human_loop_request.DeleteHumanLoopRequest = {
        "human_loop_name": human_loop_name
    }

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