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 | |
| 75 | <h1><a href="fitness_v1.html">Fitness</a> . <a href="fitness_v1.users.html">users</a> . <a href="fitness_v1.users.dataset.html">dataset</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
| 78 | <code><a href="#aggregate">aggregate(userId, body)</a></code></p> |
| 79 | <p class="firstline">A description of how to use this function</p> |
| 80 | <h3>Method Details</h3> |
| 81 | <div class="method"> |
| 82 | <code class="details" id="aggregate">aggregate(userId, body)</code> |
| 83 | <pre>A description of how to use this function |
| 84 | |
| 85 | Args: |
| 86 | userId: string, A parameter (required) |
| 87 | body: object, The request body. (required) |
| 88 | The object takes the form of: |
| 89 | |
| 90 | { |
| 91 | "aggregateBy": [ |
| 92 | { |
| 93 | "outputDataTypeName": "A String", |
| 94 | "dataSourceId": "A String", |
| 95 | "dataTypeName": "A String", # by dataype or by datasource |
| 96 | "outputDataSourceId": "A String", |
| 97 | }, |
| 98 | ], |
| 99 | "bucketByActivitySegment": { |
| 100 | "activityDataSourceId": "A String", # default activity stream will be used if not specified |
| 101 | "minDurationMillis": "A String", # Only activity segments of duration longer than this is used |
| 102 | }, |
| 103 | "endTimeMillis": "A String", |
| 104 | "bucketBySession": { |
| 105 | "minDurationMillis": "A String", # Only sessions of duration longer than this is used |
| 106 | }, |
| 107 | "bucketByActivityType": { |
| 108 | "activityDataSourceId": "A String", # default activity stream will be used if not specified |
| 109 | "minDurationMillis": "A String", # Only activity segments of duration longer than this is used |
| 110 | }, |
| 111 | "startTimeMillis": "A String", # required time range |
| 112 | "bucketByTime": { # apparently oneof is not supported by reduced_nano_proto |
| 113 | "durationMillis": "A String", |
| 114 | }, |
| 115 | } |
| 116 | |
| 117 | |
| 118 | Returns: |
| 119 | An object of the form: |
| 120 | |
| 121 | { |
| 122 | "bucket": [ |
| 123 | { |
| 124 | "endTimeMillis": "A String", |
| 125 | "dataset": [ # There will be one dataset per datatype/datasource |
| 126 | { # A dataset represents a projection container for data points. They do not carry any info of their own. Datasets represent a set of data points from a particular data source. A data point can be found in more than one dataset. |
| 127 | "minStartTimeNs": "A String", # The smallest start time of all data points in this possibly partial representation of the dataset. Time is in nanoseconds from epoch. This should also match the first part of the dataset identifier. |
| 128 | "nextPageToken": "A String", # This token will be set when a dataset is received in response to a GET request and the dataset is too large to be included in a single response. Provide this value in a subsequent GET request to return the next page of data points within this dataset. |
| 129 | "maxEndTimeNs": "A String", # The largest end time of all data points in this possibly partial representation of the dataset. Time is in nanoseconds from epoch. This should also match the first part of the dataset identifier. |
| 130 | "dataSourceId": "A String", # The data stream ID of the data source that created the points in this dataset. |
| 131 | "point": [ # A partial list of data points contained in the dataset, ordered by largest endTimeNanos first. This list is considered complete when retrieving a small dataset and partial when patching a dataset or retrieving a dataset that is too large to include in a single response. |
| 132 | { # Represents a single data point, generated by a particular data source. A data point holds a value for each field, an end timestamp and an optional start time. The exact semantics of each of these attributes are specified in the documentation for the particular data type. |
| 133 | # |
| 134 | # A data point can represent an instantaneous measurement, reading or input observation, as well as averages or aggregates over a time interval. Check the data type documentation to determine which is the case for a particular data type. |
| 135 | # |
| 136 | # Data points always contain one value for each field of the data type. |
| 137 | "modifiedTimeMillis": "A String", # Indicates the last time this data point was modified. Useful only in contexts where we are listing the data changes, rather than representing the current state of the data. |
| 138 | "startTimeNanos": "A String", # The start time of the interval represented by this data point, in nanoseconds since epoch. |
| 139 | "dataTypeName": "A String", # The data type defining the format of the values in this data point. |
| 140 | "endTimeNanos": "A String", # The end time of the interval represented by this data point, in nanoseconds since epoch. |
| 141 | "value": [ # Values of each data type field for the data point. It is expected that each value corresponding to a data type field will occur in the same order that the field is listed with in the data type specified in a data source. |
| 142 | # |
| 143 | # Only one of integer and floating point fields will be populated, depending on the format enum value within data source's type field. |
| 144 | { # Holder object for the value of a single field in a data point. |
| 145 | # |
| 146 | # A field value has a particular format and is only ever set to one of an integer or a floating point value. |
| 147 | "fpVal": 3.14, # Floating point value. When this is set, intVal must not be set. |
| 148 | "intVal": 42, # Integer value. When this is set, fpVal must not be set. |
| 149 | }, |
| 150 | ], |
| 151 | "computationTimeMillis": "A String", # Used for version checking during transformation; that is, a datapoint can only replace another datapoint that has an older computation time stamp. |
| 152 | "originDataSourceId": "A String", # If the data point is contained in a dataset for a derived data source, this field will be populated with the data source stream ID that created the data point originally. |
| 153 | "rawTimestampNanos": "A String", # The raw timestamp from the original SensorEvent. |
| 154 | }, |
| 155 | ], |
| 156 | }, |
| 157 | ], |
| 158 | "session": { # Sessions contain metadata, such as a user-friendly name and time interval information. # available for Bucket.Type.SESSION |
| 159 | "modifiedTimeMillis": "A String", # A timestamp that indicates when the session was last modified. |
| 160 | "endTimeMillis": "A String", # An end time, in milliseconds since epoch, inclusive. |
| 161 | "description": "A String", # A description for this session. |
| 162 | "activityType": 42, # The type of activity this session represents. |
| 163 | "application": { # See: google3/java/com/google/android/apps/heart/platform/api/Application.java # The application that created the session. |
| 164 | "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. |
| 165 | "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. |
| 166 | "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. |
| 167 | "detailsUrl": "A String", # An optional URI that can be used to link back to the application. |
| 168 | }, |
| 169 | "startTimeMillis": "A String", # A start time, in milliseconds since epoch, inclusive. |
| 170 | "activeTimeMillis": "A String", # Session active time. While start_time_millis and end_time_millis define the full session time, the active time can be shorter and specified by active_time_millis. If the inactive time during the session is known, it should also be inserted via a com.google.activity.segment data point with a STILL activity value |
| 171 | "id": "A String", # A client-generated identifier that is unique across all sessions owned by this particular user. |
| 172 | "name": "A String", # A human readable name of the session. |
| 173 | }, |
| 174 | "activity": 42, # available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT |
| 175 | "startTimeMillis": "A String", |
| 176 | "type": "A String", # The type of a bucket signifies how the data aggregation is performed in the bucket. |
| 177 | }, |
| 178 | ], |
| 179 | }</pre> |
| 180 | </div> |
| 181 | |
| 182 | </body></html> |