fitness  v1
Public Member Functions | Static Public Member Functions | List of all members
google_fitness_api::DataSource Class Reference

#include <data_source.h>

Inheritance diagram for google_fitness_api::DataSource:

Public Member Functions

 DataSource (const Json::Value &storage)
 
 DataSource (Json::Value *storage)
 
virtual ~DataSource ()
 
const StringPiece GetTypeName () const
 
bool has_application () const
 
void clear_application ()
 
const Application get_application () const
 
Application mutable_application ()
 
bool has_data_quality_standard () const
 
void clear_data_quality_standard ()
 
const client::JsonCppArray< string > get_data_quality_standard () const
 
client::JsonCppArray< string > mutable_dataQualityStandard ()
 
bool has_data_stream_id () const
 
void clear_data_stream_id ()
 
const StringPiece get_data_stream_id () const
 
void set_data_stream_id (const StringPiece &value)
 
bool has_data_stream_name () const
 
void clear_data_stream_name ()
 
const StringPiece get_data_stream_name () const
 
void set_data_stream_name (const StringPiece &value)
 
bool has_data_type () const
 
void clear_data_type ()
 
const DataType get_data_type () const
 
DataType mutable_dataType ()
 
bool has_device () const
 
void clear_device ()
 
const Device get_device () const
 
Device mutable_device ()
 
bool has_name () const
 
void clear_name ()
 
const StringPiece get_name () const
 
void set_name (const StringPiece &value)
 
bool has_type () const
 
void clear_type ()
 
const StringPiece get_type () const
 
void set_type (const StringPiece &value)
 

Static Public Member Functions

static DataSourceNew ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ DataSource() [1/2]

google_fitness_api::DataSource::DataSource ( const Json::Value &  storage)
explicit

Standard constructor for an immutable data object instance.

Parameters
[in]storageThe underlying data storage for this instance.

◆ DataSource() [2/2]

google_fitness_api::DataSource::DataSource ( Json::Value *  storage)
explicit

Standard constructor for a mutable data object instance.

Parameters
[in]storageThe underlying data storage for this instance.

◆ ~DataSource()

google_fitness_api::DataSource::~DataSource ( )
virtual

Standard destructor.

Member Function Documentation

◆ clear_application()

void google_fitness_api::DataSource::clear_application ( )
inline

Clears the 'application' attribute.

◆ clear_data_quality_standard()

void google_fitness_api::DataSource::clear_data_quality_standard ( )
inline

Clears the 'dataQualityStandard' attribute.

◆ clear_data_stream_id()

void google_fitness_api::DataSource::clear_data_stream_id ( )
inline

Clears the 'dataStreamId' attribute.

◆ clear_data_stream_name()

void google_fitness_api::DataSource::clear_data_stream_name ( )
inline

Clears the 'dataStreamName' attribute.

◆ clear_data_type()

void google_fitness_api::DataSource::clear_data_type ( )
inline

Clears the 'dataType' attribute.

◆ clear_device()

void google_fitness_api::DataSource::clear_device ( )
inline

Clears the 'device' attribute.

◆ clear_name()

void google_fitness_api::DataSource::clear_name ( )
inline

Clears the 'name' attribute.

◆ clear_type()

void google_fitness_api::DataSource::clear_type ( )
inline

Clears the 'type' attribute.

◆ get_application()

const Application google_fitness_api::DataSource::get_application ( ) const

Get a reference to the value of the 'application' attribute.

◆ get_data_quality_standard()

const client::JsonCppArray<string > google_fitness_api::DataSource::get_data_quality_standard ( ) const
inline

Get a reference to the value of the 'dataQualityStandard' attribute.

◆ get_data_stream_id()

const StringPiece google_fitness_api::DataSource::get_data_stream_id ( ) const
inline

Get the value of the 'dataStreamId' attribute.

◆ get_data_stream_name()

const StringPiece google_fitness_api::DataSource::get_data_stream_name ( ) const
inline

Get the value of the 'dataStreamName' attribute.

◆ get_data_type()

const DataType google_fitness_api::DataSource::get_data_type ( ) const

Get a reference to the value of the 'dataType' attribute.

◆ get_device()

const Device google_fitness_api::DataSource::get_device ( ) const

Get a reference to the value of the 'device' attribute.

◆ get_name()

const StringPiece google_fitness_api::DataSource::get_name ( ) const
inline

Get the value of the 'name' attribute.

◆ get_type()

const StringPiece google_fitness_api::DataSource::get_type ( ) const
inline

Get the value of the 'type' attribute.

◆ GetTypeName()

const StringPiece google_fitness_api::DataSource::GetTypeName ( ) const
inline

Returns a string denoting the type of this data object.

Returns
google_fitness_api::DataSource

◆ has_application()

bool google_fitness_api::DataSource::has_application ( ) const
inline

Determine if the 'application' attribute was set.

Returns
true if the 'application' attribute was set.

◆ has_data_quality_standard()

bool google_fitness_api::DataSource::has_data_quality_standard ( ) const
inline

Determine if the 'dataQualityStandard' attribute was set.

Returns
true if the 'dataQualityStandard' attribute was set.

◆ has_data_stream_id()

bool google_fitness_api::DataSource::has_data_stream_id ( ) const
inline

Determine if the 'dataStreamId' attribute was set.

Returns
true if the 'dataStreamId' attribute was set.

◆ has_data_stream_name()

bool google_fitness_api::DataSource::has_data_stream_name ( ) const
inline

Determine if the 'dataStreamName' attribute was set.

Returns
true if the 'dataStreamName' attribute was set.

◆ has_data_type()

bool google_fitness_api::DataSource::has_data_type ( ) const
inline

Determine if the 'dataType' attribute was set.

Returns
true if the 'dataType' attribute was set.

◆ has_device()

bool google_fitness_api::DataSource::has_device ( ) const
inline

Determine if the 'device' attribute was set.

Returns
true if the 'device' attribute was set.

◆ has_name()

bool google_fitness_api::DataSource::has_name ( ) const
inline

Determine if the 'name' attribute was set.

Returns
true if the 'name' attribute was set.

◆ has_type()

bool google_fitness_api::DataSource::has_type ( ) const
inline

Determine if the 'type' attribute was set.

Returns
true if the 'type' attribute was set.

◆ mutable_application()

Application google_fitness_api::DataSource::mutable_application ( )

Gets a reference to a mutable value of the 'application' property.

Information about an application which feeds sensor data into the platform.

Returns
The result can be modified to change the attribute value.

◆ mutable_dataQualityStandard()

client::JsonCppArray<string > google_fitness_api::DataSource::mutable_dataQualityStandard ( )
inline

Gets a reference to a mutable value of the 'dataQualityStandard' property.

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.

Returns
The result can be modified to change the attribute value.

◆ mutable_dataType()

DataType google_fitness_api::DataSource::mutable_dataType ( )

Gets a reference to a mutable value of the 'dataType' property.

The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API.

Returns
The result can be modified to change the attribute value.

◆ mutable_device()

Device google_fitness_api::DataSource::mutable_device ( )

Gets a reference to a mutable value of the 'device' property.

Representation of an integrated device (such as a phone or a wearable) that can hold sensors.

Returns
The result can be modified to change the attribute value.

◆ New()

DataSource * google_fitness_api::DataSource::New ( )
static

Creates a new default instance.

Returns
Ownership is passed back to the caller.

◆ set_data_stream_id()

void google_fitness_api::DataSource::set_data_stream_id ( const StringPiece &  value)
inline

Change the 'dataStreamId' attribute.

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.m odel: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.

Parameters
[in]valueThe new value.

◆ set_data_stream_name()

void google_fitness_api::DataSource::set_data_stream_name ( const StringPiece &  value)
inline

Change the 'dataStreamName' attribute.

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.

Parameters
[in]valueThe new value.

◆ set_name()

void google_fitness_api::DataSource::set_name ( const StringPiece &  value)
inline

Change the 'name' attribute.

An end-user visible name for this data source.

Parameters
[in]valueThe new value.

◆ set_type()

void google_fitness_api::DataSource::set_type ( const StringPiece &  value)
inline

Change the 'type' attribute.

A constant describing the type of this data source. Indicates whether this data source produces raw or derived data.

Parameters
[in]valueThe new value.

The documentation for this class was generated from the following files: