describeEvents method

Future<DescribeEventsResponse> describeEvents({
  1. int? duration,
  2. DateTime? endTime,
  3. int? maxResults,
  4. String? nextToken,
  5. String? sourceName,
  6. SourceType? sourceType,
  7. DateTime? startTime,
})

Returns events related to DAX clusters and parameter groups. You can obtain events specific to a particular DAX cluster or parameter group by providing the name as a parameter.

By default, only the events occurring within the last 24 hours are returned; however, you can retrieve up to 14 days' worth of events if necessary.

May throw ServiceLinkedRoleNotFoundFault. May throw InvalidParameterValueException. May throw InvalidParameterCombinationException.

Parameter duration : The number of minutes' worth of events to retrieve.

Parameter endTime : The end of the time interval for which to retrieve events, specified in ISO 8601 format.

Parameter maxResults : The maximum number of results to include in the response. If more results exist than the specified MaxResults value, a token is included in the response so that the remaining results can be retrieved.

The value for MaxResults must be between 20 and 100.

Parameter nextToken : An optional token returned from a prior request. Use this token for pagination of results from this action. If this parameter is specified, the response includes only results beyond the token, up to the value specified by MaxResults.

Parameter sourceName : The identifier of the event source for which events will be returned. If not specified, then all sources are included in the response.

Parameter sourceType : The event source to retrieve events for. If no value is specified, all events are returned.

Parameter startTime : The beginning of the time interval to retrieve events for, specified in ISO 8601 format.

Implementation

Future<DescribeEventsResponse> describeEvents({
  int? duration,
  DateTime? endTime,
  int? maxResults,
  String? nextToken,
  String? sourceName,
  SourceType? sourceType,
  DateTime? startTime,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AmazonDAXV3.DescribeEvents'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      if (duration != null) 'Duration': duration,
      if (endTime != null) 'EndTime': unixTimestampToJson(endTime),
      if (maxResults != null) 'MaxResults': maxResults,
      if (nextToken != null) 'NextToken': nextToken,
      if (sourceName != null) 'SourceName': sourceName,
      if (sourceType != null) 'SourceType': sourceType.toValue(),
      if (startTime != null) 'StartTime': unixTimestampToJson(startTime),
    },
  );

  return DescribeEventsResponse.fromJson(jsonResponse.body);
}