google_api_fitness v0.4.0 GoogleApi.Fitness.V1.Api.Users View Source

API calls for all endpoints tagged Users.

Link to this section Summary

Functions

Creates a new data source that is unique across all data sources belonging to this user. The data stream ID field can be omitted and will be generated by the server with the correct format. The data stream ID is an ordered combination of some fields from the data source. In addition to the data source fields reflected into 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.

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.

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.

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.

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

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.

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.

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 aggreated into exactly one bucket type per request.

Link to this section Functions

Link to this function

fitness_users_data_sources_create(connection, user_id, optional_params \\ [], opts \\ []) View Source

Creates a new data source that is unique across all data sources belonging to this user. The data stream ID field can be omitted and will be generated by the server with the correct format. The data stream ID is an ordered combination of some fields from the data source. In addition to the data source fields reflected into 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.

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): Create the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.
    • :body (DataSource):

Returns

{:ok, %GoogleApi.Fitness.V1.Model.DataSource{}} on success {:error, info} on failure

Link to this function

fitness_users_data_sources_data_point_changes_list(connection, user_id, data_source_id, optional_params \\ [], opts \\ []) View Source

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

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): List data points for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • data_source_id (String.t): The data stream ID of the data source that created the dataset.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.
    • :limit (integer()): If specified, no more than this many data point changes will be included in the response.
    • :pageToken (String.t): 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.

Returns

{:ok, %GoogleApi.Fitness.V1.Model.ListDataPointChangesResponse{}} on success {:error, info} on failure

Link to this function

fitness_users_data_sources_datasets_delete(connection, user_id, data_source_id, dataset_id, optional_params \\ [], opts \\ []) View Source

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.

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): Delete a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • data_source_id (String.t): The data stream ID of the data source that created the dataset.
  • dataset_id (String.t): 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.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.
    • :currentTimeMillis (String.t): The client's current time in milliseconds since epoch.
    • :modifiedTimeMillis (String.t): When the operation was performed on the client.

Returns

{:ok, %{}} on success {:error, info} on failure

Link to this function

fitness_users_data_sources_datasets_get(connection, user_id, data_source_id, dataset_id, optional_params \\ [], opts \\ []) View Source

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.

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): Retrieve a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • data_source_id (String.t): The data stream ID of the data source that created the dataset.
  • dataset_id (String.t): 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.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.
    • :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.
    • :pageToken (String.t): 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.

Returns

{:ok, %GoogleApi.Fitness.V1.Model.Dataset{}} on success {:error, info} on failure

Link to this function

fitness_users_data_sources_datasets_patch(connection, user_id, data_source_id, dataset_id, optional_params \\ [], opts \\ []) View Source

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.

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): Patch a dataset for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • data_source_id (String.t): The data stream ID of the data source that created the dataset.
  • dataset_id (String.t): 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.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.
    • :currentTimeMillis (String.t): 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):

Returns

{:ok, %GoogleApi.Fitness.V1.Model.Dataset{}} on success {:error, info} on failure

Link to this function

fitness_users_data_sources_delete(connection, user_id, data_source_id, optional_params \\ [], opts \\ []) View Source

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

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • data_source_id (String.t): The data stream ID of the data source to delete.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.

Returns

{:ok, %GoogleApi.Fitness.V1.Model.DataSource{}} on success {:error, info} on failure

Link to this function

fitness_users_data_sources_get(connection, user_id, data_source_id, optional_params \\ [], opts \\ []) View Source

Returns the specified data source.

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • data_source_id (String.t): The data stream ID of the data source to retrieve.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.

Returns

{:ok, %GoogleApi.Fitness.V1.Model.DataSource{}} on success {:error, info} on failure

Link to this function

fitness_users_data_sources_list(connection, user_id, optional_params \\ [], opts \\ []) View Source

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.

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): List data sources for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.
    • :dataTypeName ([String.t]): The names of data types to include in the list. If not specified, all data sources will be returned.

Returns

{:ok, %GoogleApi.Fitness.V1.Model.ListDataSourcesResponse{}} on success {:error, info} on failure

Link to this function

fitness_users_data_sources_update(connection, user_id, data_source_id, optional_params \\ [], opts \\ []) View Source

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.

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • data_source_id (String.t): The data stream ID of the data source to update.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.
    • :body (DataSource):

Returns

{:ok, %GoogleApi.Fitness.V1.Model.DataSource{}} on success {:error, info} on failure

Link to this function

fitness_users_dataset_aggregate(connection, user_id, optional_params \\ [], opts \\ []) View Source

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 aggreated into exactly one bucket type per request.

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): Aggregate data for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.
    • :body (AggregateRequest):

Returns

{:ok, %GoogleApi.Fitness.V1.Model.AggregateResponse{}} on success {:error, info} on failure

Link to this function

fitness_users_sessions_delete(connection, user_id, session_id, optional_params \\ [], opts \\ []) View Source

Deletes a session specified by the given session ID.

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): Delete a session for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • session_id (String.t): The ID of the session to be deleted.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.
    • :currentTimeMillis (String.t): The client's current time in milliseconds since epoch.

Returns

{:ok, %{}} on success {:error, info} on failure

Link to this function

fitness_users_sessions_list(connection, user_id, optional_params \\ [], opts \\ []) View Source

Lists sessions previously created.

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): List sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.
    • :endTime (String.t): An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response.
    • :includeDeleted (boolean()): If true, deleted sessions will be returned. When set to true, sessions returned in this response will only have an ID and will not have any other fields.
    • :pageToken (String.t): 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. This token is treated as a timestamp (in millis since epoch). If specified, the API returns sessions modified since this time. 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.t): An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response.

Returns

{:ok, %GoogleApi.Fitness.V1.Model.ListSessionsResponse{}} on success {:error, info} on failure

Link to this function

fitness_users_sessions_update(connection, user_id, session_id, optional_params \\ [], opts \\ []) View Source

Updates or insert a given session.

Parameters

  • connection (GoogleApi.Fitness.V1.Connection): Connection to server
  • user_id (String.t): Create sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time.
  • session_id (String.t): The ID of the session to be created.
  • optional_params (KeywordList): [optional] Optional parameters

    • :alt (String.t): Data format for the response.
    • :fields (String.t): Selector specifying which fields to include in a partial response.
    • :key (String.t): 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.t): OAuth 2.0 token for the current user.
    • :prettyPrint (boolean()): Returns response with indentations and line breaks.
    • :quotaUser (String.t): An opaque string that represents a user for quota purposes. Must not exceed 40 characters.
    • :userIp (String.t): Deprecated. Please use quotaUser instead.
    • :currentTimeMillis (String.t): The client's current time in milliseconds since epoch.
    • :body (Session):

Returns

{:ok, %GoogleApi.Fitness.V1.Model.Session{}} on success {:error, info} on failure