updateRecommendationLifecycle method

Future<void> updateRecommendationLifecycle({
  1. required UpdateRecommendationLifecycleStage lifecycleStage,
  2. required String recommendationIdentifier,
  3. String? updateReason,
  4. UpdateRecommendationLifecycleStageReasonCode? updateReasonCode,
})

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.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw ValidationException.

Parameter lifecycleStage : The new lifecycle stage

Parameter recommendationIdentifier : The Recommendation identifier for AWS Trusted Advisor Priority recommendations

Parameter updateReason : Reason for the lifecycle stage change

Parameter updateReasonCode : Reason code for the lifecycle state change

Implementation

Future<void> updateRecommendationLifecycle({
  required UpdateRecommendationLifecycleStage lifecycleStage,
  required String recommendationIdentifier,
  String? updateReason,
  UpdateRecommendationLifecycleStageReasonCode? updateReasonCode,
}) async {
  final $payload = <String, dynamic>{
    'lifecycleStage': lifecycleStage.value,
    if (updateReason != null) 'updateReason': updateReason,
    if (updateReasonCode != null) 'updateReasonCode': updateReasonCode.value,
  };
  await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/v1/recommendations/${Uri.encodeComponent(recommendationIdentifier)}/lifecycle',
    exceptionFnMap: _exceptionFns,
  );
}