reconcile method
Reconcile data points from multiple data sources into a single data stream.
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/1234567890/dataTypes/steps -
users/me/dataTypes/heart-rate - users/1234567890/dataTypes/heart-rate
The {user} can be either the alias me or the authenticated user's
numeric Health User ID (retrieved via GetIdentity). For a list of the
supported data types see the DataPoint data union field.
Value must have pattern ^users/\[^/\]+/dataTypes/\[^/\]+$.
dataSourceFamily - Optional. The data source family name to reconcile.
If empty, data points from all data sources will be reconciled. Format:
users/{user}/dataSourceFamilies/{data_source_family} The {user} can be
either the alias me or the authenticated user's numeric Health User ID,
retrieved via GetIdentity (e.g. users/me/dataSourceFamilies/... or
users/1234567890/dataSourceFamilies/...). The supported values are: -
users/{user}/dataSourceFamilies/all-sources - Default value. Includes
data from all available data sources. -
users/{user}/dataSourceFamilies/google-wearables - Includes data from
Google and Fitbit tracker devices (such as Fitbit trackers and Pixel
Watch). Excludes manually logged data. -
users/{user}/dataSourceFamilies/google-sources - Includes first-party
Google data, such as data from tracker devices, manually logged data, and
Health Connect. - users/{user}/dataSourceFamilies/self-sources -
Includes only the data the calling client wrote through this API, that is,
data points whose data source was registered through this API with the
same OAuth client ID as the caller. Callers that were only granted write
scopes for the requested data type may only read the data they wrote
themselves: their requests are implicitly restricted to self-sources,
and requesting any other data source family fails with
PERMISSION_DENIED. If no data point matches the requested data source
family, the response is an empty list rather than an error.
filter - Optional. Filter expression based on https://aip.dev/160. A
time range, either physical or civil, can be specified. See the
ListDataPointsRequest.filter for the supported fields and syntax.
pageSize - Optional. The maximum number of data points to return. If
unspecified, at most 1440 data points will be returned. The maximum page
size is 10000; values above that will be truncated accordingly. For
exercise and sleep the default page size is 25. The maximum page size
for exercise and sleep is 25.
pageToken - Optional. The next_page_token from a previous request, if
any.
$fields - Selector specifying which fields to include in a partial
response.
Completes with a ReconcileDataPointsResponse.
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<ReconcileDataPointsResponse> reconcile(
core.String parent, {
core.String? dataSourceFamily,
core.String? filter,
core.int? pageSize,
core.String? pageToken,
core.String? $fields,
}) async {
final queryParams_ = <core.String, core.List<core.String>>{
'dataSourceFamily': ?dataSourceFamily == null ? null : [dataSourceFamily],
'filter': ?filter == null ? null : [filter],
'pageSize': ?pageSize == null ? null : ['${pageSize}'],
'pageToken': ?pageToken == null ? null : [pageToken],
'fields': ?$fields == null ? null : [$fields],
};
final url_ =
'v4/' + core.Uri.encodeFull('$parent') + '/dataPoints:reconcile';
final response_ = await _requester.request(
url_,
'GET',
queryParams: queryParams_,
);
return ReconcileDataPointsResponse.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}