list method
Retrieves table data from a specified set of rows.
Requires the READER dataset role.
Request parameters:
projectId
- Project ID of the table to read
datasetId
- Dataset ID of the table to read
tableId
- Table ID of the table to read
maxResults
- Maximum number of results to return
pageToken
- Page token, returned by a previous call, identifying the
result set
selectedFields
- List of fields to return (comma-separated). If
unspecified, all fields are returned
startIndex
- Zero-based index of the starting row to read
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a TableDataList.
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<TableDataList> list(
core.String projectId,
core.String datasetId,
core.String tableId, {
core.int? maxResults,
core.String? pageToken,
core.String? selectedFields,
core.String? startIndex,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (maxResults != null) 'maxResults': ['${maxResults}'],
if (pageToken != null) 'pageToken': [pageToken],
if (selectedFields != null) 'selectedFields': [selectedFields],
if (startIndex != null) 'startIndex': [startIndex],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'projects/' +
commons.escapeVariable('$projectId') +
'/datasets/' +
commons.escapeVariable('$datasetId') +
'/tables/' +
commons.escapeVariable('$tableId') +
'/data';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return TableDataList.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}