startAutomationEvent method

Future<StartAutomationEventResponse> startAutomationEvent({
  1. required String recommendedActionId,
  2. String? clientToken,
})

Initiates a one-time, on-demand automation for the specified recommended action.

May throw AccessDeniedException. May throw ForbiddenException. May throw IdempotencyTokenInUseException. May throw IdempotentParameterMismatchException. May throw InternalServerException. May throw InvalidParameterValueException. May throw OptInRequiredException. May throw ResourceNotFoundException. May throw ServiceQuotaExceededException. May throw ServiceUnavailableException. May throw ThrottlingException.

Parameter recommendedActionId : The ID of the recommended action to automate.

Parameter clientToken : A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. Must be 1-64 characters long and contain only alphanumeric characters, underscores, and hyphens.

Implementation

Future<StartAutomationEventResponse> startAutomationEvent({
  required String recommendedActionId,
  String? clientToken,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'ComputeOptimizerAutomationService.StartAutomationEvent'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'recommendedActionId': recommendedActionId,
      'clientToken': clientToken ?? _s.generateIdempotencyToken(),
    },
  );

  return StartAutomationEventResponse.fromJson(jsonResponse.body);
}