npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@datafire/google_fitness

v6.0.0

Published

DataFire integration for Fitness API

Downloads

3

Readme

@datafire/google_fitness

Client library for Fitness API

Installation and Usage

npm install --save @datafire/google_fitness
let google_fitness = require('@datafire/google_fitness').create({
  access_token: "",
  refresh_token: "",
  client_id: "",
  client_secret: "",
  redirect_uri: ""
});

.then(data => {
  console.log(data);
});

Description

The Fitness API for managing users' fitness tracking data.

Actions

oauthCallback

Exchange the code passed to your redirect URI for an access_token

google_fitness.oauthCallback({
  "code": ""
}, context)

Input

  • input object
    • code required string

Output

  • output object
    • access_token string
    • refresh_token string
    • token_type string
    • scope string
    • expiration string

oauthRefresh

Exchange a refresh_token for an access_token

google_fitness.oauthRefresh(null, context)

Input

This action has no parameters

Output

  • output object
    • access_token string
    • refresh_token string
    • token_type string
    • scope string
    • expiration string

fitness.users.dataSources.list

Lists all data sources that are visible to the developer, using the OAuth scopes provided. The list is not exhaustive; the user may have private data sources that are only visible to other developers, or calls using other scopes.

google_fitness.fitness.users.dataSources.list({
  "userId": ""
}, context)

Input

  • input object
    • userId required string: List data sources for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • dataTypeName array: The names of data types to include in the list. If not specified, all data sources will be returned.
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

fitness.users.dataSources.create

Creates a new data source that is unique across all data sources belonging to this user. A data source is a unique source of sensor data. Data sources can expose raw data coming from hardware sensors on local or companion devices. They can also expose derived data, created by transforming or merging other data sources. Multiple data sources can exist for the same data type. Every data point in every dataset inserted into or read from the Fitness API has an associated data source. Each data source produces a unique stream of dataset updates, with a unique data source identifier. Not all changes to data source affect the data stream ID, so that data collected by updated versions of the same application/device can still be considered to belong to the same data source. Data sources are identified using a string generated by the server, based on the contents of the source being created. The dataStreamId field should not be set when invoking this method. It will be automatically generated by the server with the correct format. If a dataStreamId is set, it must match the format that the server would generate. This format is a combination of some fields from the data source, and has a specific order. If it doesn't match, the request will fail with an error. Specifying a DataType which is not a known type (beginning with "com.google.") will create a DataSource with a custom data type. Custom data types are only readable by the application that created them. Custom data types are deprecated; use standard data types instead. In addition to the data source fields included in the data source ID, the developer project number that is authenticated when creating the data source is included. This developer project number is obfuscated when read by any other developer reading public data types.

google_fitness.fitness.users.dataSources.create({
  "userId": ""
}, context)

Input

  • input object
    • userId required string: Create the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • body DataSource
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

fitness.users.dataSources.delete

Deletes the specified data source. The request will fail if the data source contains any data points.

google_fitness.fitness.users.dataSources.delete({
  "userId": "",
  "dataSourceId": ""
}, context)

Input

  • input object
    • userId required string: Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • dataSourceId required string: The data stream ID of the data source to delete.
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

fitness.users.dataSources.get

Returns the specified data source.

google_fitness.fitness.users.dataSources.get({
  "userId": "",
  "dataSourceId": ""
}, context)

Input

  • input object
    • userId required string: Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • dataSourceId required string: The data stream ID of the data source to retrieve.
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

fitness.users.dataSources.update

Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device properties with the exception of version, cannot be modified. Data sources are identified by their dataStreamId.

google_fitness.fitness.users.dataSources.update({
  "userId": "",
  "dataSourceId": ""
}, context)

Input

  • input object
    • userId required string: Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • dataSourceId required string: The data stream ID of the data source to update.
    • body DataSource
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

fitness.users.dataSources.dataPointChanges.list

Queries for user's data point changes for a particular data source.

google_fitness.fitness.users.dataSources.dataPointChanges.list({
  "userId": "",
  "dataSourceId": ""
}, context)

Input

  • input object
    • userId required string: List data points for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • dataSourceId required string: The data stream ID of the data source that created the dataset.
    • limit integer: If specified, no more than this many data point changes will be included in the response.
    • pageToken string: The continuation token, which is used to page through large result sets. To get the next page of results, set this parameter to the value of nextPageToken from the previous response.
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

fitness.users.dataSources.datasets.delete

Performs an inclusive delete of all data points whose start and end times have any overlap with the time range specified by the dataset ID. For most data types, the entire data point will be deleted. For data types where the time span represents a consistent value (such as com.google.activity.segment), and a data point straddles either end point of the dataset, only the overlapping portion of the data point will be deleted.

google_fitness.fitness.users.dataSources.datasets.delete({
  "userId": "",
  "dataSourceId": "",
  "datasetId": ""
}, context)

Input

  • input object
    • userId required string: Delete a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • dataSourceId required string: The data stream ID of the data source that created the dataset.
    • datasetId required string: 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.
    • currentTimeMillis string: The client's current time in milliseconds since epoch.
    • modifiedTimeMillis string: When the operation was performed on the client.
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

Output schema unknown

fitness.users.dataSources.datasets.get

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.

google_fitness.fitness.users.dataSources.datasets.get({
  "userId": "",
  "dataSourceId": "",
  "datasetId": ""
}, context)

Input

  • input object
    • userId required string: Retrieve a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • dataSourceId required string: The data stream ID of the data source that created the dataset.
    • datasetId required string: 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 integer: 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 string: 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.
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

fitness.users.dataSources.datasets.patch

Adds data points to a dataset. The dataset need not be previously created. All points within the given dataset will be returned with subsquent calls to retrieve this dataset. Data points can belong to more than one dataset. This method does not use patch semantics.

google_fitness.fitness.users.dataSources.datasets.patch({
  "userId": "",
  "dataSourceId": "",
  "datasetId": ""
}, context)

Input

  • input object
    • userId required string: Patch a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • dataSourceId required string: The data stream ID of the data source that created the dataset.
    • datasetId required string: 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.
    • currentTimeMillis string: The client's current time in milliseconds since epoch. Note that the minStartTimeNs and maxEndTimeNs properties in the request body are in nanoseconds instead of milliseconds.
    • body Dataset
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

fitness.users.dataset.aggregate

Aggregates data of a certain type or stream into buckets divided by a given type of boundary. Multiple data sets of multiple types and from multiple sources can be aggregated into exactly one bucket type per request.

google_fitness.fitness.users.dataset.aggregate({
  "userId": ""
}, context)

Input

  • input object
    • userId required string: Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • body AggregateRequest
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

fitness.users.sessions.list

Lists sessions previously created.

google_fitness.fitness.users.sessions.list({
  "userId": ""
}, context)

Input

  • input object
    • userId required string: List sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • activityType array: If non-empty, only sessions with these activity types should be returned.
    • endTime string: An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. If this time is omitted but startTime is specified, all sessions from startTime to the end of time will be returned.
    • includeDeleted boolean: If true, and if both startTime and endTime are omitted, session deletions will be returned.
    • pageToken string: The continuation token, which is used for incremental syncing. To get the next batch of changes, set this parameter to the value of nextPageToken from the previous response. The page token is ignored if either start or end time is specified. If none of start time, end time, and the page token is specified, sessions modified in the last 30 days are returned.
    • startTime string: An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. If this time is omitted but endTime is specified, all sessions from the start of time up to endTime will be returned.
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

fitness.users.sessions.delete

Deletes a session specified by the given session ID.

google_fitness.fitness.users.sessions.delete({
  "userId": "",
  "sessionId": ""
}, context)

Input

  • input object
    • userId required string: Delete a session for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • sessionId required string: The ID of the session to be deleted.
    • currentTimeMillis string: The client's current time in milliseconds since epoch.
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

Output schema unknown

fitness.users.sessions.update

Updates or insert a given session.

google_fitness.fitness.users.sessions.update({
  "userId": "",
  "sessionId": ""
}, context)

Input

  • input object
    • userId required string: Create sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
    • sessionId required string: The ID of the session to be created.
    • currentTimeMillis string: The client's current time in milliseconds since epoch.
    • body Session
    • $.xgafv string (values: 1, 2): V1 error format.
    • access_token string: OAuth access token.
    • alt string (values: json, media, proto): Data format for response.
    • callback string: JSONP
    • fields string: Selector specifying which fields to include in a partial response.
    • key string: API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
    • oauth_token string: OAuth 2.0 token for the current user.
    • prettyPrint boolean: Returns response with indentations and line breaks.
    • quotaUser string: Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
    • upload_protocol string: Upload protocol for media (e.g. "raw", "multipart").
    • uploadType string: Legacy upload protocol for media (e.g. "media", "multipart").

Output

Definitions

AggregateBucket

  • AggregateBucket object
    • activity integer: Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT
    • dataset array: There will be one dataset per AggregateBy in the request.
    • endTimeMillis string: The end time for the aggregated data, in milliseconds since epoch, inclusive.
    • session Session
    • startTimeMillis string: The start time for the aggregated data, in milliseconds since epoch, inclusive.
    • type string (values: unknown, time, session, activityType, activitySegment): The type of a bucket signifies how the data aggregation is performed in the bucket.

AggregateBy

  • AggregateBy object: The specification of which data to aggregate.
    • dataSourceId string: A data source ID to aggregate. Only data from the specified data source ID will be included in the aggregation. If specified, this data source must exist; the OAuth scopes in the supplied credentials must grant read access to this data type. The dataset in the response will have the same data source ID. Note: Data can be aggregated by either the dataTypeName or the dataSourceId, not both.
    • dataTypeName string: The data type to aggregate. All data sources providing this data type will contribute data to the aggregation. The response will contain a single dataset for this data type name. The dataset will have a data source ID of derived::com.google.android.gms:aggregated. If the user has no data for this data type, an empty data set will be returned. Note: Data can be aggregated by either the dataTypeName or the dataSourceId, not both.

AggregateRequest

  • AggregateRequest object: Next id: 10
    • aggregateBy array: The specification of data to be aggregated. At least one aggregateBy spec must be provided. All data that is specified will be aggregated using the same bucketing criteria. There will be one dataset in the response for every aggregateBy spec.
    • bucketByActivitySegment BucketByActivity
    • bucketByActivityType BucketByActivity
    • bucketBySession BucketBySession
    • bucketByTime BucketByTime
    • endTimeMillis string: The end of a window of time. Data that intersects with this time window will be aggregated. The time is in milliseconds since epoch, inclusive.
    • filteredDataQualityStandard array: DO NOT POPULATE THIS FIELD. It is ignored.
      • items string (values: dataQualityUnknown, dataQualityBloodPressureEsh2002, dataQualityBloodPressureEsh2010, dataQualityBloodPressureAami, dataQualityBloodPressureBhsAA, dataQualityBloodPressureBhsAB, dataQualityBloodPressureBhsBA, dataQualityBloodPressureBhsBB, dataQualityBloodGlucoseIso151972003, dataQualityBloodGlucoseIso151972013)
    • startTimeMillis string: The start of a window of time. Data that intersects with this time window will be aggregated. The time is in milliseconds since epoch, inclusive.

AggregateResponse

  • AggregateResponse object
    • bucket array: A list of buckets containing the aggregated data.

Application

  • Application object
    • detailsUrl string: An optional URI that can be used to link back to the application.
    • name string: The name of this application. This is required for REST clients, but we do not enforce uniqueness of this name. It is provided as a matter of convenience for other developers who would like to identify which REST created an Application or Data Source.
    • packageName string: Package name for this application. This is used as a unique identifier when created by Android applications, but cannot be specified by REST clients. REST clients will have their developer project number reflected into the Data Source data stream IDs, instead of the packageName.
    • version string: Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data.

BucketByActivity

  • BucketByActivity object
    • activityDataSourceId string: The default activity stream will be used if a specific activityDataSourceId is not specified.
    • minDurationMillis string: Specifies that only activity segments of duration longer than minDurationMillis are considered and used as a container for aggregated data.

BucketBySession

  • BucketBySession object
    • minDurationMillis string: Specifies that only sessions of duration longer than minDurationMillis are considered and used as a container for aggregated data.

BucketByTime

  • BucketByTime object
    • durationMillis string: Specifies that result buckets aggregate data by exactly durationMillis time frames. Time frames that contain no data will be included in the response with an empty dataset.
    • period BucketByTimePeriod

BucketByTimePeriod

  • BucketByTimePeriod object
    • timeZoneId string: org.joda.timezone.DateTimeZone
    • type string (values: day, week, month)
    • value integer

DataPoint

  • DataPoint object: Represents a single data point, generated by a particular data source. A data point holds a value for each field, an end timestamp and an optional start time. The exact semantics of each of these attributes are specified in the documentation for the particular data type. A data point can represent an instantaneous measurement, reading or input observation, as well as averages or aggregates over a time interval. Check the data type documentation to determine which is the case for a particular data type. Data points always contain one value for each field of the data type.
    • computationTimeMillis string: DO NOT USE THIS FIELD. It is ignored, and not stored.
    • dataTypeName string: The data type defining the format of the values in this data point.
    • endTimeNanos string: The end time of the interval represented by this data point, in nanoseconds since epoch.
    • modifiedTimeMillis string: Indicates the last time this data point was modified. Useful only in contexts where we are listing the data changes, rather than representing the current state of the data.
    • originDataSourceId string: If the data point is contained in a dataset for a derived data source, this field will be populated with the data source stream ID that created the data point originally. WARNING: do not rely on this field for anything other than debugging. The value of this field, if it is set at all, is an implementation detail and is not guaranteed to remain consistent.
    • rawTimestampNanos string: The raw timestamp from the original SensorEvent.
    • startTimeNanos string: The start time of the interval represented by this data point, in nanoseconds since epoch.
    • value array: Values of each data type field for the data point. It is expected that each value corresponding to a data type field will occur in the same order that the field is listed with in the data type specified in a data source. Only one of integer and floating point fields will be populated, depending on the format enum value within data source's type field.

DataSource

  • DataSource object: Definition of a unique source of sensor data. Data sources can expose raw data coming from hardware sensors on local or companion devices. They can also expose derived data, created by transforming or merging other data sources. Multiple data sources can exist for the same data type. Every data point inserted into or read from this service has an associated data source. The data source contains enough information to uniquely identify its data, including the hardware device and the application that collected and/or transformed the data. It also holds useful metadata, such as the hardware and application versions, and the device type. Each data source produces a unique stream of data, with a unique identifier. Not all changes to data source affect the stream identifier, so that data collected by updated versions of the same application/device can still be considered to belong to the same data stream.
    • application Application
    • dataQualityStandard array: DO NOT POPULATE THIS FIELD. It is never populated in responses from the platform, and is ignored in queries. It will be removed in a future version entirely.
      • items string (values: dataQualityUnknown, dataQualityBloodPressureEsh2002, dataQualityBloodPressureEsh2010, dataQualityBloodPressureAami, dataQualityBloodPressureBhsAA, dataQualityBloodPressureBhsAB, dataQualityBloodPressureBhsBA, dataQualityBloodPressureBhsBB, dataQualityBloodGlucoseIso151972003, dataQualityBloodGlucoseIso151972013)
    • dataStreamId string: A unique identifier for the data stream produced by this data source. The identifier includes: - The physical device's manufacturer, model, and serial number (UID). - The application's package name or name. Package name is used when the data source was created by an Android application. The developer project number is used when the data source was created by a REST client. - The data source's type. - The data source's stream name. Note that not all attributes of the data source are used as part of the stream identifier. In particular, the version of the hardware/the application isn't used. This allows us to preserve the same stream through version updates. This also means that two DataSource objects may represent the same data stream even if they're not equal. The exact format of the data stream ID created by an Android application is: type:dataType.name:application.packageName:device.manufacturer:device.model:device.uid:dataStreamName The exact format of the data stream ID created by a REST client is: type:dataType.name:developer project number:device.manufacturer:device.model:device.uid:dataStreamName When any of the optional fields that make up the data stream ID are absent, they will be omitted from the data stream ID. The minimum viable data stream ID would be: type:dataType.name:developer project number Finally, the developer project number and device UID are obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the developer project number in clear and normal form. This means a client will see a different set of data_stream_ids than another client with different credentials.
    • dataStreamName string: The stream name uniquely identifies this particular data source among other data sources of the same type from the same underlying producer. Setting the stream name is optional, but should be done whenever an application exposes two streams for the same data type, or when a device has two equivalent sensors.
    • dataType DataType
    • device Device
    • name string: An end-user visible name for this data source.
    • type string (values: raw, derived): A constant describing the type of this data source. Indicates whether this data source produces raw or derived data.

DataType

  • DataType object
    • field array: A field represents one dimension of a data type.
    • name string: Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform.

DataTypeField

  • DataTypeField object: In case of multi-dimensional data (such as an accelerometer with x, y, and z axes) each field represents one dimension. Each data type field has a unique name which identifies it. The field also defines the format of the data (int, float, etc.). This message is only instantiated in code and not used for wire comms or stored in any way.
    • format string (values: integer, floatPoint, string, map, integerList, floatList, blob): The different supported formats for each field in a data type.
    • name string: Defines the name and format of data. Unlike data type names, field names are not namespaced, and only need to be unique within the data type.
    • optional boolean

Dataset

  • Dataset object: A dataset represents a projection container for data points. They do not carry any info of their own. Datasets represent a set of data points from a particular data source. A data point can be found in more than one dataset.
    • dataSourceId string: The data stream ID of the data source that created the points in this dataset.
    • maxEndTimeNs string: The largest end time of all data points in this possibly partial representation of the dataset. Time is in nanoseconds from epoch. This should also match the second part of the dataset identifier.
    • minStartTimeNs string: The smallest start time of all data points in this possibly partial representation of the dataset. Time is in nanoseconds from epoch. This should also match the first part of the dataset identifier.
    • nextPageToken string: This token will be set when a dataset is received in response to a GET request and the dataset is too large to be included in a single response. Provide this value in a subsequent GET request to return the next page of data points within this dataset.
    • point array: A partial list of data points contained in the dataset, ordered by endTimeNanos. This list is considered complete when retrieving a small dataset and partial when patching a dataset or retrieving a dataset that is too large to include in a single response.

Device

  • Device object: Representation of an integrated device (such as a phone or a wearable) that can hold sensors. Each sensor is exposed as a data source. The main purpose of the device information contained in this class is to identify the hardware of a particular data source. This can be useful in different ways, including: - Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance) - Display the source of data to the user (by using the device make / model) - Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone) - Build different analysis models for each device/version.
    • manufacturer string: Manufacturer of the product/hardware.
    • model string: End-user visible model name for the device.
    • type string (values: unknown, phone, tablet, watch, chestStrap, scale, headMounted, smartDisplay): A constant representing the type of the device.
    • uid string: The serial number or other unique ID for the hardware. This field is obfuscated when read by any REST or Android client that did not create the data source. Only the data source creator will see the uid field in clear and normal form. The obfuscation preserves equality; that is, given two IDs, if id1 == id2, obfuscated(id1) == obfuscated(id2).
    • version string: Version string for the device hardware/software.

ListDataPointChangesResponse

  • ListDataPointChangesResponse object
    • dataSourceId string: The data stream ID of the data source with data point changes.
    • deletedDataPoint array: Deleted data points for the user. Note, for modifications this should be parsed before handling insertions.
    • insertedDataPoint array: Inserted data points for the user.
    • nextPageToken string: The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results.

ListDataSourcesResponse

  • ListDataSourcesResponse object
    • dataSource array: A previously created data source.

ListSessionsResponse

  • ListSessionsResponse object
    • deletedSession array: If includeDeleted is set to true in the request, and startTime and endTime are omitted, this will include sessions which were deleted since the last sync.
    • hasMoreData boolean: Flag to indicate server has more data to transfer. DO NOT USE THIS FIELD. It is never populated in responses from the server.
    • nextPageToken string: The sync token which is used to sync further changes. This will only be provided if both startTime and endTime are omitted from the request.
    • session array: Sessions with an end time that is between startTime and endTime of the request.

MapValue

  • MapValue object: Holder object for the value of an entry in a map field of a data point. A map value supports a subset of the formats that the regular Value supports.
    • fpVal number: Floating point value.

Session

  • Session object: Sessions contain metadata, such as a user-friendly name and time interval information.
    • activeTimeMillis string: Session active time. While start_time_millis and end_time_millis define the full session time, the active time can be shorter and specified by active_time_millis. If the inactive time during the session is known, it should also be inserted via a com.google.activity.segment data point with a STILL activity value
    • activityType integer: The type of activity this session represents.
    • application Application
    • description string: A description for this session.
    • endTimeMillis string: An end time, in milliseconds since epoch, inclusive.
    • id string: A client-generated identifier that is unique across all sessions owned by this particular user.
    • modifiedTimeMillis string: A timestamp that indicates when the session was last modified.
    • name string: A human readable name of the session.
    • startTimeMillis string: A start time, in milliseconds since epoch, inclusive.

Value

  • Value object: Holder object for the value of a single field in a data point. A field value has a particular format and is only ever set to one of an integer or a floating point value.
    • fpVal number: Floating point value. When this is set, other values must not be set.
    • intVal integer: Integer value. When this is set, other values must not be set.
    • mapVal array: Map value. The valid key space and units for the corresponding value of each entry should be documented as part of the data type definition. Keys should be kept small whenever possible. Data streams with large keys and high data frequency may be down sampled.
    • stringVal string: String value. When this is set, other values must not be set. Strings should be kept small whenever possible. Data streams with large string values and high data frequency may be down sampled.

ValueMapValEntry

  • ValueMapValEntry object