list method

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

Lists queries created by the current user.

Request parameters:

orderBy - Field to sort the list by. Accepts the following values: * queryId (default) * metadata.title The default sorting order is ascending. To specify descending order for a field, add the suffix desc to the field name. For example, queryId 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.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 ListQueriesResponse.

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<ListQueriesResponse> list({
  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],
  };

  const url_ = 'queries';

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