blob: ac5a47cdb09df10953123acabdc17b76f0c5c12d [file] [log] [blame]
Nathaniel Manista4f877e52015-06-15 16:44:50 +00001<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
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -070075<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 Manista4f877e52015-06-15 16:44:50 +000076<h2>Instance Methods</h2>
77<p class="toc_element">
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -070078 <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 Manista4f877e52015-06-15 16:44:50 +000080<h3>Method Details</h3>
81<div class="method">
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -070082 <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
84type of boundary. Multiple data sets of multiple types and from multiple
85sources can be aggregated into exactly one bucket type per request.
Nathaniel Manista4f877e52015-06-15 16:44:50 +000086
87Args:
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -070088 userId: string, Aggregate data for the person identified. Use &lt;code&gt;me&lt;/code&gt; to indicate
89the authenticated user. Only &lt;code&gt;me&lt;/code&gt; is supported at this time. (required)
Dan O'Mearadd494642020-05-01 07:42:23 -070090 body: object, The request body.
Nathaniel Manista4f877e52015-06-15 16:44:50 +000091 The object takes the form of:
92
Sai Cheemalapatiea3a5e12016-10-12 14:05:53 -070093{ # Next id: 10
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -070094 &quot;endTimeMillis&quot;: &quot;A String&quot;, # 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 Kim65020912020-05-20 12:08:20 -070097 &quot;filteredDataQualityStandard&quot;: [ # DO NOT POPULATE THIS FIELD. It is ignored.
98 &quot;A String&quot;,
99 ],
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700100 &quot;bucketBySession&quot;: { # 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 &quot;minDurationMillis&quot;: &quot;A String&quot;, # Specifies that only sessions of duration longer than minDurationMillis are
104 # considered and used as a container for aggregated data.
105 },
106 &quot;startTimeMillis&quot;: &quot;A String&quot;, # 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 &quot;aggregateBy&quot;: [ # 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 &quot;dataTypeName&quot;: &quot;A String&quot;, # 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:&lt;output data type name&gt;: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 &quot;dataSourceId&quot;: &quot;A String&quot;, # 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 &quot;bucketByActivityType&quot;: { # 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 &quot;activityDataSourceId&quot;: &quot;A String&quot;, # The default activity stream will be used if a specific activityDataSourceId
136 # is not specified.
137 &quot;minDurationMillis&quot;: &quot;A String&quot;, # Specifies that only activity segments of duration longer than
138 # minDurationMillis are considered and used as a container for aggregated
139 # data.
140 },
141 &quot;bucketByTime&quot;: { # Specifies that data be aggregated by a single time interval. Mutually
142 # exclusive of other bucketing specifications.
143 &quot;durationMillis&quot;: &quot;A String&quot;, # 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 &quot;period&quot;: {
147 &quot;type&quot;: &quot;A String&quot;,
148 &quot;timeZoneId&quot;: &quot;A String&quot;, # org.joda.timezone.DateTimeZone
149 &quot;value&quot;: 42,
150 },
151 },
152 &quot;bucketByActivitySegment&quot;: { # 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 &quot;activityDataSourceId&quot;: &quot;A String&quot;, # The default activity stream will be used if a specific activityDataSourceId
157 # is not specified.
158 &quot;minDurationMillis&quot;: &quot;A String&quot;, # Specifies that only activity segments of duration longer than
159 # minDurationMillis are considered and used as a container for aggregated
160 # data.
161 },
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000162 }
163
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700164 x__xgafv: string, V1 error format.
165 Allowed values
166 1 - v1 error format
167 2 - v2 error format
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000168
169Returns:
170 An object of the form:
171
172 {
Bu Sun Kim65020912020-05-20 12:08:20 -0700173 &quot;bucket&quot;: [ # A list of buckets containing the aggregated data.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000174 {
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700175 &quot;startTimeMillis&quot;: &quot;A String&quot;, # The start time for the aggregated data, in milliseconds since epoch,
176 # inclusive.
177 &quot;session&quot;: { # Sessions contain metadata, such as a user-friendly name and time interval # Available for Bucket.Type.SESSION
178 # information.
179 &quot;id&quot;: &quot;A String&quot;, # A client-generated identifier that is unique across all sessions owned by
180 # this particular user.
181 &quot;endTimeMillis&quot;: &quot;A String&quot;, # An end time, in milliseconds since epoch, inclusive.
Bu Sun Kim65020912020-05-20 12:08:20 -0700182 &quot;application&quot;: { # The application that created the session.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700183 &quot;packageName&quot;: &quot;A String&quot;, # 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 &quot;name&quot;: &quot;A String&quot;, # 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 Kim65020912020-05-20 12:08:20 -0700191 &quot;detailsUrl&quot;: &quot;A String&quot;, # An optional URI that can be used to link back to the application.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700192 &quot;version&quot;: &quot;A String&quot;, # 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 Kim65020912020-05-20 12:08:20 -0700194 },
195 &quot;description&quot;: &quot;A String&quot;, # A description for this session.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700196 &quot;startTimeMillis&quot;: &quot;A String&quot;, # A start time, in milliseconds since epoch, inclusive.
197 &quot;activityType&quot;: 42, # The type of activity this session represents.
Bu Sun Kim65020912020-05-20 12:08:20 -0700198 &quot;modifiedTimeMillis&quot;: &quot;A String&quot;, # A timestamp that indicates when the session was last modified.
199 &quot;name&quot;: &quot;A String&quot;, # A human readable name of the session.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700200 &quot;activeTimeMillis&quot;: &quot;A String&quot;, # 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 Manista4f877e52015-06-15 16:44:50 +0000206 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700207 &quot;activity&quot;: 42, # Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT
208 &quot;dataset&quot;: [ # 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 &quot;point&quot;: [ # 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 &quot;modifiedTimeMillis&quot;: &quot;A String&quot;, # 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 &quot;originDataSourceId&quot;: &quot;A String&quot;, # 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 &quot;rawTimestampNanos&quot;: &quot;A String&quot;, # The raw timestamp from the original SensorEvent.
238 &quot;dataTypeName&quot;: &quot;A String&quot;, # The data type defining the format of the values in this data point.
239 &quot;startTimeNanos&quot;: &quot;A String&quot;, # The start time of the interval represented by this data point, in
240 # nanoseconds since epoch.
241 &quot;value&quot;: [ # 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&#x27;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 &quot;fpVal&quot;: 3.14, # Floating point value. When this is set, other values must not be set.
252 &quot;mapVal&quot;: [ # 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 &quot;value&quot;: { # 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 &quot;fpVal&quot;: 3.14, # Floating point value.
261 },
262 &quot;key&quot;: &quot;A String&quot;,
263 },
264 ],
265 &quot;intVal&quot;: 42, # Integer value. When this is set, other values must not be set.
266 &quot;stringVal&quot;: &quot;A String&quot;, # 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 &quot;computationTimeMillis&quot;: &quot;A String&quot;, # DO NOT USE THIS FIELD. It is ignored, and not stored.
272 &quot;endTimeNanos&quot;: &quot;A String&quot;, # The end time of the interval represented by this data point, in
273 # nanoseconds since epoch.
274 },
275 ],
276 &quot;minStartTimeNs&quot;: &quot;A String&quot;, # 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 &quot;dataSourceId&quot;: &quot;A String&quot;, # The data stream ID of the data source that created the points in this
280 # dataset.
281 &quot;nextPageToken&quot;: &quot;A String&quot;, # 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 &quot;maxEndTimeNs&quot;: &quot;A String&quot;, # 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 &quot;type&quot;: &quot;A String&quot;, # The type of a bucket signifies how the data aggregation is performed in the
291 # bucket.
292 &quot;endTimeMillis&quot;: &quot;A String&quot;, # The end time for the aggregated data, in milliseconds since epoch,
293 # inclusive.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000294 },
295 ],
296 }</pre>
297</div>
298
299</body></html>