Skip to content

send_durable_execution_callback_failure async

send_durable_execution_callback_failure(
    callback_id: CallbackId,
    *,
    config_overrides: Optional[AsyncLambdaClientConfig] = None,
    error: Optional[ErrorObject] = None,
) -> SendDurableExecutionCallbackFailureResponse

Sends a failure response for a callback operation in a durable execution. Use this API when an external system cannot complete a callback operation successfully.

Parameters:

  • callback_id (CallbackId) –

    The unique identifier for the callback operation.

  • error (Optional[ErrorObject], default: None ) –

    Error details describing why the callback operation failed.

Raises:

  • CallbackTimeoutException –

    The callback ID token has either expired or the callback associated with the token has already been closed.

  • InvalidParameterValueException –

    One of the parameters in the request is not valid.

  • KMSAccessDeniedException –

    Lambda couldn't decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.

  • KMSDisabledException –

    Lambda couldn't decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.

  • KMSInvalidStateException –

    Lambda couldn't decrypt the environment variables because the state of the KMS key used is not valid for Decrypt. Check the function's KMS key settings.

  • KMSNotFoundException –

    Lambda couldn't decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.

  • ResourceNotFoundException –

    The resource specified in the request does not exist.

  • ServiceException –

    The Lambda service encountered an internal error.

  • TooManyRequestsException –

    The request throughput limit was exceeded. For more information, see Lambda quotas.

  • UnknownServiceError –

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

Source code in docs_src/capo_lambda/_services/async__lambda.py
async def send_durable_execution_callback_failure(
    self,
    callback_id: "capo_lambda.types.callback_id.CallbackId",
    *,
    config_overrides: Optional[AsyncLambdaClientConfig] = None,
    error: Optional["capo_lambda.types.error_object.ErrorObject"] = None,
) -> "capo_lambda.types.send_durable_execution_callback_failure_response.SendDurableExecutionCallbackFailureResponse":
    """<p>Sends a failure response for a callback operation in a durable execution. Use this API when an external system cannot complete a callback operation successfully.</p>

    Args:
        callback_id: <p>The unique identifier for the callback operation.</p>
        error: <p>Error details describing why the callback operation failed.</p>

    Raises:
        capo_lambda.errors.callback_timeout_exception.CallbackTimeoutException: <p>The callback ID token has either expired or the callback associated with the token has already been closed.</p>
        capo_lambda.errors.invalid_parameter_value_exception.InvalidParameterValueException: <p>One of the parameters in the request is not valid.</p>
        capo_lambda.errors.kms_access_denied_exception.KMSAccessDeniedException: <p>Lambda couldn't decrypt the environment variables because KMS access was denied. Check the Lambda function's KMS permissions.</p>
        capo_lambda.errors.kms_disabled_exception.KMSDisabledException: <p>Lambda couldn't decrypt the environment variables because the KMS key used is disabled. Check the Lambda function's KMS key settings.</p>
        capo_lambda.errors.kms_invalid_state_exception.KMSInvalidStateException: <p>Lambda couldn't decrypt the environment variables because the state of the KMS key used is not valid for Decrypt. Check the function's KMS key settings.</p>
        capo_lambda.errors.kms_not_found_exception.KMSNotFoundException: <p>Lambda couldn't decrypt the environment variables because the KMS key was not found. Check the function's KMS key settings.</p>
        capo_lambda.errors.resource_not_found_exception.ResourceNotFoundException: <p>The resource specified in the request does not exist.</p>
        capo_lambda.errors.service_exception.ServiceException: <p>The Lambda service encountered an internal error.</p>
        capo_lambda.errors.too_many_requests_exception.TooManyRequestsException: <p>The request throughput limit was exceeded. For more information, see <a href="https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html#api-requests">Lambda quotas</a>.</p>
        capo_lambda.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_lambda.types.send_durable_execution_callback_failure_request.SendDurableExecutionCallbackFailureRequest]",
    ) -> AsyncOperationResponse[
        "capo_lambda.types.send_durable_execution_callback_failure_response.SendDurableExecutionCallbackFailureResponse"
    ]:
        import capo_lambda._operations.aws_gir_api_service.send_durable_execution_callback_failure

        (
            output,
            http_response,
        ) = await capo_lambda._operations.aws_gir_api_service.send_durable_execution_callback_failure.async_send_durable_execution_callback_failure(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_lambda.types.send_durable_execution_callback_failure_request.SendDurableExecutionCallbackFailureRequest",
    ) -> dict[str, Any]:
        import capo_lambda.types.send_durable_execution_callback_failure_request

        return capo_lambda.types.send_durable_execution_callback_failure_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "SendDurableExecutionCallbackFailure", redact_input=_redact_input
        ),
    )
    input_: capo_lambda.types.send_durable_execution_callback_failure_request.SendDurableExecutionCallbackFailureRequest = {
        "callback_id": callback_id
    }
    if error is not None:
        input_["error"] = error

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