Skip to content

update_organization_recommendation_lifecycle

update_organization_recommendation_lifecycle(
    lifecycle_stage: UpdateRecommendationLifecycleStage,
    organization_recommendation_identifier: OrganizationRecommendationIdentifier,
    *,
    config_overrides: Optional[TrustedAdvisorClientConfig] = None,
    update_reason: Optional[RecommendationUpdateReason] = None,
    update_reason_code: Optional[UpdateRecommendationLifecycleStageReasonCode] = None,
) -> None

Update the lifecycle of a Recommendation within an Organization. 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 an AWS Organization's Recommendation that is managed by AWS Trusted Advisor Priority

>>> client.update_organization_recommendation_lifecycle(organization_recommendation_identifier='arn:aws:trustedadvisor:::organization-recommendation/96b5e5ca-7930-444c-90c6-06d386128100', lifecycle_stage='dismissed', update_reason_code='not_applicable', update_reason='Does not apply to this resource')
Source code in docs_src/capo_trustedadvisor/_services/trusted_advisor.py
def update_organization_recommendation_lifecycle(
    self,
    lifecycle_stage: "capo_trustedadvisor.types.update_recommendation_lifecycle_stage.UpdateRecommendationLifecycleStage",
    organization_recommendation_identifier: "capo_trustedadvisor.types.organization_recommendation_identifier.OrganizationRecommendationIdentifier",
    *,
    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 lifecycle of a Recommendation within an Organization. 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>
        organization_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 an AWS Organization's Recommendation that is managed by AWS Trusted Advisor Priority

        >>> client.update_organization_recommendation_lifecycle(organization_recommendation_identifier='arn:aws:trustedadvisor:::organization-recommendation/96b5e5ca-7930-444c-90c6-06d386128100', lifecycle_stage='dismissed', update_reason_code='not_applicable', update_reason='Does not apply to this resource')
    """

    def _handler(
        req: "OperationRequest[capo_trustedadvisor.types.update_organization_recommendation_lifecycle_request.UpdateOrganizationRecommendationLifecycleRequest]",
    ) -> OperationResponse[None]:
        import capo_trustedadvisor._operations.trusted_advisor.update_organization_recommendation_lifecycle

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

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

        return capo_trustedadvisor.types.update_organization_recommendation_lifecycle_request.redact_sensitive(
            input_
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateOrganizationRecommendationLifecycle", redact_input=_redact_input
        ),
    )
    input_: capo_trustedadvisor.types.update_organization_recommendation_lifecycle_request.UpdateOrganizationRecommendationLifecycleRequest = {
        "lifecycle_stage": lifecycle_stage,
        "organization_recommendation_identifier": organization_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