blob: f31089ffece7698b20152e8a1705ef37eff4df7b [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 Kimd059ad82020-07-22 17:02:09 -070094 &quot;bucketByTime&quot;: { # Specifies that data be aggregated by a single time interval. Mutually
95 # exclusive of other bucketing specifications.
96 &quot;period&quot;: {
97 &quot;type&quot;: &quot;A String&quot;,
98 &quot;value&quot;: 42,
99 &quot;timeZoneId&quot;: &quot;A String&quot;, # org.joda.timezone.DateTimeZone
100 },
101 &quot;durationMillis&quot;: &quot;A String&quot;, # Specifies that result buckets aggregate data by exactly durationMillis time
102 # frames. Time frames that contain no data will be included in the response
103 # with an empty dataset.
104 },
Bu Sun Kim65020912020-05-20 12:08:20 -0700105 &quot;filteredDataQualityStandard&quot;: [ # DO NOT POPULATE THIS FIELD. It is ignored.
106 &quot;A String&quot;,
107 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700108 &quot;bucketByActivityType&quot;: { # Specifies that data be aggregated by the type of activity being performed
109 # when the data was recorded. All data that was recorded during a certain
110 # activity type (.for the given time range) will be aggregated into the same
111 # bucket. Data that was recorded while the user was not active will not be
112 # included in the response. Mutually exclusive of other bucketing
113 # specifications.
114 &quot;activityDataSourceId&quot;: &quot;A String&quot;, # The default activity stream will be used if a specific activityDataSourceId
115 # is not specified.
116 &quot;minDurationMillis&quot;: &quot;A String&quot;, # Specifies that only activity segments of duration longer than
117 # minDurationMillis are considered and used as a container for aggregated
118 # data.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700119 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700120 &quot;aggregateBy&quot;: [ # The specification of data to be aggregated. At least one aggregateBy spec
121 # must be provided. All data that is specified will be aggregated using the
122 # same bucketing criteria. There will be one dataset in the response for
123 # every aggregateBy spec.
124 { # The specification of which data to aggregate.
125 &quot;dataTypeName&quot;: &quot;A String&quot;, # The data type to aggregate. All data sources providing this data type will
126 # contribute data to the aggregation. The response will contain a single
127 # dataset for this data type name. The dataset will have a data source ID of
128 # derived:&lt;output data type name&gt;:com.google.android.gms:aggregated.
129 # If the user has no data for this data type, an empty data set will be
130 # returned. Note: Data can be aggregated by either the dataTypeName or the
131 # dataSourceId, not both.
132 &quot;dataSourceId&quot;: &quot;A String&quot;, # A data source ID to aggregate. Only data from the specified data source ID
133 # will be included in the aggregation. If specified, this data source must
134 # exist; the OAuth scopes in the supplied credentials must grant read access
135 # to this data type. The dataset in the response will have the same data
136 # source ID. Note: Data can be aggregated by either the dataTypeName or the
137 # dataSourceId, not both.
138 },
139 ],
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700140 &quot;bucketBySession&quot;: { # Specifies that data be aggregated by user sessions. Data that does not fall
141 # within the time range of a session will not be included in the response.
142 # Mutually exclusive of other bucketing specifications.
143 &quot;minDurationMillis&quot;: &quot;A String&quot;, # Specifies that only sessions of duration longer than minDurationMillis are
144 # considered and used as a container for aggregated data.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700145 },
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700146 &quot;endTimeMillis&quot;: &quot;A String&quot;, # The end of a window of time. Data that intersects with this time
147 # window will be aggregated. The time is in milliseconds since epoch,
148 # inclusive.
149 &quot;startTimeMillis&quot;: &quot;A String&quot;, # The start of a window of time. Data that intersects with this time
150 # window will be aggregated. The time is in milliseconds since epoch,
151 # inclusive.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700152 &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;session&quot;: { # Sessions contain metadata, such as a user-friendly name and time interval # Available for Bucket.Type.SESSION
176 # information.
177 &quot;id&quot;: &quot;A String&quot;, # A client-generated identifier that is unique across all sessions owned by
178 # this particular user.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700179 &quot;activityType&quot;: 42, # The type of activity this session represents.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700180 &quot;endTimeMillis&quot;: &quot;A String&quot;, # An end time, in milliseconds since epoch, inclusive.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700181 &quot;description&quot;: &quot;A String&quot;, # A description for this session.
182 &quot;startTimeMillis&quot;: &quot;A String&quot;, # A start time, in milliseconds since epoch, inclusive.
183 &quot;name&quot;: &quot;A String&quot;, # A human readable name of the session.
Bu Sun Kim65020912020-05-20 12:08:20 -0700184 &quot;application&quot;: { # The application that created the session.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700185 &quot;packageName&quot;: &quot;A String&quot;, # Package name for this application. This is used as a unique
186 # identifier when created by Android applications, but cannot be specified
187 # by REST clients. REST clients will have their developer project number
188 # reflected into the Data Source data stream IDs, instead of the packageName.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700189 &quot;detailsUrl&quot;: &quot;A String&quot;, # An optional URI that can be used to link back to the application.
190 &quot;version&quot;: &quot;A String&quot;, # Version of the application. You should update this field whenever the
191 # application changes in a way that affects the computation of the data.
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700192 &quot;name&quot;: &quot;A String&quot;, # The name of this application. This is required for REST clients, but we
193 # do not enforce uniqueness of this name. It is provided as a matter of
194 # convenience for other developers who would like to identify which REST
195 # created an Application or Data Source.
Bu Sun Kim65020912020-05-20 12:08:20 -0700196 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700197 &quot;activeTimeMillis&quot;: &quot;A String&quot;, # Session active time. While start_time_millis and end_time_millis define
198 # the full session time, the active time can be shorter and specified by
199 # active_time_millis.
200 # If the inactive time during the session is known, it should also be
201 # inserted via a com.google.activity.segment data point with a STILL
202 # activity value
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700203 &quot;modifiedTimeMillis&quot;: &quot;A String&quot;, # A timestamp that indicates when the session was last modified.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000204 },
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700205 &quot;activity&quot;: 42, # Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT
Bu Sun Kim4ed7d3f2020-05-27 12:20:54 -0700206 &quot;endTimeMillis&quot;: &quot;A String&quot;, # The end time for the aggregated data, in milliseconds since epoch,
207 # inclusive.
Bu Sun Kimd059ad82020-07-22 17:02:09 -0700208 &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;dataSourceId&quot;: &quot;A String&quot;, # The data stream ID of the data source that created the points in this
213 # dataset.
214 &quot;maxEndTimeNs&quot;: &quot;A String&quot;, # The largest end time of all data points in this possibly partial
215 # representation of the dataset. Time is in nanoseconds from epoch. This
216 # should also match the second part of the dataset identifier.
217 &quot;minStartTimeNs&quot;: &quot;A String&quot;, # The smallest start time of all data points in this possibly partial
218 # representation of the dataset. Time is in nanoseconds from epoch. This
219 # should also match the first part of the dataset identifier.
220 &quot;point&quot;: [ # A partial list of data points contained in the dataset, ordered by largest
221 # endTimeNanos first. This list is considered complete when retrieving a
222 # small dataset and partial when patching a dataset or retrieving a dataset
223 # that is too large to include in a single response.
224 { # Represents a single data point, generated by a particular data source. A
225 # data point holds a value for each field, an end timestamp and an optional
226 # start time. The exact semantics of each of these attributes are specified in
227 # the documentation for the particular data type.
228 #
229 # A data point can represent an instantaneous measurement, reading or input
230 # observation, as well as averages or aggregates over a time interval. Check
231 # the data type documentation to determine which is the case for a particular
232 # data type.
233 #
234 # Data points always contain one value for each field of the data type.
235 &quot;computationTimeMillis&quot;: &quot;A String&quot;, # DO NOT USE THIS FIELD. It is ignored, and not stored.
236 &quot;dataTypeName&quot;: &quot;A String&quot;, # The data type defining the format of the values in this data point.
237 &quot;endTimeNanos&quot;: &quot;A String&quot;, # The end time of the interval represented by this data point, in
238 # nanoseconds since epoch.
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;originDataSourceId&quot;: &quot;A String&quot;, # If the data point is contained in a dataset for a derived data source,
242 # this field will be populated with the data source stream ID that created
243 # the data point originally.
244 #
245 # WARNING: do not rely on this field for anything other than debugging. The
246 # value of this field, if it is set at all, is an implementation detail and
247 # is not guaranteed to remain consistent.
248 &quot;modifiedTimeMillis&quot;: &quot;A String&quot;, # Indicates the last time this data point was modified. Useful only in
249 # contexts where we are listing the data changes, rather than representing
250 # the current state of the data.
251 &quot;rawTimestampNanos&quot;: &quot;A String&quot;, # The raw timestamp from the original SensorEvent.
252 &quot;value&quot;: [ # Values of each data type field for the data point. It is expected that each
253 # value corresponding to a data type field will occur in the same order that
254 # the field is listed with in the data type specified in a data source.
255 #
256 # Only one of integer and floating point fields will be populated, depending
257 # on the format enum value within data source&#x27;s type field.
258 { # Holder object for the value of a single field in a data point.
259 #
260 # A field value has a particular format and is only ever set to one of an
261 # integer or a floating point value.
262 &quot;stringVal&quot;: &quot;A String&quot;, # String value. When this is set, other values must not be set.
263 # Strings should be kept small whenever possible. Data streams with large
264 # string values and high data frequency may be down sampled.
265 &quot;mapVal&quot;: [ # Map value. The valid key space and units for the corresponding value
266 # of each entry should be documented as part of the data type definition.
267 # Keys should be kept small whenever possible. Data streams with large keys
268 # and high data frequency may be down sampled.
269 {
270 &quot;value&quot;: { # Holder object for the value of an entry in a map field of a data point.
271 #
272 # A map value supports a subset of the formats that the regular Value supports.
273 &quot;fpVal&quot;: 3.14, # Floating point value.
274 },
275 &quot;key&quot;: &quot;A String&quot;,
276 },
277 ],
278 &quot;fpVal&quot;: 3.14, # Floating point value. When this is set, other values must not be set.
279 &quot;intVal&quot;: 42, # Integer value. When this is set, other values must not be set.
280 },
281 ],
282 },
283 ],
284 &quot;nextPageToken&quot;: &quot;A String&quot;, # This token will be set when a dataset is received in response to a GET
285 # request and the dataset is too large to be included in a single response.
286 # Provide this value in a subsequent GET request to return the next page of
287 # data points within this dataset.
288 },
289 ],
290 &quot;startTimeMillis&quot;: &quot;A String&quot;, # The start time for the aggregated data, in milliseconds since epoch,
291 # inclusive.
292 &quot;type&quot;: &quot;A String&quot;, # The type of a bucket signifies how the data aggregation is performed in the
293 # bucket.
Nathaniel Manista4f877e52015-06-15 16:44:50 +0000294 },
295 ],
296 }</pre>
297</div>
298
299</body></html>