describeMaintenanceWindowExecutionTasks method

Future<DescribeMaintenanceWindowExecutionTasksResult> describeMaintenanceWindowExecutionTasks({
  1. required String windowExecutionId,
  2. List<MaintenanceWindowFilter>? filters,
  3. int? maxResults,
  4. String? nextToken,
})

For a given maintenance window execution, lists the tasks that were run.

May throw DoesNotExistException. May throw InternalServerError.

Parameter windowExecutionId : The ID of the maintenance window execution whose task executions should be retrieved.

Parameter filters : Optional filters used to scope down the returned tasks. The supported filter key is STATUS with the corresponding values PENDING, IN_PROGRESS, SUCCESS, FAILED, TIMED_OUT, CANCELLING, and CANCELLED.

Parameter maxResults : The maximum number of items to return for this call. The call also returns a token that you can specify in a subsequent call to get the next set of results.

Parameter nextToken : The token for the next set of items to return. (You received this token from a previous call.)

Implementation

Future<DescribeMaintenanceWindowExecutionTasksResult>
    describeMaintenanceWindowExecutionTasks({
  required String windowExecutionId,
  List<MaintenanceWindowFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  ArgumentError.checkNotNull(windowExecutionId, 'windowExecutionId');
  _s.validateStringLength(
    'windowExecutionId',
    windowExecutionId,
    36,
    36,
    isRequired: true,
  );
  _s.validateNumRange(
    'maxResults',
    maxResults,
    10,
    100,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.DescribeMaintenanceWindowExecutionTasks'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'WindowExecutionId': windowExecutionId,
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return DescribeMaintenanceWindowExecutionTasksResult.fromJson(
      jsonResponse.body);
}