get method
Returns a dataset containing all data points whose start and end times overlap with the specified range of the dataset minimum start time and maximum end time.
Specifically, any data point whose start time is less than or equal to the dataset end time and whose end time is greater than or equal to the dataset start time.
Request parameters:
userId
- Retrieve a dataset for the person identified. Use me to
indicate the authenticated user. Only me is supported at this time.
dataSourceId
- The data stream ID of the data source that created the
dataset.
datasetId
- Dataset identifier that is a composite of the minimum data
point start time and maximum data point end time represented as
nanoseconds from the epoch. The ID is formatted like: "startTime-endTime"
where startTime and endTime are 64 bit integers.
limit
- If specified, no more than this many data points will be
included in the dataset. If there are more data points in the dataset,
nextPageToken will be set in the dataset response. The limit is applied
from the end of the time range. That is, if pageToken is absent, the limit
most recent data points will be returned.
pageToken
- The continuation token, which is used to page through large
datasets. To get the next page of a dataset, set this parameter to the
value of nextPageToken from the previous response. Each subsequent call
will yield a partial dataset with data point end timestamps that are
strictly smaller than those in the previous partial response.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a Dataset.
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<Dataset> get(
core.String userId,
core.String dataSourceId,
core.String datasetId, {
core.int? limit,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
if (limit != null) 'limit': ['${limit}'],
if (pageToken != null) 'pageToken': [pageToken],
if ($fields != null) 'fields': [$fields],
};
final url_ = commons.escapeVariable('$userId') +
'/dataSources/' +
commons.escapeVariable('$dataSourceId') +
'/datasets/' +
commons.escapeVariable('$datasetId');
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return Dataset.fromJson(response_ as core.Map<core.String, core.dynamic>);
}