Skip to content

delete_spending_limit async

delete_spending_limit(
    spending_limit_arn: SpendingLimitArn,
    *,
    config_overrides: Optional[AsyncBraketClientConfig] = None,
) -> DeleteSpendingLimitResponse

Deletes an existing spending limit. This operation permanently removes the spending limit and cannot be undone. After deletion, the associated device becomes unrestricted for spending.

Parameters:

  • spending_limit_arn (SpendingLimitArn) –

    The Amazon Resource Name (ARN) of the spending limit to delete.

Raises:

Source code in docs_src/capo_braket/_services/async_braket.py
async def delete_spending_limit(
    self,
    spending_limit_arn: "capo_braket.types.spending_limit_arn.SpendingLimitArn",
    *,
    config_overrides: Optional[AsyncBraketClientConfig] = None,
) -> "capo_braket.types.delete_spending_limit_response.DeleteSpendingLimitResponse":
    """<p>Deletes an existing spending limit. This operation permanently removes the spending limit and cannot be undone. After deletion, the associated device becomes unrestricted for spending.</p>

    Args:
        spending_limit_arn: <p>The Amazon Resource Name (ARN) of the spending limit to delete.</p>

    Raises:
        capo_braket.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient permissions to perform this action.</p>
        capo_braket.errors.internal_service_exception.InternalServiceException: <p>The request failed because of an unknown error.</p>
        capo_braket.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_braket.errors.throttling_exception.ThrottlingException: <p>The API throttling rate limit is exceeded.</p>
        capo_braket.errors.validation_exception.ValidationException: <p>The input request failed to satisfy constraints expected by Amazon Braket.</p>
        capo_braket.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_braket.types.delete_spending_limit_request.DeleteSpendingLimitRequest]",
    ) -> AsyncOperationResponse[
        "capo_braket.types.delete_spending_limit_response.DeleteSpendingLimitResponse"
    ]:
        import capo_braket._operations.braket.delete_spending_limit

        (
            output,
            http_response,
        ) = await capo_braket._operations.braket.delete_spending_limit.async_delete_spending_limit(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteSpendingLimit")
    )
    input_: capo_braket.types.delete_spending_limit_request.DeleteSpendingLimitRequest = {
        "spending_limit_arn": spending_limit_arn
    }

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