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</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="#create">create(userId, body)</a></code></p> 89<p class="firstline">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.</p> 90<p class="toc_element"> 91 <code><a href="#delete">delete(userId, dataSourceId)</a></code></p> 92<p class="firstline">Deletes the specified data source. The request will fail if the data source contains any data points.</p> 93<p class="toc_element"> 94 <code><a href="#get">get(userId, dataSourceId)</a></code></p> 95<p class="firstline">Returns the specified data source.</p> 96<p class="toc_element"> 97 <code><a href="#list">list(userId, dataTypeName=None)</a></code></p> 98<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> 99<p class="toc_element"> 100 <code><a href="#update">update(userId, dataSourceId, body)</a></code></p> 101<p class="firstline">Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device properties with the exception of version, cannot be modified.</p> 102<h3>Method Details</h3> 103<div class="method"> 104 <code class="details" id="create">create(userId, body)</code> 105 <pre>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. 106 107Args: 108 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) 109 body: object, The request body. (required) 110 The object takes the form of: 111 112{ # 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. 113 # 114 # 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. 115 # 116 # 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. 117 "name": "A String", # An end-user visible name for this data source. 118 "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. 119 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 120 "field": [ # A field represents one dimension of a data type. 121 { # 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.). 122 # 123 # This message is only instantiated in code and not used for wire comms or stored in any way. 124 "optional": True or False, 125 "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. 126 "format": "A String", # The different supported formats for each field in a data type. 127 }, 128 ], 129 "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. 130 }, 131 "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. 132 "A String", 133 ], 134 "application": { # Information about an application which feeds sensor data into the platform. 135 "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. 136 "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. 137 "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. 138 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 139 }, 140 "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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 141 # 142 # 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: 143 # - Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance) 144 # - Display the source of data to the user (by using the device make / model) 145 # - Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone) 146 # - Build different analysis models for each device/version. 147 "model": "A String", # End-user visible model name for the device. 148 "version": "A String", # Version string for the device hardware/software. 149 "type": "A String", # A constant representing the type of the device. 150 "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. 151 "manufacturer": "A String", # Manufacturer of the product/hardware. 152 }, 153 "dataStreamId": "A String", # A unique identifier for the data stream produced by this data source. The identifier includes: 154 # 155 # 156 # - The physical device's manufacturer, model, and serial number (UID). 157 # - 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. 158 # - The data source's type. 159 # - 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. 160 # 161 # 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 162 # 163 # 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 164 # 165 # 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 166 # 167 # Finally, the developer project number 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 developer project number in clear and normal form. 168 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 169 } 170 171 172Returns: 173 An object of the form: 174 175 { # 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. 176 # 177 # 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. 178 # 179 # 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. 180 "name": "A String", # An end-user visible name for this data source. 181 "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. 182 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 183 "field": [ # A field represents one dimension of a data type. 184 { # 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.). 185 # 186 # This message is only instantiated in code and not used for wire comms or stored in any way. 187 "optional": True or False, 188 "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. 189 "format": "A String", # The different supported formats for each field in a data type. 190 }, 191 ], 192 "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. 193 }, 194 "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. 195 "A String", 196 ], 197 "application": { # Information about an application which feeds sensor data into the platform. 198 "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. 199 "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. 200 "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. 201 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 202 }, 203 "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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 204 # 205 # 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: 206 # - Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance) 207 # - Display the source of data to the user (by using the device make / model) 208 # - Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone) 209 # - Build different analysis models for each device/version. 210 "model": "A String", # End-user visible model name for the device. 211 "version": "A String", # Version string for the device hardware/software. 212 "type": "A String", # A constant representing the type of the device. 213 "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. 214 "manufacturer": "A String", # Manufacturer of the product/hardware. 215 }, 216 "dataStreamId": "A String", # A unique identifier for the data stream produced by this data source. The identifier includes: 217 # 218 # 219 # - The physical device's manufacturer, model, and serial number (UID). 220 # - 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. 221 # - The data source's type. 222 # - 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. 223 # 224 # 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 225 # 226 # 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 227 # 228 # 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 229 # 230 # Finally, the developer project number 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 developer project number in clear and normal form. 231 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 232 }</pre> 233</div> 234 235<div class="method"> 236 <code class="details" id="delete">delete(userId, dataSourceId)</code> 237 <pre>Deletes the specified data source. The request will fail if the data source contains any data points. 238 239Args: 240 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) 241 dataSourceId: string, The data stream ID of the data source to delete. (required) 242 243Returns: 244 An object of the form: 245 246 { # 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. 247 # 248 # 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. 249 # 250 # 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. 251 "name": "A String", # An end-user visible name for this data source. 252 "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. 253 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 254 "field": [ # A field represents one dimension of a data type. 255 { # 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.). 256 # 257 # This message is only instantiated in code and not used for wire comms or stored in any way. 258 "optional": True or False, 259 "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. 260 "format": "A String", # The different supported formats for each field in a data type. 261 }, 262 ], 263 "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. 264 }, 265 "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. 266 "A String", 267 ], 268 "application": { # Information about an application which feeds sensor data into the platform. 269 "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. 270 "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. 271 "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. 272 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 273 }, 274 "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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 275 # 276 # 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: 277 # - Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance) 278 # - Display the source of data to the user (by using the device make / model) 279 # - Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone) 280 # - Build different analysis models for each device/version. 281 "model": "A String", # End-user visible model name for the device. 282 "version": "A String", # Version string for the device hardware/software. 283 "type": "A String", # A constant representing the type of the device. 284 "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. 285 "manufacturer": "A String", # Manufacturer of the product/hardware. 286 }, 287 "dataStreamId": "A String", # A unique identifier for the data stream produced by this data source. The identifier includes: 288 # 289 # 290 # - The physical device's manufacturer, model, and serial number (UID). 291 # - 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. 292 # - The data source's type. 293 # - 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. 294 # 295 # 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 296 # 297 # 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 298 # 299 # 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 300 # 301 # Finally, the developer project number 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 developer project number in clear and normal form. 302 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 303 }</pre> 304</div> 305 306<div class="method"> 307 <code class="details" id="get">get(userId, dataSourceId)</code> 308 <pre>Returns the specified data source. 309 310Args: 311 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) 312 dataSourceId: string, The data stream ID of the data source to retrieve. (required) 313 314Returns: 315 An object of the form: 316 317 { # 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. 318 # 319 # 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. 320 # 321 # 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. 322 "name": "A String", # An end-user visible name for this data source. 323 "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. 324 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 325 "field": [ # A field represents one dimension of a data type. 326 { # 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.). 327 # 328 # This message is only instantiated in code and not used for wire comms or stored in any way. 329 "optional": True or False, 330 "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. 331 "format": "A String", # The different supported formats for each field in a data type. 332 }, 333 ], 334 "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. 335 }, 336 "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. 337 "A String", 338 ], 339 "application": { # Information about an application which feeds sensor data into the platform. 340 "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. 341 "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. 342 "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. 343 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 344 }, 345 "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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 346 # 347 # 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: 348 # - Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance) 349 # - Display the source of data to the user (by using the device make / model) 350 # - Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone) 351 # - Build different analysis models for each device/version. 352 "model": "A String", # End-user visible model name for the device. 353 "version": "A String", # Version string for the device hardware/software. 354 "type": "A String", # A constant representing the type of the device. 355 "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. 356 "manufacturer": "A String", # Manufacturer of the product/hardware. 357 }, 358 "dataStreamId": "A String", # A unique identifier for the data stream produced by this data source. The identifier includes: 359 # 360 # 361 # - The physical device's manufacturer, model, and serial number (UID). 362 # - 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. 363 # - The data source's type. 364 # - 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. 365 # 366 # 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 367 # 368 # 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 369 # 370 # 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 371 # 372 # Finally, the developer project number 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 developer project number in clear and normal form. 373 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 374 }</pre> 375</div> 376 377<div class="method"> 378 <code class="details" id="list">list(userId, dataTypeName=None)</code> 379 <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. 380 381Args: 382 userId: string, List data sources for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. (required) 383 dataTypeName: string, The names of data types to include in the list. If not specified, all data sources will be returned. (repeated) 384 385Returns: 386 An object of the form: 387 388 { 389 "dataSource": [ # A previously created data source. 390 { # 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. 391 # 392 # 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. 393 # 394 # 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. 395 "name": "A String", # An end-user visible name for this data source. 396 "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. 397 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 398 "field": [ # A field represents one dimension of a data type. 399 { # 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.). 400 # 401 # This message is only instantiated in code and not used for wire comms or stored in any way. 402 "optional": True or False, 403 "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. 404 "format": "A String", # The different supported formats for each field in a data type. 405 }, 406 ], 407 "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. 408 }, 409 "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. 410 "A String", 411 ], 412 "application": { # Information about an application which feeds sensor data into the platform. 413 "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. 414 "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. 415 "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. 416 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 417 }, 418 "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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 419 # 420 # 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: 421 # - Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance) 422 # - Display the source of data to the user (by using the device make / model) 423 # - Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone) 424 # - Build different analysis models for each device/version. 425 "model": "A String", # End-user visible model name for the device. 426 "version": "A String", # Version string for the device hardware/software. 427 "type": "A String", # A constant representing the type of the device. 428 "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. 429 "manufacturer": "A String", # Manufacturer of the product/hardware. 430 }, 431 "dataStreamId": "A String", # A unique identifier for the data stream produced by this data source. The identifier includes: 432 # 433 # 434 # - The physical device's manufacturer, model, and serial number (UID). 435 # - 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. 436 # - The data source's type. 437 # - 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. 438 # 439 # 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 440 # 441 # 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 442 # 443 # 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 444 # 445 # Finally, the developer project number 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 developer project number in clear and normal form. 446 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 447 }, 448 ], 449 }</pre> 450</div> 451 452<div class="method"> 453 <code class="details" id="update">update(userId, dataSourceId, body)</code> 454 <pre>Updates the specified data source. The dataStreamId, dataType, type, dataStreamName, and device properties with the exception of version, cannot be modified. 455 456Data sources are identified by their dataStreamId. 457 458Args: 459 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) 460 dataSourceId: string, The data stream ID of the data source to update. (required) 461 body: object, The request body. (required) 462 The object takes the form of: 463 464{ # 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. 465 # 466 # 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. 467 # 468 # 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. 469 "name": "A String", # An end-user visible name for this data source. 470 "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. 471 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 472 "field": [ # A field represents one dimension of a data type. 473 { # 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.). 474 # 475 # This message is only instantiated in code and not used for wire comms or stored in any way. 476 "optional": True or False, 477 "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. 478 "format": "A String", # The different supported formats for each field in a data type. 479 }, 480 ], 481 "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. 482 }, 483 "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. 484 "A String", 485 ], 486 "application": { # Information about an application which feeds sensor data into the platform. 487 "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. 488 "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. 489 "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. 490 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 491 }, 492 "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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 493 # 494 # 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: 495 # - Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance) 496 # - Display the source of data to the user (by using the device make / model) 497 # - Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone) 498 # - Build different analysis models for each device/version. 499 "model": "A String", # End-user visible model name for the device. 500 "version": "A String", # Version string for the device hardware/software. 501 "type": "A String", # A constant representing the type of the device. 502 "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. 503 "manufacturer": "A String", # Manufacturer of the product/hardware. 504 }, 505 "dataStreamId": "A String", # A unique identifier for the data stream produced by this data source. The identifier includes: 506 # 507 # 508 # - The physical device's manufacturer, model, and serial number (UID). 509 # - 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. 510 # - The data source's type. 511 # - 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. 512 # 513 # 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 514 # 515 # 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 516 # 517 # 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 518 # 519 # Finally, the developer project number 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 developer project number in clear and normal form. 520 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 521 } 522 523 524Returns: 525 An object of the form: 526 527 { # 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. 528 # 529 # 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. 530 # 531 # 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. 532 "name": "A String", # An end-user visible name for this data source. 533 "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. 534 "dataType": { # The data type defines the schema for a stream of data being collected by, inserted into, or queried from the Fitness API. 535 "field": [ # A field represents one dimension of a data type. 536 { # 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.). 537 # 538 # This message is only instantiated in code and not used for wire comms or stored in any way. 539 "optional": True or False, 540 "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. 541 "format": "A String", # The different supported formats for each field in a data type. 542 }, 543 ], 544 "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. 545 }, 546 "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. 547 "A String", 548 ], 549 "application": { # Information about an application which feeds sensor data into the platform. 550 "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. 551 "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. 552 "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. 553 "detailsUrl": "A String", # An optional URI that can be used to link back to the application. 554 }, 555 "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. # Representation of an integrated device (such as a phone or a wearable) that can hold sensors. 556 # 557 # 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: 558 # - Distinguishing two similar sensors on different devices (the step counter on two nexus 5 phones, for instance) 559 # - Display the source of data to the user (by using the device make / model) 560 # - Treat data differently depending on sensor type (accelerometers on a watch may give different patterns than those on a phone) 561 # - Build different analysis models for each device/version. 562 "model": "A String", # End-user visible model name for the device. 563 "version": "A String", # Version string for the device hardware/software. 564 "type": "A String", # A constant representing the type of the device. 565 "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. 566 "manufacturer": "A String", # Manufacturer of the product/hardware. 567 }, 568 "dataStreamId": "A String", # A unique identifier for the data stream produced by this data source. The identifier includes: 569 # 570 # 571 # - The physical device's manufacturer, model, and serial number (UID). 572 # - 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. 573 # - The data source's type. 574 # - 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. 575 # 576 # 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 577 # 578 # 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 579 # 580 # 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 581 # 582 # Finally, the developer project number 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 developer project number in clear and normal form. 583 "type": "A String", # A constant describing the type of this data source. Indicates whether this data source produces raw or derived data. 584 }</pre> 585</div> 586 587</body></html>