listOpsItemEvents method

Future<ListOpsItemEventsResponse> listOpsItemEvents({
  1. List<OpsItemEventFilter>? filters,
  2. int? maxResults,
  3. String? nextToken,
})

Returns a list of all OpsItem events in the current AWS account and Region. You can limit the results to events associated with specific OpsItems by specifying a filter.

May throw InternalServerError. May throw OpsItemNotFoundException. May throw OpsItemLimitExceededException. May throw OpsItemInvalidParameterException.

Parameter filters : One or more OpsItem filters. Use a filter to return a more specific list of results.

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 : A token to start the list. Use this token to get the next set of results.

Implementation

Future<ListOpsItemEventsResponse> listOpsItemEvents({
  List<OpsItemEventFilter>? filters,
  int? maxResults,
  String? nextToken,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    50,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonSSM.ListOpsItemEvents'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (filters != null) 'Filters': filters,
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
    },
  );

  return ListOpsItemEventsResponse.fromJson(jsonResponse.body);
}