Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [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.sessions.html">sessions</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
| 78 | <code><a href="#delete">delete(userId, sessionId, currentTimeMillis=None)</a></code></p> |
| 79 | <p class="firstline">Deletes a session specified by the given session ID.</p> |
| 80 | <p class="toc_element"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 81 | <code><a href="#list">list(userId, activityType=None, endTime=None, includeDeleted=None, pageToken=None, startTime=None)</a></code></p> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 82 | <p class="firstline">Lists sessions previously created.</p> |
| 83 | <p class="toc_element"> |
| 84 | <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> |
| 85 | <p class="firstline">Retrieves the next page of results.</p> |
| 86 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 87 | <code><a href="#update">update(userId, sessionId, body=None, currentTimeMillis=None)</a></code></p> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 88 | <p class="firstline">Updates or insert a given session.</p> |
| 89 | <h3>Method Details</h3> |
| 90 | <div class="method"> |
| 91 | <code class="details" id="delete">delete(userId, sessionId, currentTimeMillis=None)</code> |
| 92 | <pre>Deletes a session specified by the given session ID. |
| 93 | |
| 94 | Args: |
| 95 | userId: string, Delete a session for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. (required) |
| 96 | sessionId: string, The ID of the session to be deleted. (required) |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 97 | currentTimeMillis: string, The client's current time in milliseconds since epoch. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 98 | </pre> |
| 99 | </div> |
| 100 | |
| 101 | <div class="method"> |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 102 | <code class="details" id="list">list(userId, activityType=None, endTime=None, includeDeleted=None, pageToken=None, startTime=None)</code> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 103 | <pre>Lists sessions previously created. |
| 104 | |
| 105 | Args: |
| 106 | userId: string, List sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. (required) |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 107 | activityType: integer, If non-empty, only sessions with these activity types should be returned. (repeated) |
| 108 | endTime: string, An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 109 | includeDeleted: boolean, If true, deleted sessions will be returned. When set to true, sessions returned in this response will only have an ID and will not have any other fields. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 110 | pageToken: string, The continuation token, which is used for incremental syncing. To get the next batch of changes, set this parameter to the value of nextPageToken from the previous response. This token is treated as a timestamp (in millis since epoch). If specified, the API returns sessions modified since this time. The page token is ignored if either start or end time is specified. If none of start time, end time, and the page token is specified, sessions modified in the last 30 days are returned. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 111 | startTime: string, An RFC3339 timestamp. Only sessions ending between the start and end times will be included in the response. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 112 | |
| 113 | Returns: |
| 114 | An object of the form: |
| 115 | |
| 116 | { |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 117 | "deletedSession": [ # If includeDeleted is set to true in the request, this list will contain sessions deleted with original end times that are within the startTime and endTime frame. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 118 | { # Sessions contain metadata, such as a user-friendly name and time interval information. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 119 | "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 |
| 120 | "activityType": 42, # The type of activity this session represents. |
| 121 | "application": { # The application that created the session. |
| 122 | "detailsUrl": "A String", # An optional URI that can be used to link back to the application. |
| 123 | "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. |
| 124 | "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. |
| 125 | "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. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 126 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 127 | "description": "A String", # A description for this session. |
| 128 | "endTimeMillis": "A String", # An end time, in milliseconds since epoch, inclusive. |
| 129 | "id": "A String", # A client-generated identifier that is unique across all sessions owned by this particular user. |
| 130 | "modifiedTimeMillis": "A String", # A timestamp that indicates when the session was last modified. |
| 131 | "name": "A String", # A human readable name of the session. |
| 132 | "startTimeMillis": "A String", # A start time, in milliseconds since epoch, inclusive. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 133 | }, |
| 134 | ], |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 135 | "hasMoreData": True or False, # Flag to indicate server has more data to transfer |
| 136 | "nextPageToken": "A String", # The continuation token, which is used to page through large result sets. Provide this value in a subsequent request to return the next page of results. |
| 137 | "session": [ # Sessions with an end time that is between startTime and endTime of the request. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 138 | { # Sessions contain metadata, such as a user-friendly name and time interval information. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 139 | "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 |
| 140 | "activityType": 42, # The type of activity this session represents. |
| 141 | "application": { # The application that created the session. |
| 142 | "detailsUrl": "A String", # An optional URI that can be used to link back to the application. |
| 143 | "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. |
| 144 | "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. |
| 145 | "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. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 146 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 147 | "description": "A String", # A description for this session. |
| 148 | "endTimeMillis": "A String", # An end time, in milliseconds since epoch, inclusive. |
| 149 | "id": "A String", # A client-generated identifier that is unique across all sessions owned by this particular user. |
| 150 | "modifiedTimeMillis": "A String", # A timestamp that indicates when the session was last modified. |
| 151 | "name": "A String", # A human readable name of the session. |
| 152 | "startTimeMillis": "A String", # A start time, in milliseconds since epoch, inclusive. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 153 | }, |
| 154 | ], |
| 155 | }</pre> |
| 156 | </div> |
| 157 | |
| 158 | <div class="method"> |
| 159 | <code class="details" id="list_next">list_next(previous_request, previous_response)</code> |
| 160 | <pre>Retrieves the next page of results. |
| 161 | |
| 162 | Args: |
| 163 | previous_request: The request for the previous page. (required) |
| 164 | previous_response: The response from the request for the previous page. (required) |
| 165 | |
| 166 | Returns: |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 167 | A request object that you can call 'execute()' on to request the next |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 168 | page. Returns None if there are no more items in the collection. |
| 169 | </pre> |
| 170 | </div> |
| 171 | |
| 172 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 173 | <code class="details" id="update">update(userId, sessionId, body=None, currentTimeMillis=None)</code> |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 174 | <pre>Updates or insert a given session. |
| 175 | |
| 176 | Args: |
| 177 | userId: string, Create sessions for the person identified. Use me to indicate the authenticated user. Only me is supported at this time. (required) |
| 178 | sessionId: string, The ID of the session to be created. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame] | 179 | body: object, The request body. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 180 | The object takes the form of: |
| 181 | |
| 182 | { # Sessions contain metadata, such as a user-friendly name and time interval information. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 183 | "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 |
| 184 | "activityType": 42, # The type of activity this session represents. |
| 185 | "application": { # The application that created the session. |
| 186 | "detailsUrl": "A String", # An optional URI that can be used to link back to the application. |
| 187 | "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. |
| 188 | "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. |
| 189 | "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. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 190 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 191 | "description": "A String", # A description for this session. |
| 192 | "endTimeMillis": "A String", # An end time, in milliseconds since epoch, inclusive. |
| 193 | "id": "A String", # A client-generated identifier that is unique across all sessions owned by this particular user. |
| 194 | "modifiedTimeMillis": "A String", # A timestamp that indicates when the session was last modified. |
| 195 | "name": "A String", # A human readable name of the session. |
| 196 | "startTimeMillis": "A String", # A start time, in milliseconds since epoch, inclusive. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 197 | } |
| 198 | |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 199 | currentTimeMillis: string, The client's current time in milliseconds since epoch. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 200 | |
| 201 | Returns: |
| 202 | An object of the form: |
| 203 | |
| 204 | { # Sessions contain metadata, such as a user-friendly name and time interval information. |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 205 | "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 |
| 206 | "activityType": 42, # The type of activity this session represents. |
| 207 | "application": { # The application that created the session. |
| 208 | "detailsUrl": "A String", # An optional URI that can be used to link back to the application. |
| 209 | "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. |
| 210 | "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. |
| 211 | "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. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 212 | }, |
Bu Sun Kim | 6502091 | 2020-05-20 12:08:20 -0700 | [diff] [blame] | 213 | "description": "A String", # A description for this session. |
| 214 | "endTimeMillis": "A String", # An end time, in milliseconds since epoch, inclusive. |
| 215 | "id": "A String", # A client-generated identifier that is unique across all sessions owned by this particular user. |
| 216 | "modifiedTimeMillis": "A String", # A timestamp that indicates when the session was last modified. |
| 217 | "name": "A String", # A human readable name of the session. |
| 218 | "startTimeMillis": "A String", # A start time, in milliseconds since epoch, inclusive. |
Craig Citro | e633be1 | 2015-03-02 13:40:36 -0800 | [diff] [blame] | 219 | }</pre> |
| 220 | </div> |
| 221 | |
| 222 | </body></html> |