listTestRunEvents method

Future<ListTestRunEventsResponse> listTestRunEvents({
  1. required String serviceArn,
  2. required String testRunId,
  3. DateTime? endedAt,
  4. int? maxResults,
  5. String? nextToken,
  6. DateTime? startedAt,
})

Lists the events in a test run's timeline.

May throw AccessDeniedException. May throw InternalServerException. May throw ResourceNotFoundException. May throw ValidationException.

Parameter serviceArn : The ARN of the service the test run belongs to.

Parameter testRunId : The identifier of the test run to list events for.

Parameter endedAt : Return events at or before this timestamp.

Parameter startedAt : Return events at or after this timestamp.

Implementation

Future<ListTestRunEventsResponse> listTestRunEvents({
  required String serviceArn,
  required String testRunId,
  DateTime? endedAt,
  int? maxResults,
  String? nextToken,
  DateTime? startedAt,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    'serviceArn': [serviceArn],
    if (endedAt != null) 'endedAt': [_s.iso8601ToJson(endedAt).toString()],
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (startedAt != null)
      'startedAt': [_s.iso8601ToJson(startedAt).toString()],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/v2/test-runs/${Uri.encodeComponent(testRunId)}/events',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListTestRunEventsResponse.fromJson(response);
}