1<html><body> 2<style> 3 4body, h1, h2, h3, div, span, p, pre, a { 5 margin: 0; 6 padding: 0; 7 border: 0; 8 font-weight: inherit; 9 font-style: inherit; 10 font-size: 100%; 11 font-family: inherit; 12 vertical-align: baseline; 13} 14 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51} 52 53.toc_element { 54 margin-top: 0.5em; 55} 56 57.firstline { 58 margin-left: 2 em; 59} 60 61.method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66} 67 68.details { 69 font-weight: bold; 70 font-size: 14px; 71} 72 73</style> 74 75<h1><a href="fitness_v1.html">Fitness API</a> . <a href="fitness_v1.users.html">users</a> . <a href="fitness_v1.users.dataSources.html">dataSources</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="fitness_v1.users.dataSources.dataPointChanges.html">dataPointChanges()</a></code> 79</p> 80<p class="firstline">Returns the dataPointChanges Resource.</p> 81 82<p class="toc_element"> 83 <code><a href="fitness_v1.users.dataSources.datasets.html">datasets()</a></code> 84</p> 85<p class="firstline">Returns the datasets Resource.</p> 86 87<p class="toc_element"> 88 <code><a href="#close">close()</a></code></p> 89<p class="firstline">Close httplib2 connections.</p> 90<p class="toc_element"> 91 <code><a href="#create">create(userId, body=None, x__xgafv=None)</a></code></p> 92<p class="firstline">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.</p> 93<p class="toc_element"> 94 <code><a href="#delete">delete(userId, dataSourceId, x__xgafv=None)</a></code></p> 95<p class="firstline">Deletes the specified data source. The request will fail if the data source contains any data points.</p> 96<p class="toc_element"> 97 <code><a href="#get">get(userId, dataSourceId, x__xgafv=None)</a></code></p> 98<p class="firstline">Returns the specified data source.</p> 99<p class="toc_element"> 100 <code><a href="#list">list(userId, dataTypeName=None, x__xgafv=None)</a></code></p> 101<p class="firstline">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.</p> 102<p class="toc_element"> 103 <code><a href="#update">update(userId, dataSourceId, body=None, x__xgafv=None)</a></code></p> 104<p class="firstline">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.</p> 105<h3>Method Details</h3> 106<div class="method"> 107 <code class="details" id="close">close()</code> 108 <pre>Close httplib2 connections.</pre> 109</div> 110 111<div class="method"> 112 <code class="details" id="create">create(userId, body=None, x__xgafv=None)</code> 113 <pre>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. 114 115Args: 116 userId: string, Create the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. (required) 117 body: object, The request body. 118 The object takes the form of: 119 120{ # 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. 121 "application": { # Information about an application which feeds sensor data into the platform. 122 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 123 "name": "A 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. 124 "packageName": "A 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. 125 "version": "A String", # Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data. 126 }, 127 "dataQualityStandard": [ # 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. 128 "A String", 129 ], 130 "dataStreamId": "A 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. 131 "dataStreamName": "A 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. 132 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 133 "field": [ # A field represents one dimension of a data type. 134 { # 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. 135 "format": "A String", # The different supported formats for each field in a data type. 136 "name": "A 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. 137 "optional": True or False, 138 }, 139 ], 140 "name": "A String", # Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform. 141 }, 142 "device": { # 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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 143 "manufacturer": "A String", # Manufacturer of the product/hardware. 144 "model": "A String", # End-user visible model name for the device. 145 "type": "A String", # A constant representing the type of the device. 146 "uid": "A 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). 147 "version": "A String", # Version string for the device hardware/software. 148 }, 149 "name": "A String", # An end-user visible name for this data source. 150 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 151} 152 153 x__xgafv: string, V1 error format. 154 Allowed values 155 1 - v1 error format 156 2 - v2 error format 157 158Returns: 159 An object of the form: 160 161 { # 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. 162 "application": { # Information about an application which feeds sensor data into the platform. 163 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 164 "name": "A 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. 165 "packageName": "A 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. 166 "version": "A String", # Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data. 167 }, 168 "dataQualityStandard": [ # 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. 169 "A String", 170 ], 171 "dataStreamId": "A 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. 172 "dataStreamName": "A 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. 173 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 174 "field": [ # A field represents one dimension of a data type. 175 { # 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. 176 "format": "A String", # The different supported formats for each field in a data type. 177 "name": "A 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. 178 "optional": True or False, 179 }, 180 ], 181 "name": "A String", # Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform. 182 }, 183 "device": { # 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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 184 "manufacturer": "A String", # Manufacturer of the product/hardware. 185 "model": "A String", # End-user visible model name for the device. 186 "type": "A String", # A constant representing the type of the device. 187 "uid": "A 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). 188 "version": "A String", # Version string for the device hardware/software. 189 }, 190 "name": "A String", # An end-user visible name for this data source. 191 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 192}</pre> 193</div> 194 195<div class="method"> 196 <code class="details" id="delete">delete(userId, dataSourceId, x__xgafv=None)</code> 197 <pre>Deletes the specified data source. The request will fail if the data source contains any data points. 198 199Args: 200 userId: string, Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. (required) 201 dataSourceId: string, The data stream ID of the data source to delete. (required) 202 x__xgafv: string, V1 error format. 203 Allowed values 204 1 - v1 error format 205 2 - v2 error format 206 207Returns: 208 An object of the form: 209 210 { # 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. 211 "application": { # Information about an application which feeds sensor data into the platform. 212 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 213 "name": "A 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. 214 "packageName": "A 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. 215 "version": "A String", # Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data. 216 }, 217 "dataQualityStandard": [ # 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. 218 "A String", 219 ], 220 "dataStreamId": "A 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. 221 "dataStreamName": "A 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. 222 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 223 "field": [ # A field represents one dimension of a data type. 224 { # 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. 225 "format": "A String", # The different supported formats for each field in a data type. 226 "name": "A 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. 227 "optional": True or False, 228 }, 229 ], 230 "name": "A String", # Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform. 231 }, 232 "device": { # 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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 233 "manufacturer": "A String", # Manufacturer of the product/hardware. 234 "model": "A String", # End-user visible model name for the device. 235 "type": "A String", # A constant representing the type of the device. 236 "uid": "A 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). 237 "version": "A String", # Version string for the device hardware/software. 238 }, 239 "name": "A String", # An end-user visible name for this data source. 240 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 241}</pre> 242</div> 243 244<div class="method"> 245 <code class="details" id="get">get(userId, dataSourceId, x__xgafv=None)</code> 246 <pre>Returns the specified data source. 247 248Args: 249 userId: string, Retrieve a data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. (required) 250 dataSourceId: string, The data stream ID of the data source to retrieve. (required) 251 x__xgafv: string, V1 error format. 252 Allowed values 253 1 - v1 error format 254 2 - v2 error format 255 256Returns: 257 An object of the form: 258 259 { # 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. 260 "application": { # Information about an application which feeds sensor data into the platform. 261 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 262 "name": "A 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. 263 "packageName": "A 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. 264 "version": "A String", # Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data. 265 }, 266 "dataQualityStandard": [ # 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. 267 "A String", 268 ], 269 "dataStreamId": "A 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. 270 "dataStreamName": "A 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. 271 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 272 "field": [ # A field represents one dimension of a data type. 273 { # 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. 274 "format": "A String", # The different supported formats for each field in a data type. 275 "name": "A 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. 276 "optional": True or False, 277 }, 278 ], 279 "name": "A String", # Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform. 280 }, 281 "device": { # 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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 282 "manufacturer": "A String", # Manufacturer of the product/hardware. 283 "model": "A String", # End-user visible model name for the device. 284 "type": "A String", # A constant representing the type of the device. 285 "uid": "A 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). 286 "version": "A String", # Version string for the device hardware/software. 287 }, 288 "name": "A String", # An end-user visible name for this data source. 289 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 290}</pre> 291</div> 292 293<div class="method"> 294 <code class="details" id="list">list(userId, dataTypeName=None, x__xgafv=None)</code> 295 <pre>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. 296 297Args: 298 userId: string, List data sources for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. (required) 299 dataTypeName: string, The names of data types to include in the list. If not specified, all data sources will be returned. (repeated) 300 x__xgafv: string, V1 error format. 301 Allowed values 302 1 - v1 error format 303 2 - v2 error format 304 305Returns: 306 An object of the form: 307 308 { 309 "dataSource": [ # A previously created data source. 310 { # 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. 311 "application": { # Information about an application which feeds sensor data into the platform. 312 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 313 "name": "A 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. 314 "packageName": "A 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. 315 "version": "A String", # Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data. 316 }, 317 "dataQualityStandard": [ # 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. 318 "A String", 319 ], 320 "dataStreamId": "A 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. 321 "dataStreamName": "A 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. 322 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 323 "field": [ # A field represents one dimension of a data type. 324 { # 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. 325 "format": "A String", # The different supported formats for each field in a data type. 326 "name": "A 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. 327 "optional": True or False, 328 }, 329 ], 330 "name": "A String", # Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform. 331 }, 332 "device": { # 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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 333 "manufacturer": "A String", # Manufacturer of the product/hardware. 334 "model": "A String", # End-user visible model name for the device. 335 "type": "A String", # A constant representing the type of the device. 336 "uid": "A 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). 337 "version": "A String", # Version string for the device hardware/software. 338 }, 339 "name": "A String", # An end-user visible name for this data source. 340 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 341 }, 342 ], 343}</pre> 344</div> 345 346<div class="method"> 347 <code class="details" id="update">update(userId, dataSourceId, body=None, x__xgafv=None)</code> 348 <pre>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. 349 350Args: 351 userId: string, Update the data source for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. (required) 352 dataSourceId: string, The data stream ID of the data source to update. (required) 353 body: object, The request body. 354 The object takes the form of: 355 356{ # 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. 357 "application": { # Information about an application which feeds sensor data into the platform. 358 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 359 "name": "A 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. 360 "packageName": "A 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. 361 "version": "A String", # Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data. 362 }, 363 "dataQualityStandard": [ # 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. 364 "A String", 365 ], 366 "dataStreamId": "A 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. 367 "dataStreamName": "A 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. 368 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 369 "field": [ # A field represents one dimension of a data type. 370 { # 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. 371 "format": "A String", # The different supported formats for each field in a data type. 372 "name": "A 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. 373 "optional": True or False, 374 }, 375 ], 376 "name": "A String", # Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform. 377 }, 378 "device": { # 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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 379 "manufacturer": "A String", # Manufacturer of the product/hardware. 380 "model": "A String", # End-user visible model name for the device. 381 "type": "A String", # A constant representing the type of the device. 382 "uid": "A 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). 383 "version": "A String", # Version string for the device hardware/software. 384 }, 385 "name": "A String", # An end-user visible name for this data source. 386 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 387} 388 389 x__xgafv: string, V1 error format. 390 Allowed values 391 1 - v1 error format 392 2 - v2 error format 393 394Returns: 395 An object of the form: 396 397 { # 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. 398 "application": { # Information about an application which feeds sensor data into the platform. 399 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 400 "name": "A 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. 401 "packageName": "A 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. 402 "version": "A String", # Version of the application. You should update this field whenever the application changes in a way that affects the computation of the data. 403 }, 404 "dataQualityStandard": [ # 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. 405 "A String", 406 ], 407 "dataStreamId": "A 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. 408 "dataStreamName": "A 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. 409 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 410 "field": [ # A field represents one dimension of a data type. 411 { # 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. 412 "format": "A String", # The different supported formats for each field in a data type. 413 "name": "A 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. 414 "optional": True or False, 415 }, 416 ], 417 "name": "A String", # Each data type has a unique, namespaced, name. All data types in the com.google namespace are shared as part of the platform. 418 }, 419 "device": { # 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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 420 "manufacturer": "A String", # Manufacturer of the product/hardware. 421 "model": "A String", # End-user visible model name for the device. 422 "type": "A String", # A constant representing the type of the device. 423 "uid": "A 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). 424 "version": "A String", # Version string for the device hardware/software. 425 }, 426 "name": "A String", # An end-user visible name for this data source. 427 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 428}</pre> 429</div> 430 431</body></html>