Skip to content

update_budget_action

update_budget_action(
    account_id: AccountId,
    budget_name: BudgetName,
    action_id: ActionId,
    *,
    config_overrides: Optional[BudgetsClientConfig] = None,
    notification_type: Optional[NotificationType] = None,
    action_threshold: Optional[ActionThreshold] = None,
    definition: Optional[Definition] = None,
    execution_role_arn: Optional[RoleArn] = None,
    approval_model: Optional[ApprovalModel] = None,
    subscribers: Optional[Subscribers] = None,
) -> UpdateBudgetActionResponse

Updates a budget action.

Parameters:

  • action_id (ActionId) –

    A system-generated universally unique identifier (UUID) for the action.

  • execution_role_arn (Optional[RoleArn], default: None ) –

    The role passed for action execution and reversion. Roles and actions must be in the same account.

  • approval_model (Optional[ApprovalModel], default: None ) –

    This specifies if the action needs manual or automatic approval.

Raises:

  • AccessDeniedException –

    You are not authorized to use this operation with the given parameters.

  • InternalErrorException –

    An error on the server occurred during the processing of your request. Try again later.

  • InvalidParameterException –

    An error on the client occurred. Typically, the cause is an invalid input value.

  • NotFoundException –

    We can’t locate the resource that you specified.

  • ResourceLockedException –

    The request was received and recognized by the server, but the server rejected that particular method for the requested resource.

  • ThrottlingException –

    The number of API requests has exceeded the maximum allowed API request throttling limit for the account.

  • UnknownServiceError –

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

Source code in docs_src/capo_budgets/_services/budgets.py
def update_budget_action(
    self,
    account_id: "capo_budgets.types.account_id.AccountId",
    budget_name: "capo_budgets.types.budget_name.BudgetName",
    action_id: "capo_budgets.types.action_id.ActionId",
    *,
    config_overrides: Optional[BudgetsClientConfig] = None,
    notification_type: Optional[
        "capo_budgets.types.notification_type.NotificationType"
    ] = None,
    action_threshold: Optional[
        "capo_budgets.types.action_threshold.ActionThreshold"
    ] = None,
    definition: Optional["capo_budgets.types.definition.Definition"] = None,
    execution_role_arn: Optional["capo_budgets.types.role_arn.RoleArn"] = None,
    approval_model: Optional[
        "capo_budgets.types.approval_model.ApprovalModel"
    ] = None,
    subscribers: Optional["capo_budgets.types.subscribers.Subscribers"] = None,
) -> "capo_budgets.types.update_budget_action_response.UpdateBudgetActionResponse":
    """<p> Updates a budget action. </p>

    Args:
        action_id: <p> A system-generated universally unique identifier (UUID) for the action. </p>
        execution_role_arn: <p> The role passed for action execution and reversion. Roles and actions must be in the same account. </p>
        approval_model: <p> This specifies if the action needs manual or automatic approval. </p>

    Raises:
        capo_budgets.errors.access_denied_exception.AccessDeniedException: <p>You are not authorized to use this operation with the given parameters.</p>
        capo_budgets.errors.internal_error_exception.InternalErrorException: <p>An error on the server occurred during the processing of your request. Try again later.</p>
        capo_budgets.errors.invalid_parameter_exception.InvalidParameterException: <p>An error on the client occurred. Typically, the cause is an invalid input value.</p>
        capo_budgets.errors.not_found_exception.NotFoundException: <p>We can’t locate the resource that you specified.</p>
        capo_budgets.errors.resource_locked_exception.ResourceLockedException: <p>The request was received and recognized by the server, but the server rejected that particular method for the requested resource.</p>
        capo_budgets.errors.throttling_exception.ThrottlingException: <p>The number of API requests has exceeded the maximum allowed API request throttling limit for the account.</p>
        capo_budgets.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_budgets.types.update_budget_action_request.UpdateBudgetActionRequest]",
    ) -> OperationResponse[
        "capo_budgets.types.update_budget_action_response.UpdateBudgetActionResponse"
    ]:
        import capo_budgets._operations.aws_budget_service_gateway.update_budget_action

        output, http_response = (
            capo_budgets._operations.aws_budget_service_gateway.update_budget_action.update_budget_action(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_budgets.types.update_budget_action_request.UpdateBudgetActionRequest",
    ) -> dict[str, Any]:
        import capo_budgets.types.update_budget_action_request

        return capo_budgets.types.update_budget_action_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_budgets.types.update_budget_action_response.UpdateBudgetActionResponse",
    ) -> dict[str, Any]:
        import capo_budgets.types.update_budget_action_response

        return capo_budgets.types.update_budget_action_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateBudgetAction",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_budgets.types.update_budget_action_request.UpdateBudgetActionRequest = {
        "account_id": account_id,
        "budget_name": budget_name,
        "action_id": action_id,
    }
    if notification_type is not None:
        input_["notification_type"] = notification_type
    if action_threshold is not None:
        input_["action_threshold"] = action_threshold
    if definition is not None:
        input_["definition"] = definition
    if execution_role_arn is not None:
        input_["execution_role_arn"] = execution_role_arn
    if approval_model is not None:
        input_["approval_model"] = approval_model
    if subscribers is not None:
        input_["subscribers"] = subscribers

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output