listReports method

Future<ListReportsResponse> listReports({
  1. int? maxResults,
  2. String? nextToken,
  3. ReportType? reportType,
  4. String? serviceArn,
  5. String? testRunId,
})

List reports for a service, or all reports owned by the account if serviceArn is not provided.

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

Parameter reportType : Filter reports by type.

Parameter serviceArn : Optional. If not provided, lists all reports owned by the account.

Implementation

Future<ListReportsResponse> listReports({
  int? maxResults,
  String? nextToken,
  ReportType? reportType,
  String? serviceArn,
  String? testRunId,
}) async {
  _s.validateNumRange(
    'maxResults',
    maxResults,
    1,
    100,
  );
  final $query = <String, List<String>>{
    if (maxResults != null) 'maxResults': [maxResults.toString()],
    if (nextToken != null) 'nextToken': [nextToken],
    if (reportType != null) 'reportType': [reportType.value],
    if (serviceArn != null) 'serviceArn': [serviceArn],
    if (testRunId != null) 'testRunId': [testRunId],
  };
  final response = await _protocol.send(
    payload: null,
    method: 'GET',
    requestUri: '/v2/list-reports',
    queryParams: $query,
    exceptionFnMap: _exceptionFns,
  );
  return ListReportsResponse.fromJson(response);
}