listServiceEvents method
Lists events for a service.
May throw AccessDeniedException.
May throw InternalServerException.
May throw ResourceNotFoundException.
May throw ValidationException.
Parameter endTime :
The end time for filtering events.
Parameter eventTypes :
Filter events by type.
Parameter startTime :
The start time for filtering events.
Implementation
Future<ListServiceEventsResponse> listServiceEvents({
required String serviceArn,
DateTime? endTime,
List<ServiceEventType>? eventTypes,
int? maxResults,
String? nextToken,
DateTime? startTime,
}) async {
_s.validateNumRange(
'maxResults',
maxResults,
1,
100,
);
final $query = <String, List<String>>{
'serviceArn': [serviceArn],
if (endTime != null) 'endTime': [_s.iso8601ToJson(endTime).toString()],
if (eventTypes != null)
'eventTypes': eventTypes.map((e) => e.value).toList(),
if (maxResults != null) 'maxResults': [maxResults.toString()],
if (nextToken != null) 'nextToken': [nextToken],
if (startTime != null)
'startTime': [_s.iso8601ToJson(startTime).toString()],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/v2/list-service-events',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return ListServiceEventsResponse.fromJson(response);
}