Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, 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 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, 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 | |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 75 | <h1><a href="fitness_v1.html">Fitness API</a> . <a href="fitness_v1.users.html">users</a> . <a href="fitness_v1.users.dataset.html">dataset</a></h1> |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 78 | <code><a href="#aggregate">aggregate(userId, body=None, x__xgafv=None)</a></code></p> |
| 79 | <p class="firstline">Aggregates data of a certain type or stream into buckets divided by a given</p> |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 80 | <h3>Method Details</h3> |
| 81 | <div class="method"> |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 82 | <code class="details" id="aggregate">aggregate(userId, body=None, x__xgafv=None)</code> |
| 83 | <pre>Aggregates data of a certain type or stream into buckets divided by a given |
| 84 | type of boundary. Multiple data sets of multiple types and from multiple |
| 85 | sources can be aggregated into exactly one bucket type per request. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 86 | |
| 87 | Args: |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 88 | userId: string, Aggregate data for the person identified. Use <code>me</code> to indicate |
| 89 | the authenticated user. Only <code>me</code> is supported at this time. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 90 | body: object, The request body. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 91 | The object takes the form of: |
| 92 | |
Sai Cheemalapati | ea3a5e1 | 2016-10-12 14:05:53 -0700 | [diff] [blame] | 93 | { # Next id: 10 |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 94 | "endTimeMillis": "A String", # The end of a window of time. Data that intersects with this time |
| 95 | # window will be aggregated. The time is in milliseconds since epoch, |
| 96 | # inclusive. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 97 | "filteredDataQualityStandard": [ # DO NOT POPULATE THIS FIELD. It is ignored. |
| 98 | "A String", |
| 99 | ], |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 100 | "bucketBySession": { # Specifies that data be aggregated by user sessions. Data that does not fall |
| 101 | # within the time range of a session will not be included in the response. |
| 102 | # Mutually exclusive of other bucketing specifications. |
| 103 | "minDurationMillis": "A String", # Specifies that only sessions of duration longer than minDurationMillis are |
| 104 | # considered and used as a container for aggregated data. |
| 105 | }, |
| 106 | "startTimeMillis": "A String", # The start of a window of time. Data that intersects with this time |
| 107 | # window will be aggregated. The time is in milliseconds since epoch, |
| 108 | # inclusive. |
| 109 | "aggregateBy": [ # The specification of data to be aggregated. At least one aggregateBy spec |
| 110 | # must be provided. All data that is specified will be aggregated using the |
| 111 | # same bucketing criteria. There will be one dataset in the response for |
| 112 | # every aggregateBy spec. |
| 113 | { # The specification of which data to aggregate. |
| 114 | "dataTypeName": "A String", # The data type to aggregate. All data sources providing this data type will |
| 115 | # contribute data to the aggregation. The response will contain a single |
| 116 | # dataset for this data type name. The dataset will have a data source ID of |
| 117 | # derived:<output data type name>:com.google.android.gms:aggregated. |
| 118 | # If the user has no data for this data type, an empty data set will be |
| 119 | # returned. Note: Data can be aggregated by either the dataTypeName or the |
| 120 | # dataSourceId, not both. |
| 121 | "dataSourceId": "A String", # A data source ID to aggregate. Only data from the specified data source ID |
| 122 | # will be included in the aggregation. If specified, this data source must |
| 123 | # exist; the OAuth scopes in the supplied credentials must grant read access |
| 124 | # to this data type. The dataset in the response will have the same data |
| 125 | # source ID. Note: Data can be aggregated by either the dataTypeName or the |
| 126 | # dataSourceId, not both. |
| 127 | }, |
| 128 | ], |
| 129 | "bucketByActivityType": { # Specifies that data be aggregated by the type of activity being performed |
| 130 | # when the data was recorded. All data that was recorded during a certain |
| 131 | # activity type (for the given time range) will be aggregated into the same |
| 132 | # bucket. Data that was recorded while the user was not active will not be |
| 133 | # included in the response. Mutually exclusive of other bucketing |
| 134 | # specifications. |
| 135 | "activityDataSourceId": "A String", # The default activity stream will be used if a specific activityDataSourceId |
| 136 | # is not specified. |
| 137 | "minDurationMillis": "A String", # Specifies that only activity segments of duration longer than |
| 138 | # minDurationMillis are considered and used as a container for aggregated |
| 139 | # data. |
| 140 | }, |
| 141 | "bucketByTime": { # Specifies that data be aggregated by a single time interval. Mutually |
| 142 | # exclusive of other bucketing specifications. |
| 143 | "durationMillis": "A String", # Specifies that result buckets aggregate data by exactly durationMillis time |
| 144 | # frames. Time frames that contain no data will be included in the response |
| 145 | # with an empty dataset. |
| 146 | "period": { |
| 147 | "type": "A String", |
| 148 | "timeZoneId": "A String", # org.joda.timezone.DateTimeZone |
| 149 | "value": 42, |
| 150 | }, |
| 151 | }, |
| 152 | "bucketByActivitySegment": { # Specifies that data be aggregated each activity segment recored for a user. |
| 153 | # Similar to bucketByActivitySegment, but bucketing is done for each activity |
| 154 | # segment rather than all segments of the same type. Mutually exclusive of |
| 155 | # other bucketing specifications. |
| 156 | "activityDataSourceId": "A String", # The default activity stream will be used if a specific activityDataSourceId |
| 157 | # is not specified. |
| 158 | "minDurationMillis": "A String", # Specifies that only activity segments of duration longer than |
| 159 | # minDurationMillis are considered and used as a container for aggregated |
| 160 | # data. |
| 161 | }, |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 162 | } |
| 163 | |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 164 | x__xgafv: string, V1 error format. |
| 165 | Allowed values |
| 166 | 1 - v1 error format |
| 167 | 2 - v2 error format |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 168 | |
| 169 | Returns: |
| 170 | An object of the form: |
| 171 | |
| 172 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 173 | "bucket": [ # A list of buckets containing the aggregated data. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 174 | { |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 175 | "startTimeMillis": "A String", # The start time for the aggregated data, in milliseconds since epoch, |
| 176 | # inclusive. |
| 177 | "session": { # Sessions contain metadata, such as a user-friendly name and time interval # Available for Bucket.Type.SESSION |
| 178 | # information. |
| 179 | "id": "A String", # A client-generated identifier that is unique across all sessions owned by |
| 180 | # this particular user. |
| 181 | "endTimeMillis": "A String", # An end time, in milliseconds since epoch, inclusive. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 182 | "application": { # The application that created the session. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 183 | "packageName": "A String", # Package name for this application. This is used as a unique |
| 184 | # identifier when created by Android applications, but cannot be specified |
| 185 | # by REST clients. REST clients will have their developer project number |
| 186 | # reflected into the Data Source data stream IDs, instead of the packageName. |
| 187 | "name": "A String", # The name of this application. This is required for REST clients, but we |
| 188 | # do not enforce uniqueness of this name. It is provided as a matter of |
| 189 | # convenience for other developers who would like to identify which REST |
| 190 | # created an Application or Data Source. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 191 | "detailsUrl": "A String", # An optional URI that can be used to link back to the application. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 192 | "version": "A String", # Version of the application. You should update this field whenever the |
| 193 | # application changes in a way that affects the computation of the data. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 194 | }, |
| 195 | "description": "A String", # A description for this session. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 196 | "startTimeMillis": "A String", # A start time, in milliseconds since epoch, inclusive. |
| 197 | "activityType": 42, # The type of activity this session represents. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 198 | "modifiedTimeMillis": "A String", # A timestamp that indicates when the session was last modified. |
| 199 | "name": "A String", # A human readable name of the session. |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 200 | "activeTimeMillis": "A String", # Session active time. While start_time_millis and end_time_millis define |
| 201 | # the full session time, the active time can be shorter and specified by |
| 202 | # active_time_millis. |
| 203 | # If the inactive time during the session is known, it should also be |
| 204 | # inserted via a com.google.activity.segment data point with a STILL |
| 205 | # activity value |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 206 | }, |
Bu Sun Kim | 4ed7d3f | 2020-05-27 12:20:54 -0700 | [diff] [blame] | 207 | "activity": 42, # Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT |
| 208 | "dataset": [ # There will be one dataset per AggregateBy in the request. |
| 209 | { # A dataset represents a projection container for data points. They do not |
| 210 | # carry any info of their own. Datasets represent a set of data points from a |
| 211 | # particular data source. A data point can be found in more than one dataset. |
| 212 | "point": [ # A partial list of data points contained in the dataset, ordered by largest |
| 213 | # endTimeNanos first. This list is considered complete when retrieving a |
| 214 | # small dataset and partial when patching a dataset or retrieving a dataset |
| 215 | # that is too large to include in a single response. |
| 216 | { # Represents a single data point, generated by a particular data source. A |
| 217 | # data point holds a value for each field, an end timestamp and an optional |
| 218 | # start time. The exact semantics of each of these attributes are specified in |
| 219 | # the documentation for the particular data type. |
| 220 | # |
| 221 | # A data point can represent an instantaneous measurement, reading or input |
| 222 | # observation, as well as averages or aggregates over a time interval. Check |
| 223 | # the data type documentation to determine which is the case for a particular |
| 224 | # data type. |
| 225 | # |
| 226 | # Data points always contain one value for each field of the data type. |
| 227 | "modifiedTimeMillis": "A String", # Indicates the last time this data point was modified. Useful only in |
| 228 | # contexts where we are listing the data changes, rather than representing |
| 229 | # the current state of the data. |
| 230 | "originDataSourceId": "A String", # If the data point is contained in a dataset for a derived data source, |
| 231 | # this field will be populated with the data source stream ID that created |
| 232 | # the data point originally. |
| 233 | # |
| 234 | # WARNING: do not rely on this field for anything other than debugging. The |
| 235 | # value of this field, if it is set at all, is an implementation detail and |
| 236 | # is not guaranteed to remain consistent. |
| 237 | "rawTimestampNanos": "A String", # The raw timestamp from the original SensorEvent. |
| 238 | "dataTypeName": "A String", # The data type defining the format of the values in this data point. |
| 239 | "startTimeNanos": "A String", # The start time of the interval represented by this data point, in |
| 240 | # nanoseconds since epoch. |
| 241 | "value": [ # Values of each data type field for the data point. It is expected that each |
| 242 | # value corresponding to a data type field will occur in the same order that |
| 243 | # the field is listed with in the data type specified in a data source. |
| 244 | # |
| 245 | # Only one of integer and floating point fields will be populated, depending |
| 246 | # on the format enum value within data source's type field. |
| 247 | { # Holder object for the value of a single field in a data point. |
| 248 | # |
| 249 | # A field value has a particular format and is only ever set to one of an |
| 250 | # integer or a floating point value. |
| 251 | "fpVal": 3.14, # Floating point value. When this is set, other values must not be set. |
| 252 | "mapVal": [ # Map value. The valid key space and units for the corresponding value |
| 253 | # of each entry should be documented as part of the data type definition. |
| 254 | # Keys should be kept small whenever possible. Data streams with large keys |
| 255 | # and high data frequency may be down sampled. |
| 256 | { |
| 257 | "value": { # Holder object for the value of an entry in a map field of a data point. |
| 258 | # |
| 259 | # A map value supports a subset of the formats that the regular Value supports. |
| 260 | "fpVal": 3.14, # Floating point value. |
| 261 | }, |
| 262 | "key": "A String", |
| 263 | }, |
| 264 | ], |
| 265 | "intVal": 42, # Integer value. When this is set, other values must not be set. |
| 266 | "stringVal": "A String", # String value. When this is set, other values must not be set. |
| 267 | # Strings should be kept small whenever possible. Data streams with large |
| 268 | # string values and high data frequency may be down sampled. |
| 269 | }, |
| 270 | ], |
| 271 | "computationTimeMillis": "A String", # DO NOT USE THIS FIELD. It is ignored, and not stored. |
| 272 | "endTimeNanos": "A String", # The end time of the interval represented by this data point, in |
| 273 | # nanoseconds since epoch. |
| 274 | }, |
| 275 | ], |
| 276 | "minStartTimeNs": "A String", # The smallest start time of all data points in this possibly partial |
| 277 | # representation of the dataset. Time is in nanoseconds from epoch. This |
| 278 | # should also match the first part of the dataset identifier. |
| 279 | "dataSourceId": "A String", # The data stream ID of the data source that created the points in this |
| 280 | # dataset. |
| 281 | "nextPageToken": "A String", # This token will be set when a dataset is received in response to a GET |
| 282 | # request and the dataset is too large to be included in a single response. |
| 283 | # Provide this value in a subsequent GET request to return the next page of |
| 284 | # data points within this dataset. |
| 285 | "maxEndTimeNs": "A String", # The largest end time of all data points in this possibly partial |
| 286 | # representation of the dataset. Time is in nanoseconds from epoch. This |
| 287 | # should also match the second part of the dataset identifier. |
| 288 | }, |
| 289 | ], |
| 290 | "type": "A String", # The type of a bucket signifies how the data aggregation is performed in the |
| 291 | # bucket. |
| 292 | "endTimeMillis": "A String", # The end time for the aggregated data, in milliseconds since epoch, |
| 293 | # inclusive. |
Nathaniel Manista | 4f877e5 | 2015-06-15 16:44:50 +0000 | [diff] [blame] | 294 | }, |
| 295 | ], |
| 296 | }</pre> |
| 297 | </div> |
| 298 | |
| 299 | </body></html> |