list method

Future<ListReportsResponse> list(
  1. String queryId, {
  2. String? orderBy,
  3. int? pageSize,
  4. String? pageToken,
  5. String? $fields,
})

Lists reports associated with a query.

Request parameters:

queryId - Required. ID of the query with which the reports are associated.

orderBy - Name of a field used to order results. The default sorting order is ascending. To specify descending order for a field, append a " desc" suffix. For example "key.reportId desc". Sorting is only supported for the following fields: * key.reportId

pageSize - Maximum number of results per page. Must be between 1 and 100. Defaults to 100 if unspecified.

pageToken - A page token, received from a previous list call. Provide this to retrieve the subsequent page of reports.

$fields - Selector specifying which fields to include in a partial response.

Completes with a ListReportsResponse.

Completes with a commons.ApiRequestError if the API endpoint returned an error.

If the used http.Client completes with an error when making a REST call, this method will complete with the same error.

Implementation

async.Future<ListReportsResponse> list(
  core.String queryId, {
  core.String? orderBy,
  core.int? pageSize,
  core.String? pageToken,
  core.String? $fields,
}) async {
  final queryParams_ = <core.String, core.List<core.String>>{
    if (orderBy != null) 'orderBy': [orderBy],
    if (pageSize != null) 'pageSize': ['${pageSize}'],
    if (pageToken != null) 'pageToken': [pageToken],
    if ($fields != null) 'fields': [$fields],
  };

  final url_ = 'queries/' + commons.escapeVariable('$queryId') + '/reports';

  final response_ = await _requester.request(
    url_,
    'GET',
    queryParams: queryParams_,
  );
  return ListReportsResponse.fromJson(
      response_ as core.Map<core.String, core.dynamic>);
}