list method
Lists reports generated by the provided query.
Request parameters:
queryId
- Required. The ID of the query that generated the reports.
orderBy
- Field to sort the list by. Accepts the following values: *
key.reportId
(default) The default sorting order is ascending. To
specify descending order for a field, add the suffix desc
to the field
name. For example, key.reportId desc
.
pageSize
- Maximum number of results per page. Must be between 1
and
100
. Defaults to 100
if unspecified.
pageToken
- A token identifying which page of results the server should
return. Typically, this is the value of nextPageToken returned from the
previous call to the queries.reports.list
method. If unspecified, the
first page of results is returned.
$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>);
}