dailyRollUp method
- DailyRollUpDataPointsRequest request,
- String parent, {
- String? $fields,
Roll up data points over civil time intervals for supported data types.
request - The metadata request object.
Request parameters:
parent - Required. Parent data type of the Data Point collection.
Format: users/{user}/dataTypes/{data_type}, e.g.: -
users/me/dataTypes/steps - users/me/dataTypes/distance For a list of
the supported data types see the DailyRollupDataPoint value union field.
Value must have pattern ^users/\[^/\]+/dataTypes/\[^/\]+$.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a DailyRollUpDataPointsResponse.
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<DailyRollUpDataPointsResponse> dailyRollUp(
DailyRollUpDataPointsRequest request,
core.String parent, {
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v4/' + core.Uri.encodeFull('$parent') + '/dataPoints:dailyRollUp';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return DailyRollUpDataPointsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}