Skip to content

update_recommendation_lifecycle

update_recommendation_lifecycle(
    lifecycle_stage: UpdateRecommendationLifecycleStage,
    recommendation_identifier: AccountRecommendationIdentifier,
    *,
    config_overrides: Optional[TrustedAdvisorClientConfig] = None,
    update_reason: Optional[RecommendationUpdateReason] = None,
    update_reason_code: Optional[UpdateRecommendationLifecycleStageReasonCode] = None,
) -> None

Update the lifecyle of a Recommendation. This API only supports prioritized recommendations and updates global priority recommendations, eliminating the need to call the API in each AWS Region.

Parameters:

Raises:

Examples:

Update the lifecycle stage of a Recommendation managed by AWS Trusted Advisor Priority

>>> client.update_recommendation_lifecycle(recommendation_identifier='arn:aws:trustedadvisor::000000000000:recommendation/861c9c6e-f169-405a-8b59-537a8caccd7a', lifecycle_stage='resolved', update_reason_code='valid_business_case', update_reason='Resolved the recommendation')
Source code in docs_src/capo_trustedadvisor/_services/trusted_advisor.py
def update_recommendation_lifecycle(
    self,
    lifecycle_stage: "capo_trustedadvisor.types.update_recommendation_lifecycle_stage.UpdateRecommendationLifecycleStage",
    recommendation_identifier: "capo_trustedadvisor.types.account_recommendation_identifier.AccountRecommendationIdentifier",
    *,
    config_overrides: Optional[TrustedAdvisorClientConfig] = None,
    update_reason: Optional[
        "capo_trustedadvisor.types.recommendation_update_reason.RecommendationUpdateReason"
    ] = None,
    update_reason_code: Optional[
        "capo_trustedadvisor.types.update_recommendation_lifecycle_stage_reason_code.UpdateRecommendationLifecycleStageReasonCode"
    ] = None,
) -> None:
    """<p>Update the lifecyle of a Recommendation. This API only supports prioritized recommendations and updates global priority recommendations, eliminating the need to call the API in each AWS Region.</p>

    Args:
        lifecycle_stage: <p>The new lifecycle stage</p>
        update_reason: <p>Reason for the lifecycle stage change</p>
        update_reason_code: <p>Reason code for the lifecycle state change</p>
        recommendation_identifier: <p>The Recommendation identifier for AWS Trusted Advisor Priority recommendations</p>

    Raises:
        capo_trustedadvisor.errors.access_denied_exception.AccessDeniedException: <p>Exception that access has been denied due to insufficient access</p>
        capo_trustedadvisor.errors.conflict_exception.ConflictException: <p>Exception that the request was denied due to conflictions in state</p>
        capo_trustedadvisor.errors.internal_server_exception.InternalServerException: <p>Exception to notify that an unexpected internal error occurred during processing of the request</p>
        capo_trustedadvisor.errors.resource_not_found_exception.ResourceNotFoundException: <p>Exception that the requested resource has not been found</p>
        capo_trustedadvisor.errors.throttling_exception.ThrottlingException: <p>Exception to notify that requests are being throttled</p>
        capo_trustedadvisor.errors.validation_exception.ValidationException: <p>Exception that the request failed to satisfy service constraints</p>
        capo_trustedadvisor.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        Update the lifecycle stage of a Recommendation managed by AWS Trusted Advisor Priority

        >>> client.update_recommendation_lifecycle(recommendation_identifier='arn:aws:trustedadvisor::000000000000:recommendation/861c9c6e-f169-405a-8b59-537a8caccd7a', lifecycle_stage='resolved', update_reason_code='valid_business_case', update_reason='Resolved the recommendation')
    """

    def _handler(
        req: "OperationRequest[capo_trustedadvisor.types.update_recommendation_lifecycle_request.UpdateRecommendationLifecycleRequest]",
    ) -> OperationResponse[None]:
        import capo_trustedadvisor._operations.trusted_advisor.update_recommendation_lifecycle

        output, http_response = (
            capo_trustedadvisor._operations.trusted_advisor.update_recommendation_lifecycle.update_recommendation_lifecycle(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_trustedadvisor.types.update_recommendation_lifecycle_request.UpdateRecommendationLifecycleRequest",
    ) -> dict[str, Any]:
        import capo_trustedadvisor.types.update_recommendation_lifecycle_request

        return capo_trustedadvisor.types.update_recommendation_lifecycle_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateRecommendationLifecycle", redact_input=_redact_input
        ),
    )
    input_: capo_trustedadvisor.types.update_recommendation_lifecycle_request.UpdateRecommendationLifecycleRequest = {
        "lifecycle_stage": lifecycle_stage,
        "recommendation_identifier": recommendation_identifier,
    }
    if update_reason is not None:
        input_["update_reason"] = update_reason
    if update_reason_code is not None:
        input_["update_reason_code"] = update_reason_code

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