cancelMaintenanceWindowExecution method

Future<CancelMaintenanceWindowExecutionResult> cancelMaintenanceWindowExecution({
  1. required String windowExecutionId,
})

Stops a maintenance window execution that is already in progress and cancels any tasks in the window that have not already starting running. (Tasks already in progress will continue to completion.)

May throw InternalServerError. May throw DoesNotExistException.

Parameter windowExecutionId : The ID of the maintenance window execution to stop.

Implementation

Future<CancelMaintenanceWindowExecutionResult>
    cancelMaintenanceWindowExecution({
  required String windowExecutionId,
}) async {
  ArgumentError.checkNotNull(windowExecutionId, 'windowExecutionId');
  _s.validateStringLength(
    'windowExecutionId',
    windowExecutionId,
    36,
    36,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.CancelMaintenanceWindowExecution'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'WindowExecutionId': windowExecutionId,
    },
  );

  return CancelMaintenanceWindowExecutionResult.fromJson(jsonResponse.body);
}