| OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 | 2 |
| 3 library googleapis.fitness.v1; | 3 library googleapis.fitness.v1; |
| 4 | 4 |
| 5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
| 6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
| 7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
| 8 | 8 |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
| 11 | 11 |
| 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
| 13 ApiRequestError, DetailedApiRequestError; | 13 show ApiRequestError, DetailedApiRequestError; |
| 14 | 14 |
| 15 const core.String USER_AGENT = 'dart-api-client fitness/v1'; | 15 const core.String USER_AGENT = 'dart-api-client fitness/v1'; |
| 16 | 16 |
| 17 /** | 17 /// Stores and accesses user data in the fitness store from apps on any |
| 18 * Stores and accesses user data in the fitness store from apps on any platform. | 18 /// platform. |
| 19 */ | |
| 20 class FitnessApi { | 19 class FitnessApi { |
| 21 /** View your activity information in Google Fit */ | 20 /// View your activity information in Google Fit |
| 22 static const FitnessActivityReadScope = "https://www.googleapis.com/auth/fitne
ss.activity.read"; | 21 static const FitnessActivityReadScope = |
| 22 "https://www.googleapis.com/auth/fitness.activity.read"; |
| 23 | 23 |
| 24 /** View and store your activity information in Google Fit */ | 24 /// View and store your activity information in Google Fit |
| 25 static const FitnessActivityWriteScope = "https://www.googleapis.com/auth/fitn
ess.activity.write"; | 25 static const FitnessActivityWriteScope = |
| 26 "https://www.googleapis.com/auth/fitness.activity.write"; |
| 26 | 27 |
| 27 /** View blood glucose data in Google Fit */ | 28 /// View blood glucose data in Google Fit |
| 28 static const FitnessBloodGlucoseReadScope = "https://www.googleapis.com/auth/f
itness.blood_glucose.read"; | 29 static const FitnessBloodGlucoseReadScope = |
| 30 "https://www.googleapis.com/auth/fitness.blood_glucose.read"; |
| 29 | 31 |
| 30 /** View and store blood glucose data in Google Fit */ | 32 /// View and store blood glucose data in Google Fit |
| 31 static const FitnessBloodGlucoseWriteScope = "https://www.googleapis.com/auth/
fitness.blood_glucose.write"; | 33 static const FitnessBloodGlucoseWriteScope = |
| 34 "https://www.googleapis.com/auth/fitness.blood_glucose.write"; |
| 32 | 35 |
| 33 /** View blood pressure data in Google Fit */ | 36 /// View blood pressure data in Google Fit |
| 34 static const FitnessBloodPressureReadScope = "https://www.googleapis.com/auth/
fitness.blood_pressure.read"; | 37 static const FitnessBloodPressureReadScope = |
| 38 "https://www.googleapis.com/auth/fitness.blood_pressure.read"; |
| 35 | 39 |
| 36 /** View and store blood pressure data in Google Fit */ | 40 /// View and store blood pressure data in Google Fit |
| 37 static const FitnessBloodPressureWriteScope = "https://www.googleapis.com/auth
/fitness.blood_pressure.write"; | 41 static const FitnessBloodPressureWriteScope = |
| 42 "https://www.googleapis.com/auth/fitness.blood_pressure.write"; |
| 38 | 43 |
| 39 /** View body sensor information in Google Fit */ | 44 /// View body sensor information in Google Fit |
| 40 static const FitnessBodyReadScope = "https://www.googleapis.com/auth/fitness.b
ody.read"; | 45 static const FitnessBodyReadScope = |
| 46 "https://www.googleapis.com/auth/fitness.body.read"; |
| 41 | 47 |
| 42 /** View and store body sensor data in Google Fit */ | 48 /// View and store body sensor data in Google Fit |
| 43 static const FitnessBodyWriteScope = "https://www.googleapis.com/auth/fitness.
body.write"; | 49 static const FitnessBodyWriteScope = |
| 50 "https://www.googleapis.com/auth/fitness.body.write"; |
| 44 | 51 |
| 45 /** View body temperature data in Google Fit */ | 52 /// View body temperature data in Google Fit |
| 46 static const FitnessBodyTemperatureReadScope = "https://www.googleapis.com/aut
h/fitness.body_temperature.read"; | 53 static const FitnessBodyTemperatureReadScope = |
| 54 "https://www.googleapis.com/auth/fitness.body_temperature.read"; |
| 47 | 55 |
| 48 /** View and store body temperature data in Google Fit */ | 56 /// View and store body temperature data in Google Fit |
| 49 static const FitnessBodyTemperatureWriteScope = "https://www.googleapis.com/au
th/fitness.body_temperature.write"; | 57 static const FitnessBodyTemperatureWriteScope = |
| 58 "https://www.googleapis.com/auth/fitness.body_temperature.write"; |
| 50 | 59 |
| 51 /** View your stored location data in Google Fit */ | 60 /// View your stored location data in Google Fit |
| 52 static const FitnessLocationReadScope = "https://www.googleapis.com/auth/fitne
ss.location.read"; | 61 static const FitnessLocationReadScope = |
| 62 "https://www.googleapis.com/auth/fitness.location.read"; |
| 53 | 63 |
| 54 /** View and store your location data in Google Fit */ | 64 /// View and store your location data in Google Fit |
| 55 static const FitnessLocationWriteScope = "https://www.googleapis.com/auth/fitn
ess.location.write"; | 65 static const FitnessLocationWriteScope = |
| 66 "https://www.googleapis.com/auth/fitness.location.write"; |
| 56 | 67 |
| 57 /** View nutrition information in Google Fit */ | 68 /// View nutrition information in Google Fit |
| 58 static const FitnessNutritionReadScope = "https://www.googleapis.com/auth/fitn
ess.nutrition.read"; | 69 static const FitnessNutritionReadScope = |
| 70 "https://www.googleapis.com/auth/fitness.nutrition.read"; |
| 59 | 71 |
| 60 /** View and store nutrition information in Google Fit */ | 72 /// View and store nutrition information in Google Fit |
| 61 static const FitnessNutritionWriteScope = "https://www.googleapis.com/auth/fit
ness.nutrition.write"; | 73 static const FitnessNutritionWriteScope = |
| 74 "https://www.googleapis.com/auth/fitness.nutrition.write"; |
| 62 | 75 |
| 63 /** View oxygen saturation data in Google Fit */ | 76 /// View oxygen saturation data in Google Fit |
| 64 static const FitnessOxygenSaturationReadScope = "https://www.googleapis.com/au
th/fitness.oxygen_saturation.read"; | 77 static const FitnessOxygenSaturationReadScope = |
| 78 "https://www.googleapis.com/auth/fitness.oxygen_saturation.read"; |
| 65 | 79 |
| 66 /** View and store oxygen saturation data in Google Fit */ | 80 /// View and store oxygen saturation data in Google Fit |
| 67 static const FitnessOxygenSaturationWriteScope = "https://www.googleapis.com/a
uth/fitness.oxygen_saturation.write"; | 81 static const FitnessOxygenSaturationWriteScope = |
| 82 "https://www.googleapis.com/auth/fitness.oxygen_saturation.write"; |
| 68 | 83 |
| 69 /** View reproductive health data in Google Fit */ | 84 /// View reproductive health data in Google Fit |
| 70 static const FitnessReproductiveHealthReadScope = "https://www.googleapis.com/
auth/fitness.reproductive_health.read"; | 85 static const FitnessReproductiveHealthReadScope = |
| 86 "https://www.googleapis.com/auth/fitness.reproductive_health.read"; |
| 71 | 87 |
| 72 /** View and store reproductive health data in Google Fit */ | 88 /// View and store reproductive health data in Google Fit |
| 73 static const FitnessReproductiveHealthWriteScope = "https://www.googleapis.com
/auth/fitness.reproductive_health.write"; | 89 static const FitnessReproductiveHealthWriteScope = |
| 74 | 90 "https://www.googleapis.com/auth/fitness.reproductive_health.write"; |
| 75 | 91 |
| 76 final commons.ApiRequester _requester; | 92 final commons.ApiRequester _requester; |
| 77 | 93 |
| 78 UsersResourceApi get users => new UsersResourceApi(_requester); | 94 UsersResourceApi get users => new UsersResourceApi(_requester); |
| 79 | 95 |
| 80 FitnessApi(http.Client client, {core.String rootUrl: "https://www.googleapis.c
om/", core.String servicePath: "fitness/v1/users/"}) : | 96 FitnessApi(http.Client client, |
| 81 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 97 {core.String rootUrl: "https://www.googleapis.com/", |
| 98 core.String servicePath: "fitness/v1/users/"}) |
| 99 : _requester = |
| 100 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
| 82 } | 101 } |
| 83 | 102 |
| 84 | |
| 85 class UsersResourceApi { | 103 class UsersResourceApi { |
| 86 final commons.ApiRequester _requester; | 104 final commons.ApiRequester _requester; |
| 87 | 105 |
| 88 UsersDataSourcesResourceApi get dataSources => new UsersDataSourcesResourceApi
(_requester); | 106 UsersDataSourcesResourceApi get dataSources => |
| 89 UsersDatasetResourceApi get dataset => new UsersDatasetResourceApi(_requester)
; | 107 new UsersDataSourcesResourceApi(_requester); |
| 90 UsersSessionsResourceApi get sessions => new UsersSessionsResourceApi(_request
er); | 108 UsersDatasetResourceApi get dataset => |
| 109 new UsersDatasetResourceApi(_requester); |
| 110 UsersSessionsResourceApi get sessions => |
| 111 new UsersSessionsResourceApi(_requester); |
| 91 | 112 |
| 92 UsersResourceApi(commons.ApiRequester client) : | 113 UsersResourceApi(commons.ApiRequester client) : _requester = client; |
| 93 _requester = client; | |
| 94 } | 114 } |
| 95 | 115 |
| 96 | |
| 97 class UsersDataSourcesResourceApi { | 116 class UsersDataSourcesResourceApi { |
| 98 final commons.ApiRequester _requester; | 117 final commons.ApiRequester _requester; |
| 99 | 118 |
| 100 UsersDataSourcesDatasetsResourceApi get datasets => new UsersDataSourcesDatase
tsResourceApi(_requester); | 119 UsersDataSourcesDatasetsResourceApi get datasets => |
| 120 new UsersDataSourcesDatasetsResourceApi(_requester); |
| 101 | 121 |
| 102 UsersDataSourcesResourceApi(commons.ApiRequester client) : | 122 UsersDataSourcesResourceApi(commons.ApiRequester client) |
| 103 _requester = client; | 123 : _requester = client; |
| 104 | 124 |
| 105 /** | 125 /// Creates a new data source that is unique across all data sources |
| 106 * Creates a new data source that is unique across all data sources belonging | 126 /// belonging to this user. The data stream ID field can be omitted and will |
| 107 * to this user. The data stream ID field can be omitted and will be generated | 127 /// be generated by the server with the correct format. The data stream ID is |
| 108 * by the server with the correct format. The data stream ID is an ordered | 128 /// an ordered combination of some fields from the data source. In addition |
| 109 * combination of some fields from the data source. In addition to the data | 129 /// to the data source fields reflected into the data source ID, the |
| 110 * source fields reflected into the data source ID, the developer project | 130 /// developer project number that is authenticated when creating the data |
| 111 * number that is authenticated when creating the data source is included. | 131 /// source is included. This developer project number is obfuscated when read |
| 112 * This developer project number is obfuscated when read by any other | 132 /// by any other developer reading public data types. |
| 113 * developer reading public data types. | 133 /// |
| 114 * | 134 /// [request] - The metadata request object. |
| 115 * [request] - The metadata request object. | 135 /// |
| 116 * | 136 /// Request parameters: |
| 117 * Request parameters: | 137 /// |
| 118 * | 138 /// [userId] - Create the data source for the person identified. Use me to |
| 119 * [userId] - Create the data source for the person identified. Use me to | 139 /// indicate the authenticated user. Only me is supported at this time. |
| 120 * indicate the authenticated user. Only me is supported at this time. | 140 /// |
| 121 * | 141 /// Completes with a [DataSource]. |
| 122 * Completes with a [DataSource]. | 142 /// |
| 123 * | 143 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 124 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 144 /// an error. |
| 125 * error. | 145 /// |
| 126 * | 146 /// If the used [http.Client] completes with an error when making a REST |
| 127 * If the used [http.Client] completes with an error when making a REST call, | 147 /// call, this method will complete with the same error. |
| 128 * this method will complete with the same error. | |
| 129 */ | |
| 130 async.Future<DataSource> create(DataSource request, core.String userId) { | 148 async.Future<DataSource> create(DataSource request, core.String userId) { |
| 131 var _url = null; | 149 var _url = null; |
| 132 var _queryParams = new core.Map(); | 150 var _queryParams = new core.Map(); |
| 133 var _uploadMedia = null; | 151 var _uploadMedia = null; |
| 134 var _uploadOptions = null; | 152 var _uploadOptions = null; |
| 135 var _downloadOptions = commons.DownloadOptions.Metadata; | 153 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 136 var _body = null; | 154 var _body = null; |
| 137 | 155 |
| 138 if (request != null) { | 156 if (request != null) { |
| 139 _body = convert.JSON.encode((request).toJson()); | 157 _body = convert.JSON.encode((request).toJson()); |
| 140 } | 158 } |
| 141 if (userId == null) { | 159 if (userId == null) { |
| 142 throw new core.ArgumentError("Parameter userId is required."); | 160 throw new core.ArgumentError("Parameter userId is required."); |
| 143 } | 161 } |
| 144 | 162 |
| 145 _url = commons.Escaper.ecapeVariable('$userId') + '/dataSources'; | 163 _url = commons.Escaper.ecapeVariable('$userId') + '/dataSources'; |
| 146 | 164 |
| 147 var _response = _requester.request(_url, | 165 var _response = _requester.request(_url, "POST", |
| 148 "POST", | 166 body: _body, |
| 149 body: _body, | 167 queryParams: _queryParams, |
| 150 queryParams: _queryParams, | 168 uploadOptions: _uploadOptions, |
| 151 uploadOptions: _uploadOptions, | 169 uploadMedia: _uploadMedia, |
| 152 uploadMedia: _uploadMedia, | 170 downloadOptions: _downloadOptions); |
| 153 downloadOptions: _downloadOptions); | |
| 154 return _response.then((data) => new DataSource.fromJson(data)); | 171 return _response.then((data) => new DataSource.fromJson(data)); |
| 155 } | 172 } |
| 156 | 173 |
| 157 /** | 174 /// Deletes the specified data source. The request will fail if the data |
| 158 * Deletes the specified data source. The request will fail if the data source | 175 /// source contains any data points. |
| 159 * contains any data points. | 176 /// |
| 160 * | 177 /// Request parameters: |
| 161 * Request parameters: | 178 /// |
| 162 * | 179 /// [userId] - Retrieve a data source for the person identified. Use me to |
| 163 * [userId] - Retrieve a data source for the person identified. Use me to | 180 /// indicate the authenticated user. Only me is supported at this time. |
| 164 * indicate the authenticated user. Only me is supported at this time. | 181 /// |
| 165 * | 182 /// [dataSourceId] - The data stream ID of the data source to delete. |
| 166 * [dataSourceId] - The data stream ID of the data source to delete. | 183 /// |
| 167 * | 184 /// Completes with a [DataSource]. |
| 168 * Completes with a [DataSource]. | 185 /// |
| 169 * | 186 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 170 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 187 /// an error. |
| 171 * error. | 188 /// |
| 172 * | 189 /// If the used [http.Client] completes with an error when making a REST |
| 173 * If the used [http.Client] completes with an error when making a REST call, | 190 /// call, this method will complete with the same error. |
| 174 * this method will complete with the same error. | 191 async.Future<DataSource> delete( |
| 175 */ | 192 core.String userId, core.String dataSourceId) { |
| 176 async.Future<DataSource> delete(core.String userId, core.String dataSourceId)
{ | |
| 177 var _url = null; | 193 var _url = null; |
| 178 var _queryParams = new core.Map(); | 194 var _queryParams = new core.Map(); |
| 179 var _uploadMedia = null; | 195 var _uploadMedia = null; |
| 180 var _uploadOptions = null; | 196 var _uploadOptions = null; |
| 181 var _downloadOptions = commons.DownloadOptions.Metadata; | 197 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 182 var _body = null; | 198 var _body = null; |
| 183 | 199 |
| 184 if (userId == null) { | 200 if (userId == null) { |
| 185 throw new core.ArgumentError("Parameter userId is required."); | 201 throw new core.ArgumentError("Parameter userId is required."); |
| 186 } | 202 } |
| 187 if (dataSourceId == null) { | 203 if (dataSourceId == null) { |
| 188 throw new core.ArgumentError("Parameter dataSourceId is required."); | 204 throw new core.ArgumentError("Parameter dataSourceId is required."); |
| 189 } | 205 } |
| 190 | 206 |
| 191 _url = commons.Escaper.ecapeVariable('$userId') + '/dataSources/' + commons.
Escaper.ecapeVariable('$dataSourceId'); | 207 _url = commons.Escaper.ecapeVariable('$userId') + |
| 208 '/dataSources/' + |
| 209 commons.Escaper.ecapeVariable('$dataSourceId'); |
| 192 | 210 |
| 193 var _response = _requester.request(_url, | 211 var _response = _requester.request(_url, "DELETE", |
| 194 "DELETE", | 212 body: _body, |
| 195 body: _body, | 213 queryParams: _queryParams, |
| 196 queryParams: _queryParams, | 214 uploadOptions: _uploadOptions, |
| 197 uploadOptions: _uploadOptions, | 215 uploadMedia: _uploadMedia, |
| 198 uploadMedia: _uploadMedia, | 216 downloadOptions: _downloadOptions); |
| 199 downloadOptions: _downloadOptions); | |
| 200 return _response.then((data) => new DataSource.fromJson(data)); | 217 return _response.then((data) => new DataSource.fromJson(data)); |
| 201 } | 218 } |
| 202 | 219 |
| 203 /** | 220 /// Returns the specified data source. |
| 204 * Returns the specified data source. | 221 /// |
| 205 * | 222 /// Request parameters: |
| 206 * Request parameters: | 223 /// |
| 207 * | 224 /// [userId] - Retrieve a data source for the person identified. Use me to |
| 208 * [userId] - Retrieve a data source for the person identified. Use me to | 225 /// indicate the authenticated user. Only me is supported at this time. |
| 209 * indicate the authenticated user. Only me is supported at this time. | 226 /// |
| 210 * | 227 /// [dataSourceId] - The data stream ID of the data source to retrieve. |
| 211 * [dataSourceId] - The data stream ID of the data source to retrieve. | 228 /// |
| 212 * | 229 /// Completes with a [DataSource]. |
| 213 * Completes with a [DataSource]. | 230 /// |
| 214 * | 231 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 215 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 232 /// an error. |
| 216 * error. | 233 /// |
| 217 * | 234 /// If the used [http.Client] completes with an error when making a REST |
| 218 * If the used [http.Client] completes with an error when making a REST call, | 235 /// call, this method will complete with the same error. |
| 219 * this method will complete with the same error. | |
| 220 */ | |
| 221 async.Future<DataSource> get(core.String userId, core.String dataSourceId) { | 236 async.Future<DataSource> get(core.String userId, core.String dataSourceId) { |
| 222 var _url = null; | 237 var _url = null; |
| 223 var _queryParams = new core.Map(); | 238 var _queryParams = new core.Map(); |
| 224 var _uploadMedia = null; | 239 var _uploadMedia = null; |
| 225 var _uploadOptions = null; | 240 var _uploadOptions = null; |
| 226 var _downloadOptions = commons.DownloadOptions.Metadata; | 241 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 227 var _body = null; | 242 var _body = null; |
| 228 | 243 |
| 229 if (userId == null) { | 244 if (userId == null) { |
| 230 throw new core.ArgumentError("Parameter userId is required."); | 245 throw new core.ArgumentError("Parameter userId is required."); |
| 231 } | 246 } |
| 232 if (dataSourceId == null) { | 247 if (dataSourceId == null) { |
| 233 throw new core.ArgumentError("Parameter dataSourceId is required."); | 248 throw new core.ArgumentError("Parameter dataSourceId is required."); |
| 234 } | 249 } |
| 235 | 250 |
| 236 _url = commons.Escaper.ecapeVariable('$userId') + '/dataSources/' + commons.
Escaper.ecapeVariable('$dataSourceId'); | 251 _url = commons.Escaper.ecapeVariable('$userId') + |
| 252 '/dataSources/' + |
| 253 commons.Escaper.ecapeVariable('$dataSourceId'); |
| 237 | 254 |
| 238 var _response = _requester.request(_url, | 255 var _response = _requester.request(_url, "GET", |
| 239 "GET", | 256 body: _body, |
| 240 body: _body, | 257 queryParams: _queryParams, |
| 241 queryParams: _queryParams, | 258 uploadOptions: _uploadOptions, |
| 242 uploadOptions: _uploadOptions, | 259 uploadMedia: _uploadMedia, |
| 243 uploadMedia: _uploadMedia, | 260 downloadOptions: _downloadOptions); |
| 244 downloadOptions: _downloadOptions); | |
| 245 return _response.then((data) => new DataSource.fromJson(data)); | 261 return _response.then((data) => new DataSource.fromJson(data)); |
| 246 } | 262 } |
| 247 | 263 |
| 248 /** | 264 /// Lists all data sources that are visible to the developer, using the OAuth |
| 249 * Lists all data sources that are visible to the developer, using the OAuth | 265 /// scopes provided. The list is not exhaustive; the user may have private |
| 250 * scopes provided. The list is not exhaustive; the user may have private data | 266 /// data sources that are only visible to other developers, or calls using |
| 251 * sources that are only visible to other developers, or calls using other | 267 /// other scopes. |
| 252 * scopes. | 268 /// |
| 253 * | 269 /// Request parameters: |
| 254 * Request parameters: | 270 /// |
| 255 * | 271 /// [userId] - List data sources for the person identified. Use me to |
| 256 * [userId] - List data sources for the person identified. Use me to indicate | 272 /// indicate the authenticated user. Only me is supported at this time. |
| 257 * the authenticated user. Only me is supported at this time. | 273 /// |
| 258 * | 274 /// [dataTypeName] - The names of data types to include in the list. If not |
| 259 * [dataTypeName] - The names of data types to include in the list. If not | 275 /// specified, all data sources will be returned. |
| 260 * specified, all data sources will be returned. | 276 /// |
| 261 * | 277 /// Completes with a [ListDataSourcesResponse]. |
| 262 * Completes with a [ListDataSourcesResponse]. | 278 /// |
| 263 * | 279 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 264 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 280 /// an error. |
| 265 * error. | 281 /// |
| 266 * | 282 /// If the used [http.Client] completes with an error when making a REST |
| 267 * If the used [http.Client] completes with an error when making a REST call, | 283 /// call, this method will complete with the same error. |
| 268 * this method will complete with the same error. | 284 async.Future<ListDataSourcesResponse> list(core.String userId, |
| 269 */ | 285 {core.List<core.String> dataTypeName}) { |
| 270 async.Future<ListDataSourcesResponse> list(core.String userId, {core.List<core
.String> dataTypeName}) { | |
| 271 var _url = null; | 286 var _url = null; |
| 272 var _queryParams = new core.Map(); | 287 var _queryParams = new core.Map(); |
| 273 var _uploadMedia = null; | 288 var _uploadMedia = null; |
| 274 var _uploadOptions = null; | 289 var _uploadOptions = null; |
| 275 var _downloadOptions = commons.DownloadOptions.Metadata; | 290 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 276 var _body = null; | 291 var _body = null; |
| 277 | 292 |
| 278 if (userId == null) { | 293 if (userId == null) { |
| 279 throw new core.ArgumentError("Parameter userId is required."); | 294 throw new core.ArgumentError("Parameter userId is required."); |
| 280 } | 295 } |
| 281 if (dataTypeName != null) { | 296 if (dataTypeName != null) { |
| 282 _queryParams["dataTypeName"] = dataTypeName; | 297 _queryParams["dataTypeName"] = dataTypeName; |
| 283 } | 298 } |
| 284 | 299 |
| 285 _url = commons.Escaper.ecapeVariable('$userId') + '/dataSources'; | 300 _url = commons.Escaper.ecapeVariable('$userId') + '/dataSources'; |
| 286 | 301 |
| 287 var _response = _requester.request(_url, | 302 var _response = _requester.request(_url, "GET", |
| 288 "GET", | 303 body: _body, |
| 289 body: _body, | 304 queryParams: _queryParams, |
| 290 queryParams: _queryParams, | 305 uploadOptions: _uploadOptions, |
| 291 uploadOptions: _uploadOptions, | 306 uploadMedia: _uploadMedia, |
| 292 uploadMedia: _uploadMedia, | 307 downloadOptions: _downloadOptions); |
| 293 downloadOptions: _downloadOptions); | |
| 294 return _response.then((data) => new ListDataSourcesResponse.fromJson(data)); | 308 return _response.then((data) => new ListDataSourcesResponse.fromJson(data)); |
| 295 } | 309 } |
| 296 | 310 |
| 297 /** | 311 /// Updates the specified data source. The dataStreamId, dataType, type, |
| 298 * Updates the specified data source. The dataStreamId, dataType, type, | 312 /// dataStreamName, and device properties with the exception of version, |
| 299 * dataStreamName, and device properties with the exception of version, cannot | 313 /// cannot be modified. |
| 300 * be modified. | 314 /// |
| 301 * | 315 /// Data sources are identified by their dataStreamId. This method supports |
| 302 * Data sources are identified by their dataStreamId. This method supports | 316 /// patch semantics. |
| 303 * patch semantics. | 317 /// |
| 304 * | 318 /// [request] - The metadata request object. |
| 305 * [request] - The metadata request object. | 319 /// |
| 306 * | 320 /// Request parameters: |
| 307 * Request parameters: | 321 /// |
| 308 * | 322 /// [userId] - Update the data source for the person identified. Use me to |
| 309 * [userId] - Update the data source for the person identified. Use me to | 323 /// indicate the authenticated user. Only me is supported at this time. |
| 310 * indicate the authenticated user. Only me is supported at this time. | 324 /// |
| 311 * | 325 /// [dataSourceId] - The data stream ID of the data source to update. |
| 312 * [dataSourceId] - The data stream ID of the data source to update. | 326 /// |
| 313 * | 327 /// Completes with a [DataSource]. |
| 314 * Completes with a [DataSource]. | 328 /// |
| 315 * | 329 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 316 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 330 /// an error. |
| 317 * error. | 331 /// |
| 318 * | 332 /// If the used [http.Client] completes with an error when making a REST |
| 319 * If the used [http.Client] completes with an error when making a REST call, | 333 /// call, this method will complete with the same error. |
| 320 * this method will complete with the same error. | 334 async.Future<DataSource> patch( |
| 321 */ | 335 DataSource request, core.String userId, core.String dataSourceId) { |
| 322 async.Future<DataSource> patch(DataSource request, core.String userId, core.St
ring dataSourceId) { | |
| 323 var _url = null; | 336 var _url = null; |
| 324 var _queryParams = new core.Map(); | 337 var _queryParams = new core.Map(); |
| 325 var _uploadMedia = null; | 338 var _uploadMedia = null; |
| 326 var _uploadOptions = null; | 339 var _uploadOptions = null; |
| 327 var _downloadOptions = commons.DownloadOptions.Metadata; | 340 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 328 var _body = null; | 341 var _body = null; |
| 329 | 342 |
| 330 if (request != null) { | 343 if (request != null) { |
| 331 _body = convert.JSON.encode((request).toJson()); | 344 _body = convert.JSON.encode((request).toJson()); |
| 332 } | 345 } |
| 333 if (userId == null) { | 346 if (userId == null) { |
| 334 throw new core.ArgumentError("Parameter userId is required."); | 347 throw new core.ArgumentError("Parameter userId is required."); |
| 335 } | 348 } |
| 336 if (dataSourceId == null) { | 349 if (dataSourceId == null) { |
| 337 throw new core.ArgumentError("Parameter dataSourceId is required."); | 350 throw new core.ArgumentError("Parameter dataSourceId is required."); |
| 338 } | 351 } |
| 339 | 352 |
| 340 _url = commons.Escaper.ecapeVariable('$userId') + '/dataSources/' + commons.
Escaper.ecapeVariable('$dataSourceId'); | 353 _url = commons.Escaper.ecapeVariable('$userId') + |
| 354 '/dataSources/' + |
| 355 commons.Escaper.ecapeVariable('$dataSourceId'); |
| 341 | 356 |
| 342 var _response = _requester.request(_url, | 357 var _response = _requester.request(_url, "PATCH", |
| 343 "PATCH", | 358 body: _body, |
| 344 body: _body, | 359 queryParams: _queryParams, |
| 345 queryParams: _queryParams, | 360 uploadOptions: _uploadOptions, |
| 346 uploadOptions: _uploadOptions, | 361 uploadMedia: _uploadMedia, |
| 347 uploadMedia: _uploadMedia, | 362 downloadOptions: _downloadOptions); |
| 348 downloadOptions: _downloadOptions); | |
| 349 return _response.then((data) => new DataSource.fromJson(data)); | 363 return _response.then((data) => new DataSource.fromJson(data)); |
| 350 } | 364 } |
| 351 | 365 |
| 352 /** | 366 /// Updates the specified data source. The dataStreamId, dataType, type, |
| 353 * Updates the specified data source. The dataStreamId, dataType, type, | 367 /// dataStreamName, and device properties with the exception of version, |
| 354 * dataStreamName, and device properties with the exception of version, cannot | 368 /// cannot be modified. |
| 355 * be modified. | 369 /// |
| 356 * | 370 /// Data sources are identified by their dataStreamId. |
| 357 * Data sources are identified by their dataStreamId. | 371 /// |
| 358 * | 372 /// [request] - The metadata request object. |
| 359 * [request] - The metadata request object. | 373 /// |
| 360 * | 374 /// Request parameters: |
| 361 * Request parameters: | 375 /// |
| 362 * | 376 /// [userId] - Update the data source for the person identified. Use me to |
| 363 * [userId] - Update the data source for the person identified. Use me to | 377 /// indicate the authenticated user. Only me is supported at this time. |
| 364 * indicate the authenticated user. Only me is supported at this time. | 378 /// |
| 365 * | 379 /// [dataSourceId] - The data stream ID of the data source to update. |
| 366 * [dataSourceId] - The data stream ID of the data source to update. | 380 /// |
| 367 * | 381 /// Completes with a [DataSource]. |
| 368 * Completes with a [DataSource]. | 382 /// |
| 369 * | 383 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 370 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 384 /// an error. |
| 371 * error. | 385 /// |
| 372 * | 386 /// If the used [http.Client] completes with an error when making a REST |
| 373 * If the used [http.Client] completes with an error when making a REST call, | 387 /// call, this method will complete with the same error. |
| 374 * this method will complete with the same error. | 388 async.Future<DataSource> update( |
| 375 */ | 389 DataSource request, core.String userId, core.String dataSourceId) { |
| 376 async.Future<DataSource> update(DataSource request, core.String userId, core.S
tring dataSourceId) { | |
| 377 var _url = null; | 390 var _url = null; |
| 378 var _queryParams = new core.Map(); | 391 var _queryParams = new core.Map(); |
| 379 var _uploadMedia = null; | 392 var _uploadMedia = null; |
| 380 var _uploadOptions = null; | 393 var _uploadOptions = null; |
| 381 var _downloadOptions = commons.DownloadOptions.Metadata; | 394 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 382 var _body = null; | 395 var _body = null; |
| 383 | 396 |
| 384 if (request != null) { | 397 if (request != null) { |
| 385 _body = convert.JSON.encode((request).toJson()); | 398 _body = convert.JSON.encode((request).toJson()); |
| 386 } | 399 } |
| 387 if (userId == null) { | 400 if (userId == null) { |
| 388 throw new core.ArgumentError("Parameter userId is required."); | 401 throw new core.ArgumentError("Parameter userId is required."); |
| 389 } | 402 } |
| 390 if (dataSourceId == null) { | 403 if (dataSourceId == null) { |
| 391 throw new core.ArgumentError("Parameter dataSourceId is required."); | 404 throw new core.ArgumentError("Parameter dataSourceId is required."); |
| 392 } | 405 } |
| 393 | 406 |
| 394 _url = commons.Escaper.ecapeVariable('$userId') + '/dataSources/' + commons.
Escaper.ecapeVariable('$dataSourceId'); | 407 _url = commons.Escaper.ecapeVariable('$userId') + |
| 408 '/dataSources/' + |
| 409 commons.Escaper.ecapeVariable('$dataSourceId'); |
| 395 | 410 |
| 396 var _response = _requester.request(_url, | 411 var _response = _requester.request(_url, "PUT", |
| 397 "PUT", | 412 body: _body, |
| 398 body: _body, | 413 queryParams: _queryParams, |
| 399 queryParams: _queryParams, | 414 uploadOptions: _uploadOptions, |
| 400 uploadOptions: _uploadOptions, | 415 uploadMedia: _uploadMedia, |
| 401 uploadMedia: _uploadMedia, | 416 downloadOptions: _downloadOptions); |
| 402 downloadOptions: _downloadOptions); | |
| 403 return _response.then((data) => new DataSource.fromJson(data)); | 417 return _response.then((data) => new DataSource.fromJson(data)); |
| 404 } | 418 } |
| 405 | |
| 406 } | 419 } |
| 407 | 420 |
| 408 | |
| 409 class UsersDataSourcesDatasetsResourceApi { | 421 class UsersDataSourcesDatasetsResourceApi { |
| 410 final commons.ApiRequester _requester; | 422 final commons.ApiRequester _requester; |
| 411 | 423 |
| 412 UsersDataSourcesDatasetsResourceApi(commons.ApiRequester client) : | 424 UsersDataSourcesDatasetsResourceApi(commons.ApiRequester client) |
| 413 _requester = client; | 425 : _requester = client; |
| 414 | 426 |
| 415 /** | 427 /// Performs an inclusive delete of all data points whose start and end times |
| 416 * Performs an inclusive delete of all data points whose start and end times | 428 /// have any overlap with the time range specified by the dataset ID. For |
| 417 * have any overlap with the time range specified by the dataset ID. For most | 429 /// most data types, the entire data point will be deleted. For data types |
| 418 * data types, the entire data point will be deleted. For data types where the | 430 /// where the time span represents a consistent value (such as |
| 419 * time span represents a consistent value (such as | 431 /// com.google.activity.segment), and a data point straddles either end point |
| 420 * com.google.activity.segment), and a data point straddles either end point | 432 /// of the dataset, only the overlapping portion of the data point will be |
| 421 * of the dataset, only the overlapping portion of the data point will be | 433 /// deleted. |
| 422 * deleted. | 434 /// |
| 423 * | 435 /// Request parameters: |
| 424 * Request parameters: | 436 /// |
| 425 * | 437 /// [userId] - Delete a dataset for the person identified. Use me to indicate |
| 426 * [userId] - Delete a dataset for the person identified. Use me to indicate | 438 /// the authenticated user. Only me is supported at this time. |
| 427 * the authenticated user. Only me is supported at this time. | 439 /// |
| 428 * | 440 /// [dataSourceId] - The data stream ID of the data source that created the |
| 429 * [dataSourceId] - The data stream ID of the data source that created the | 441 /// dataset. |
| 430 * dataset. | 442 /// |
| 431 * | 443 /// [datasetId] - Dataset identifier that is a composite of the minimum data |
| 432 * [datasetId] - Dataset identifier that is a composite of the minimum data | 444 /// point start time and maximum data point end time represented as |
| 433 * point start time and maximum data point end time represented as nanoseconds | 445 /// nanoseconds from the epoch. The ID is formatted like: "startTime-endTime" |
| 434 * from the epoch. The ID is formatted like: "startTime-endTime" where | 446 /// where startTime and endTime are 64 bit integers. |
| 435 * startTime and endTime are 64 bit integers. | 447 /// |
| 436 * | 448 /// [currentTimeMillis] - The client's current time in milliseconds since |
| 437 * [currentTimeMillis] - The client's current time in milliseconds since | 449 /// epoch. |
| 438 * epoch. | 450 /// |
| 439 * | 451 /// [modifiedTimeMillis] - When the operation was performed on the client. |
| 440 * [modifiedTimeMillis] - When the operation was performed on the client. | 452 /// |
| 441 * | 453 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 442 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 454 /// an error. |
| 443 * error. | 455 /// |
| 444 * | 456 /// If the used [http.Client] completes with an error when making a REST |
| 445 * If the used [http.Client] completes with an error when making a REST call, | 457 /// call, this method will complete with the same error. |
| 446 * this method will complete with the same error. | 458 async.Future delete( |
| 447 */ | 459 core.String userId, core.String dataSourceId, core.String datasetId, |
| 448 async.Future delete(core.String userId, core.String dataSourceId, core.String
datasetId, {core.String currentTimeMillis, core.String modifiedTimeMillis}) { | 460 {core.String currentTimeMillis, core.String modifiedTimeMillis}) { |
| 449 var _url = null; | 461 var _url = null; |
| 450 var _queryParams = new core.Map(); | 462 var _queryParams = new core.Map(); |
| 451 var _uploadMedia = null; | 463 var _uploadMedia = null; |
| 452 var _uploadOptions = null; | 464 var _uploadOptions = null; |
| 453 var _downloadOptions = commons.DownloadOptions.Metadata; | 465 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 454 var _body = null; | 466 var _body = null; |
| 455 | 467 |
| 456 if (userId == null) { | 468 if (userId == null) { |
| 457 throw new core.ArgumentError("Parameter userId is required."); | 469 throw new core.ArgumentError("Parameter userId is required."); |
| 458 } | 470 } |
| 459 if (dataSourceId == null) { | 471 if (dataSourceId == null) { |
| 460 throw new core.ArgumentError("Parameter dataSourceId is required."); | 472 throw new core.ArgumentError("Parameter dataSourceId is required."); |
| 461 } | 473 } |
| 462 if (datasetId == null) { | 474 if (datasetId == null) { |
| 463 throw new core.ArgumentError("Parameter datasetId is required."); | 475 throw new core.ArgumentError("Parameter datasetId is required."); |
| 464 } | 476 } |
| 465 if (currentTimeMillis != null) { | 477 if (currentTimeMillis != null) { |
| 466 _queryParams["currentTimeMillis"] = [currentTimeMillis]; | 478 _queryParams["currentTimeMillis"] = [currentTimeMillis]; |
| 467 } | 479 } |
| 468 if (modifiedTimeMillis != null) { | 480 if (modifiedTimeMillis != null) { |
| 469 _queryParams["modifiedTimeMillis"] = [modifiedTimeMillis]; | 481 _queryParams["modifiedTimeMillis"] = [modifiedTimeMillis]; |
| 470 } | 482 } |
| 471 | 483 |
| 472 _downloadOptions = null; | 484 _downloadOptions = null; |
| 473 | 485 |
| 474 _url = commons.Escaper.ecapeVariable('$userId') + '/dataSources/' + commons.
Escaper.ecapeVariable('$dataSourceId') + '/datasets/' + commons.Escaper.ecapeVar
iable('$datasetId'); | 486 _url = commons.Escaper.ecapeVariable('$userId') + |
| 487 '/dataSources/' + |
| 488 commons.Escaper.ecapeVariable('$dataSourceId') + |
| 489 '/datasets/' + |
| 490 commons.Escaper.ecapeVariable('$datasetId'); |
| 475 | 491 |
| 476 var _response = _requester.request(_url, | 492 var _response = _requester.request(_url, "DELETE", |
| 477 "DELETE", | 493 body: _body, |
| 478 body: _body, | 494 queryParams: _queryParams, |
| 479 queryParams: _queryParams, | 495 uploadOptions: _uploadOptions, |
| 480 uploadOptions: _uploadOptions, | 496 uploadMedia: _uploadMedia, |
| 481 uploadMedia: _uploadMedia, | 497 downloadOptions: _downloadOptions); |
| 482 downloadOptions: _downloadOptions); | |
| 483 return _response.then((data) => null); | 498 return _response.then((data) => null); |
| 484 } | 499 } |
| 485 | 500 |
| 486 /** | 501 /// Returns a dataset containing all data points whose start and end times |
| 487 * Returns a dataset containing all data points whose start and end times | 502 /// overlap with the specified range of the dataset minimum start time and |
| 488 * overlap with the specified range of the dataset minimum start time and | 503 /// maximum end time. Specifically, any data point whose start time is less |
| 489 * maximum end time. Specifically, any data point whose start time is less | 504 /// than or equal to the dataset end time and whose end time is greater than |
| 490 * than or equal to the dataset end time and whose end time is greater than or | 505 /// or equal to the dataset start time. |
| 491 * equal to the dataset start time. | 506 /// |
| 492 * | 507 /// Request parameters: |
| 493 * Request parameters: | 508 /// |
| 494 * | 509 /// [userId] - Retrieve a dataset for the person identified. Use me to |
| 495 * [userId] - Retrieve a dataset for the person identified. Use me to indicate | 510 /// indicate the authenticated user. Only me is supported at this time. |
| 496 * the authenticated user. Only me is supported at this time. | 511 /// |
| 497 * | 512 /// [dataSourceId] - The data stream ID of the data source that created the |
| 498 * [dataSourceId] - The data stream ID of the data source that created the | 513 /// dataset. |
| 499 * dataset. | 514 /// |
| 500 * | 515 /// [datasetId] - Dataset identifier that is a composite of the minimum data |
| 501 * [datasetId] - Dataset identifier that is a composite of the minimum data | 516 /// point start time and maximum data point end time represented as |
| 502 * point start time and maximum data point end time represented as nanoseconds | 517 /// nanoseconds from the epoch. The ID is formatted like: "startTime-endTime" |
| 503 * from the epoch. The ID is formatted like: "startTime-endTime" where | 518 /// where startTime and endTime are 64 bit integers. |
| 504 * startTime and endTime are 64 bit integers. | 519 /// |
| 505 * | 520 /// [limit] - If specified, no more than this many data points will be |
| 506 * [limit] - If specified, no more than this many data points will be included | 521 /// included in the dataset. If there are more data points in the dataset, |
| 507 * in the dataset. If there are more data points in the dataset, nextPageToken | 522 /// nextPageToken will be set in the dataset response. |
| 508 * will be set in the dataset response. | 523 /// |
| 509 * | 524 /// [pageToken] - The continuation token, which is used to page through large |
| 510 * [pageToken] - The continuation token, which is used to page through large | 525 /// datasets. To get the next page of a dataset, set this parameter to the |
| 511 * datasets. To get the next page of a dataset, set this parameter to the | 526 /// value of nextPageToken from the previous response. Each subsequent call |
| 512 * value of nextPageToken from the previous response. Each subsequent call | 527 /// will yield a partial dataset with data point end timestamps that are |
| 513 * will yield a partial dataset with data point end timestamps that are | 528 /// strictly smaller than those in the previous partial response. |
| 514 * strictly smaller than those in the previous partial response. | 529 /// |
| 515 * | 530 /// Completes with a [Dataset]. |
| 516 * Completes with a [Dataset]. | 531 /// |
| 517 * | 532 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 518 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 533 /// an error. |
| 519 * error. | 534 /// |
| 520 * | 535 /// If the used [http.Client] completes with an error when making a REST |
| 521 * If the used [http.Client] completes with an error when making a REST call, | 536 /// call, this method will complete with the same error. |
| 522 * this method will complete with the same error. | 537 async.Future<Dataset> get( |
| 523 */ | 538 core.String userId, core.String dataSourceId, core.String datasetId, |
| 524 async.Future<Dataset> get(core.String userId, core.String dataSourceId, core.S
tring datasetId, {core.int limit, core.String pageToken}) { | 539 {core.int limit, core.String pageToken}) { |
| 525 var _url = null; | 540 var _url = null; |
| 526 var _queryParams = new core.Map(); | 541 var _queryParams = new core.Map(); |
| 527 var _uploadMedia = null; | 542 var _uploadMedia = null; |
| 528 var _uploadOptions = null; | 543 var _uploadOptions = null; |
| 529 var _downloadOptions = commons.DownloadOptions.Metadata; | 544 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 530 var _body = null; | 545 var _body = null; |
| 531 | 546 |
| 532 if (userId == null) { | 547 if (userId == null) { |
| 533 throw new core.ArgumentError("Parameter userId is required."); | 548 throw new core.ArgumentError("Parameter userId is required."); |
| 534 } | 549 } |
| 535 if (dataSourceId == null) { | 550 if (dataSourceId == null) { |
| 536 throw new core.ArgumentError("Parameter dataSourceId is required."); | 551 throw new core.ArgumentError("Parameter dataSourceId is required."); |
| 537 } | 552 } |
| 538 if (datasetId == null) { | 553 if (datasetId == null) { |
| 539 throw new core.ArgumentError("Parameter datasetId is required."); | 554 throw new core.ArgumentError("Parameter datasetId is required."); |
| 540 } | 555 } |
| 541 if (limit != null) { | 556 if (limit != null) { |
| 542 _queryParams["limit"] = ["${limit}"]; | 557 _queryParams["limit"] = ["${limit}"]; |
| 543 } | 558 } |
| 544 if (pageToken != null) { | 559 if (pageToken != null) { |
| 545 _queryParams["pageToken"] = [pageToken]; | 560 _queryParams["pageToken"] = [pageToken]; |
| 546 } | 561 } |
| 547 | 562 |
| 548 _url = commons.Escaper.ecapeVariable('$userId') + '/dataSources/' + commons.
Escaper.ecapeVariable('$dataSourceId') + '/datasets/' + commons.Escaper.ecapeVar
iable('$datasetId'); | 563 _url = commons.Escaper.ecapeVariable('$userId') + |
| 564 '/dataSources/' + |
| 565 commons.Escaper.ecapeVariable('$dataSourceId') + |
| 566 '/datasets/' + |
| 567 commons.Escaper.ecapeVariable('$datasetId'); |
| 549 | 568 |
| 550 var _response = _requester.request(_url, | 569 var _response = _requester.request(_url, "GET", |
| 551 "GET", | 570 body: _body, |
| 552 body: _body, | 571 queryParams: _queryParams, |
| 553 queryParams: _queryParams, | 572 uploadOptions: _uploadOptions, |
| 554 uploadOptions: _uploadOptions, | 573 uploadMedia: _uploadMedia, |
| 555 uploadMedia: _uploadMedia, | 574 downloadOptions: _downloadOptions); |
| 556 downloadOptions: _downloadOptions); | |
| 557 return _response.then((data) => new Dataset.fromJson(data)); | 575 return _response.then((data) => new Dataset.fromJson(data)); |
| 558 } | 576 } |
| 559 | 577 |
| 560 /** | 578 /// Adds data points to a dataset. The dataset need not be previously |
| 561 * Adds data points to a dataset. The dataset need not be previously created. | 579 /// created. All points within the given dataset will be returned with |
| 562 * All points within the given dataset will be returned with subsquent calls | 580 /// subsquent calls to retrieve this dataset. Data points can belong to more |
| 563 * to retrieve this dataset. Data points can belong to more than one dataset. | 581 /// than one dataset. This method does not use patch semantics. |
| 564 * This method does not use patch semantics. | 582 /// |
| 565 * | 583 /// [request] - The metadata request object. |
| 566 * [request] - The metadata request object. | 584 /// |
| 567 * | 585 /// Request parameters: |
| 568 * Request parameters: | 586 /// |
| 569 * | 587 /// [userId] - Patch a dataset for the person identified. Use me to indicate |
| 570 * [userId] - Patch a dataset for the person identified. Use me to indicate | 588 /// the authenticated user. Only me is supported at this time. |
| 571 * the authenticated user. Only me is supported at this time. | 589 /// |
| 572 * | 590 /// [dataSourceId] - The data stream ID of the data source that created the |
| 573 * [dataSourceId] - The data stream ID of the data source that created the | 591 /// dataset. |
| 574 * dataset. | 592 /// |
| 575 * | 593 /// [datasetId] - Dataset identifier that is a composite of the minimum data |
| 576 * [datasetId] - Dataset identifier that is a composite of the minimum data | 594 /// point start time and maximum data point end time represented as |
| 577 * point start time and maximum data point end time represented as nanoseconds | 595 /// nanoseconds from the epoch. The ID is formatted like: "startTime-endTime" |
| 578 * from the epoch. The ID is formatted like: "startTime-endTime" where | 596 /// where startTime and endTime are 64 bit integers. |
| 579 * startTime and endTime are 64 bit integers. | 597 /// |
| 580 * | 598 /// [currentTimeMillis] - The client's current time in milliseconds since |
| 581 * [currentTimeMillis] - The client's current time in milliseconds since | 599 /// epoch. Note that the minStartTimeNs and maxEndTimeNs properties in the |
| 582 * epoch. Note that the minStartTimeNs and maxEndTimeNs properties in the | 600 /// request body are in nanoseconds instead of milliseconds. |
| 583 * request body are in nanoseconds instead of milliseconds. | 601 /// |
| 584 * | 602 /// Completes with a [Dataset]. |
| 585 * Completes with a [Dataset]. | 603 /// |
| 586 * | 604 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 587 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 605 /// an error. |
| 588 * error. | 606 /// |
| 589 * | 607 /// If the used [http.Client] completes with an error when making a REST |
| 590 * If the used [http.Client] completes with an error when making a REST call, | 608 /// call, this method will complete with the same error. |
| 591 * this method will complete with the same error. | 609 async.Future<Dataset> patch(Dataset request, core.String userId, |
| 592 */ | 610 core.String dataSourceId, core.String datasetId, |
| 593 async.Future<Dataset> patch(Dataset request, core.String userId, core.String d
ataSourceId, core.String datasetId, {core.String currentTimeMillis}) { | 611 {core.String currentTimeMillis}) { |
| 594 var _url = null; | 612 var _url = null; |
| 595 var _queryParams = new core.Map(); | 613 var _queryParams = new core.Map(); |
| 596 var _uploadMedia = null; | 614 var _uploadMedia = null; |
| 597 var _uploadOptions = null; | 615 var _uploadOptions = null; |
| 598 var _downloadOptions = commons.DownloadOptions.Metadata; | 616 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 599 var _body = null; | 617 var _body = null; |
| 600 | 618 |
| 601 if (request != null) { | 619 if (request != null) { |
| 602 _body = convert.JSON.encode((request).toJson()); | 620 _body = convert.JSON.encode((request).toJson()); |
| 603 } | 621 } |
| 604 if (userId == null) { | 622 if (userId == null) { |
| 605 throw new core.ArgumentError("Parameter userId is required."); | 623 throw new core.ArgumentError("Parameter userId is required."); |
| 606 } | 624 } |
| 607 if (dataSourceId == null) { | 625 if (dataSourceId == null) { |
| 608 throw new core.ArgumentError("Parameter dataSourceId is required."); | 626 throw new core.ArgumentError("Parameter dataSourceId is required."); |
| 609 } | 627 } |
| 610 if (datasetId == null) { | 628 if (datasetId == null) { |
| 611 throw new core.ArgumentError("Parameter datasetId is required."); | 629 throw new core.ArgumentError("Parameter datasetId is required."); |
| 612 } | 630 } |
| 613 if (currentTimeMillis != null) { | 631 if (currentTimeMillis != null) { |
| 614 _queryParams["currentTimeMillis"] = [currentTimeMillis]; | 632 _queryParams["currentTimeMillis"] = [currentTimeMillis]; |
| 615 } | 633 } |
| 616 | 634 |
| 617 _url = commons.Escaper.ecapeVariable('$userId') + '/dataSources/' + commons.
Escaper.ecapeVariable('$dataSourceId') + '/datasets/' + commons.Escaper.ecapeVar
iable('$datasetId'); | 635 _url = commons.Escaper.ecapeVariable('$userId') + |
| 636 '/dataSources/' + |
| 637 commons.Escaper.ecapeVariable('$dataSourceId') + |
| 638 '/datasets/' + |
| 639 commons.Escaper.ecapeVariable('$datasetId'); |
| 618 | 640 |
| 619 var _response = _requester.request(_url, | 641 var _response = _requester.request(_url, "PATCH", |
| 620 "PATCH", | 642 body: _body, |
| 621 body: _body, | 643 queryParams: _queryParams, |
| 622 queryParams: _queryParams, | 644 uploadOptions: _uploadOptions, |
| 623 uploadOptions: _uploadOptions, | 645 uploadMedia: _uploadMedia, |
| 624 uploadMedia: _uploadMedia, | 646 downloadOptions: _downloadOptions); |
| 625 downloadOptions: _downloadOptions); | |
| 626 return _response.then((data) => new Dataset.fromJson(data)); | 647 return _response.then((data) => new Dataset.fromJson(data)); |
| 627 } | 648 } |
| 628 | |
| 629 } | 649 } |
| 630 | 650 |
| 631 | |
| 632 class UsersDatasetResourceApi { | 651 class UsersDatasetResourceApi { |
| 633 final commons.ApiRequester _requester; | 652 final commons.ApiRequester _requester; |
| 634 | 653 |
| 635 UsersDatasetResourceApi(commons.ApiRequester client) : | 654 UsersDatasetResourceApi(commons.ApiRequester client) : _requester = client; |
| 636 _requester = client; | |
| 637 | 655 |
| 638 /** | 656 /// Aggregates data of a certain type or stream into buckets divided by a |
| 639 * Aggregates data of a certain type or stream into buckets divided by a given | 657 /// given type of boundary. Multiple data sets of multiple types and from |
| 640 * type of boundary. Multiple data sets of multiple types and from multiple | 658 /// multiple sources can be aggreated into exactly one bucket type per |
| 641 * sources can be aggreated into exactly one bucket type per request. | 659 /// request. |
| 642 * | 660 /// |
| 643 * [request] - The metadata request object. | 661 /// [request] - The metadata request object. |
| 644 * | 662 /// |
| 645 * Request parameters: | 663 /// Request parameters: |
| 646 * | 664 /// |
| 647 * [userId] - Aggregate data for the person identified. Use me to indicate the | 665 /// [userId] - Aggregate data for the person identified. Use me to indicate |
| 648 * authenticated user. Only me is supported at this time. | 666 /// the authenticated user. Only me is supported at this time. |
| 649 * | 667 /// |
| 650 * Completes with a [AggregateResponse]. | 668 /// Completes with a [AggregateResponse]. |
| 651 * | 669 /// |
| 652 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 670 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 653 * error. | 671 /// an error. |
| 654 * | 672 /// |
| 655 * If the used [http.Client] completes with an error when making a REST call, | 673 /// If the used [http.Client] completes with an error when making a REST |
| 656 * this method will complete with the same error. | 674 /// call, this method will complete with the same error. |
| 657 */ | 675 async.Future<AggregateResponse> aggregate( |
| 658 async.Future<AggregateResponse> aggregate(AggregateRequest request, core.Strin
g userId) { | 676 AggregateRequest request, core.String userId) { |
| 659 var _url = null; | 677 var _url = null; |
| 660 var _queryParams = new core.Map(); | 678 var _queryParams = new core.Map(); |
| 661 var _uploadMedia = null; | 679 var _uploadMedia = null; |
| 662 var _uploadOptions = null; | 680 var _uploadOptions = null; |
| 663 var _downloadOptions = commons.DownloadOptions.Metadata; | 681 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 664 var _body = null; | 682 var _body = null; |
| 665 | 683 |
| 666 if (request != null) { | 684 if (request != null) { |
| 667 _body = convert.JSON.encode((request).toJson()); | 685 _body = convert.JSON.encode((request).toJson()); |
| 668 } | 686 } |
| 669 if (userId == null) { | 687 if (userId == null) { |
| 670 throw new core.ArgumentError("Parameter userId is required."); | 688 throw new core.ArgumentError("Parameter userId is required."); |
| 671 } | 689 } |
| 672 | 690 |
| 673 _url = commons.Escaper.ecapeVariable('$userId') + '/dataset:aggregate'; | 691 _url = commons.Escaper.ecapeVariable('$userId') + '/dataset:aggregate'; |
| 674 | 692 |
| 675 var _response = _requester.request(_url, | 693 var _response = _requester.request(_url, "POST", |
| 676 "POST", | 694 body: _body, |
| 677 body: _body, | 695 queryParams: _queryParams, |
| 678 queryParams: _queryParams, | 696 uploadOptions: _uploadOptions, |
| 679 uploadOptions: _uploadOptions, | 697 uploadMedia: _uploadMedia, |
| 680 uploadMedia: _uploadMedia, | 698 downloadOptions: _downloadOptions); |
| 681 downloadOptions: _downloadOptions); | |
| 682 return _response.then((data) => new AggregateResponse.fromJson(data)); | 699 return _response.then((data) => new AggregateResponse.fromJson(data)); |
| 683 } | 700 } |
| 684 | |
| 685 } | 701 } |
| 686 | 702 |
| 687 | |
| 688 class UsersSessionsResourceApi { | 703 class UsersSessionsResourceApi { |
| 689 final commons.ApiRequester _requester; | 704 final commons.ApiRequester _requester; |
| 690 | 705 |
| 691 UsersSessionsResourceApi(commons.ApiRequester client) : | 706 UsersSessionsResourceApi(commons.ApiRequester client) : _requester = client; |
| 692 _requester = client; | |
| 693 | 707 |
| 694 /** | 708 /// Deletes a session specified by the given session ID. |
| 695 * Deletes a session specified by the given session ID. | 709 /// |
| 696 * | 710 /// Request parameters: |
| 697 * Request parameters: | 711 /// |
| 698 * | 712 /// [userId] - Delete a session for the person identified. Use me to indicate |
| 699 * [userId] - Delete a session for the person identified. Use me to indicate | 713 /// the authenticated user. Only me is supported at this time. |
| 700 * the authenticated user. Only me is supported at this time. | 714 /// |
| 701 * | 715 /// [sessionId] - The ID of the session to be deleted. |
| 702 * [sessionId] - The ID of the session to be deleted. | 716 /// |
| 703 * | 717 /// [currentTimeMillis] - The client's current time in milliseconds since |
| 704 * [currentTimeMillis] - The client's current time in milliseconds since | 718 /// epoch. |
| 705 * epoch. | 719 /// |
| 706 * | 720 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 707 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 721 /// an error. |
| 708 * error. | 722 /// |
| 709 * | 723 /// If the used [http.Client] completes with an error when making a REST |
| 710 * If the used [http.Client] completes with an error when making a REST call, | 724 /// call, this method will complete with the same error. |
| 711 * this method will complete with the same error. | 725 async.Future delete(core.String userId, core.String sessionId, |
| 712 */ | 726 {core.String currentTimeMillis}) { |
| 713 async.Future delete(core.String userId, core.String sessionId, {core.String cu
rrentTimeMillis}) { | |
| 714 var _url = null; | 727 var _url = null; |
| 715 var _queryParams = new core.Map(); | 728 var _queryParams = new core.Map(); |
| 716 var _uploadMedia = null; | 729 var _uploadMedia = null; |
| 717 var _uploadOptions = null; | 730 var _uploadOptions = null; |
| 718 var _downloadOptions = commons.DownloadOptions.Metadata; | 731 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 719 var _body = null; | 732 var _body = null; |
| 720 | 733 |
| 721 if (userId == null) { | 734 if (userId == null) { |
| 722 throw new core.ArgumentError("Parameter userId is required."); | 735 throw new core.ArgumentError("Parameter userId is required."); |
| 723 } | 736 } |
| 724 if (sessionId == null) { | 737 if (sessionId == null) { |
| 725 throw new core.ArgumentError("Parameter sessionId is required."); | 738 throw new core.ArgumentError("Parameter sessionId is required."); |
| 726 } | 739 } |
| 727 if (currentTimeMillis != null) { | 740 if (currentTimeMillis != null) { |
| 728 _queryParams["currentTimeMillis"] = [currentTimeMillis]; | 741 _queryParams["currentTimeMillis"] = [currentTimeMillis]; |
| 729 } | 742 } |
| 730 | 743 |
| 731 _downloadOptions = null; | 744 _downloadOptions = null; |
| 732 | 745 |
| 733 _url = commons.Escaper.ecapeVariable('$userId') + '/sessions/' + commons.Esc
aper.ecapeVariable('$sessionId'); | 746 _url = commons.Escaper.ecapeVariable('$userId') + |
| 747 '/sessions/' + |
| 748 commons.Escaper.ecapeVariable('$sessionId'); |
| 734 | 749 |
| 735 var _response = _requester.request(_url, | 750 var _response = _requester.request(_url, "DELETE", |
| 736 "DELETE", | 751 body: _body, |
| 737 body: _body, | 752 queryParams: _queryParams, |
| 738 queryParams: _queryParams, | 753 uploadOptions: _uploadOptions, |
| 739 uploadOptions: _uploadOptions, | 754 uploadMedia: _uploadMedia, |
| 740 uploadMedia: _uploadMedia, | 755 downloadOptions: _downloadOptions); |
| 741 downloadOptions: _downloadOptions); | |
| 742 return _response.then((data) => null); | 756 return _response.then((data) => null); |
| 743 } | 757 } |
| 744 | 758 |
| 745 /** | 759 /// Lists sessions previously created. |
| 746 * Lists sessions previously created. | 760 /// |
| 747 * | 761 /// Request parameters: |
| 748 * Request parameters: | 762 /// |
| 749 * | 763 /// [userId] - List sessions for the person identified. Use me to indicate |
| 750 * [userId] - List sessions for the person identified. Use me to indicate the | 764 /// the authenticated user. Only me is supported at this time. |
| 751 * authenticated user. Only me is supported at this time. | 765 /// |
| 752 * | 766 /// [endTime] - An RFC3339 timestamp. Only sessions ending between the start |
| 753 * [endTime] - An RFC3339 timestamp. Only sessions ending between the start | 767 /// and end times will be included in the response. |
| 754 * and end times will be included in the response. | 768 /// |
| 755 * | 769 /// [includeDeleted] - If true, deleted sessions will be returned. When set |
| 756 * [includeDeleted] - If true, deleted sessions will be returned. When set to | 770 /// to true, sessions returned in this response will only have an ID and will |
| 757 * true, sessions returned in this response will only have an ID and will not | 771 /// not have any other fields. |
| 758 * have any other fields. | 772 /// |
| 759 * | 773 /// [pageToken] - The continuation token, which is used to page through large |
| 760 * [pageToken] - The continuation token, which is used to page through large | 774 /// result sets. To get the next page of results, set this parameter to the |
| 761 * result sets. To get the next page of results, set this parameter to the | 775 /// value of nextPageToken from the previous response. |
| 762 * value of nextPageToken from the previous response. | 776 /// |
| 763 * | 777 /// [startTime] - An RFC3339 timestamp. Only sessions ending between the |
| 764 * [startTime] - An RFC3339 timestamp. Only sessions ending between the start | 778 /// start and end times will be included in the response. |
| 765 * and end times will be included in the response. | 779 /// |
| 766 * | 780 /// Completes with a [ListSessionsResponse]. |
| 767 * Completes with a [ListSessionsResponse]. | 781 /// |
| 768 * | 782 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 769 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 783 /// an error. |
| 770 * error. | 784 /// |
| 771 * | 785 /// If the used [http.Client] completes with an error when making a REST |
| 772 * If the used [http.Client] completes with an error when making a REST call, | 786 /// call, this method will complete with the same error. |
| 773 * this method will complete with the same error. | 787 async.Future<ListSessionsResponse> list(core.String userId, |
| 774 */ | 788 {core.String endTime, |
| 775 async.Future<ListSessionsResponse> list(core.String userId, {core.String endTi
me, core.bool includeDeleted, core.String pageToken, core.String startTime}) { | 789 core.bool includeDeleted, |
| 790 core.String pageToken, |
| 791 core.String startTime}) { |
| 776 var _url = null; | 792 var _url = null; |
| 777 var _queryParams = new core.Map(); | 793 var _queryParams = new core.Map(); |
| 778 var _uploadMedia = null; | 794 var _uploadMedia = null; |
| 779 var _uploadOptions = null; | 795 var _uploadOptions = null; |
| 780 var _downloadOptions = commons.DownloadOptions.Metadata; | 796 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 781 var _body = null; | 797 var _body = null; |
| 782 | 798 |
| 783 if (userId == null) { | 799 if (userId == null) { |
| 784 throw new core.ArgumentError("Parameter userId is required."); | 800 throw new core.ArgumentError("Parameter userId is required."); |
| 785 } | 801 } |
| 786 if (endTime != null) { | 802 if (endTime != null) { |
| 787 _queryParams["endTime"] = [endTime]; | 803 _queryParams["endTime"] = [endTime]; |
| 788 } | 804 } |
| 789 if (includeDeleted != null) { | 805 if (includeDeleted != null) { |
| 790 _queryParams["includeDeleted"] = ["${includeDeleted}"]; | 806 _queryParams["includeDeleted"] = ["${includeDeleted}"]; |
| 791 } | 807 } |
| 792 if (pageToken != null) { | 808 if (pageToken != null) { |
| 793 _queryParams["pageToken"] = [pageToken]; | 809 _queryParams["pageToken"] = [pageToken]; |
| 794 } | 810 } |
| 795 if (startTime != null) { | 811 if (startTime != null) { |
| 796 _queryParams["startTime"] = [startTime]; | 812 _queryParams["startTime"] = [startTime]; |
| 797 } | 813 } |
| 798 | 814 |
| 799 _url = commons.Escaper.ecapeVariable('$userId') + '/sessions'; | 815 _url = commons.Escaper.ecapeVariable('$userId') + '/sessions'; |
| 800 | 816 |
| 801 var _response = _requester.request(_url, | 817 var _response = _requester.request(_url, "GET", |
| 802 "GET", | 818 body: _body, |
| 803 body: _body, | 819 queryParams: _queryParams, |
| 804 queryParams: _queryParams, | 820 uploadOptions: _uploadOptions, |
| 805 uploadOptions: _uploadOptions, | 821 uploadMedia: _uploadMedia, |
| 806 uploadMedia: _uploadMedia, | 822 downloadOptions: _downloadOptions); |
| 807 downloadOptions: _downloadOptions); | |
| 808 return _response.then((data) => new ListSessionsResponse.fromJson(data)); | 823 return _response.then((data) => new ListSessionsResponse.fromJson(data)); |
| 809 } | 824 } |
| 810 | 825 |
| 811 /** | 826 /// Updates or insert a given session. |
| 812 * Updates or insert a given session. | 827 /// |
| 813 * | 828 /// [request] - The metadata request object. |
| 814 * [request] - The metadata request object. | 829 /// |
| 815 * | 830 /// Request parameters: |
| 816 * Request parameters: | 831 /// |
| 817 * | 832 /// [userId] - Create sessions for the person identified. Use me to indicate |
| 818 * [userId] - Create sessions for the person identified. Use me to indicate | 833 /// the authenticated user. Only me is supported at this time. |
| 819 * the authenticated user. Only me is supported at this time. | 834 /// |
| 820 * | 835 /// [sessionId] - The ID of the session to be created. |
| 821 * [sessionId] - The ID of the session to be created. | 836 /// |
| 822 * | 837 /// [currentTimeMillis] - The client's current time in milliseconds since |
| 823 * [currentTimeMillis] - The client's current time in milliseconds since | 838 /// epoch. |
| 824 * epoch. | 839 /// |
| 825 * | 840 /// Completes with a [Session]. |
| 826 * Completes with a [Session]. | 841 /// |
| 827 * | 842 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 828 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 843 /// an error. |
| 829 * error. | 844 /// |
| 830 * | 845 /// If the used [http.Client] completes with an error when making a REST |
| 831 * If the used [http.Client] completes with an error when making a REST call, | 846 /// call, this method will complete with the same error. |
| 832 * this method will complete with the same error. | 847 async.Future<Session> update( |
| 833 */ | 848 Session request, core.String userId, core.String sessionId, |
| 834 async.Future<Session> update(Session request, core.String userId, core.String
sessionId, {core.String currentTimeMillis}) { | 849 {core.String currentTimeMillis}) { |
| 835 var _url = null; | 850 var _url = null; |
| 836 var _queryParams = new core.Map(); | 851 var _queryParams = new core.Map(); |
| 837 var _uploadMedia = null; | 852 var _uploadMedia = null; |
| 838 var _uploadOptions = null; | 853 var _uploadOptions = null; |
| 839 var _downloadOptions = commons.DownloadOptions.Metadata; | 854 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 840 var _body = null; | 855 var _body = null; |
| 841 | 856 |
| 842 if (request != null) { | 857 if (request != null) { |
| 843 _body = convert.JSON.encode((request).toJson()); | 858 _body = convert.JSON.encode((request).toJson()); |
| 844 } | 859 } |
| 845 if (userId == null) { | 860 if (userId == null) { |
| 846 throw new core.ArgumentError("Parameter userId is required."); | 861 throw new core.ArgumentError("Parameter userId is required."); |
| 847 } | 862 } |
| 848 if (sessionId == null) { | 863 if (sessionId == null) { |
| 849 throw new core.ArgumentError("Parameter sessionId is required."); | 864 throw new core.ArgumentError("Parameter sessionId is required."); |
| 850 } | 865 } |
| 851 if (currentTimeMillis != null) { | 866 if (currentTimeMillis != null) { |
| 852 _queryParams["currentTimeMillis"] = [currentTimeMillis]; | 867 _queryParams["currentTimeMillis"] = [currentTimeMillis]; |
| 853 } | 868 } |
| 854 | 869 |
| 855 _url = commons.Escaper.ecapeVariable('$userId') + '/sessions/' + commons.Esc
aper.ecapeVariable('$sessionId'); | 870 _url = commons.Escaper.ecapeVariable('$userId') + |
| 871 '/sessions/' + |
| 872 commons.Escaper.ecapeVariable('$sessionId'); |
| 856 | 873 |
| 857 var _response = _requester.request(_url, | 874 var _response = _requester.request(_url, "PUT", |
| 858 "PUT", | 875 body: _body, |
| 859 body: _body, | 876 queryParams: _queryParams, |
| 860 queryParams: _queryParams, | 877 uploadOptions: _uploadOptions, |
| 861 uploadOptions: _uploadOptions, | 878 uploadMedia: _uploadMedia, |
| 862 uploadMedia: _uploadMedia, | 879 downloadOptions: _downloadOptions); |
| 863 downloadOptions: _downloadOptions); | |
| 864 return _response.then((data) => new Session.fromJson(data)); | 880 return _response.then((data) => new Session.fromJson(data)); |
| 865 } | 881 } |
| 866 | |
| 867 } | 882 } |
| 868 | 883 |
| 884 class AggregateBucket { |
| 885 /// Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT |
| 886 core.int activity; |
| 869 | 887 |
| 888 /// There will be one dataset per AggregateBy in the request. |
| 889 core.List<Dataset> dataset; |
| 870 | 890 |
| 871 class AggregateBucket { | 891 /// The end time for the aggregated data, in milliseconds since epoch, |
| 872 /** Available for Bucket.Type.ACTIVITY_TYPE, Bucket.Type.ACTIVITY_SEGMENT */ | 892 /// inclusive. |
| 873 core.int activity; | |
| 874 /** There will be one dataset per AggregateBy in the request. */ | |
| 875 core.List<Dataset> dataset; | |
| 876 /** | |
| 877 * The end time for the aggregated data, in milliseconds since epoch, | |
| 878 * inclusive. | |
| 879 */ | |
| 880 core.String endTimeMillis; | 893 core.String endTimeMillis; |
| 881 /** Available for Bucket.Type.SESSION */ | 894 |
| 895 /// Available for Bucket.Type.SESSION |
| 882 Session session; | 896 Session session; |
| 883 /** | 897 |
| 884 * The start time for the aggregated data, in milliseconds since epoch, | 898 /// The start time for the aggregated data, in milliseconds since epoch, |
| 885 * inclusive. | 899 /// inclusive. |
| 886 */ | |
| 887 core.String startTimeMillis; | 900 core.String startTimeMillis; |
| 888 /** | 901 |
| 889 * The type of a bucket signifies how the data aggregation is performed in the | 902 /// The type of a bucket signifies how the data aggregation is performed in |
| 890 * bucket. | 903 /// the bucket. |
| 891 * Possible string values are: | 904 /// Possible string values are: |
| 892 * - "activitySegment" | 905 /// - "activitySegment" |
| 893 * - "activityType" | 906 /// - "activityType" |
| 894 * - "session" | 907 /// - "session" |
| 895 * - "time" | 908 /// - "time" |
| 896 * - "unknown" | 909 /// - "unknown" |
| 897 */ | |
| 898 core.String type; | 910 core.String type; |
| 899 | 911 |
| 900 AggregateBucket(); | 912 AggregateBucket(); |
| 901 | 913 |
| 902 AggregateBucket.fromJson(core.Map _json) { | 914 AggregateBucket.fromJson(core.Map _json) { |
| 903 if (_json.containsKey("activity")) { | 915 if (_json.containsKey("activity")) { |
| 904 activity = _json["activity"]; | 916 activity = _json["activity"]; |
| 905 } | 917 } |
| 906 if (_json.containsKey("dataset")) { | 918 if (_json.containsKey("dataset")) { |
| 907 dataset = _json["dataset"].map((value) => new Dataset.fromJson(value)).toL
ist(); | 919 dataset = |
| 920 _json["dataset"].map((value) => new Dataset.fromJson(value)).toList(); |
| 908 } | 921 } |
| 909 if (_json.containsKey("endTimeMillis")) { | 922 if (_json.containsKey("endTimeMillis")) { |
| 910 endTimeMillis = _json["endTimeMillis"]; | 923 endTimeMillis = _json["endTimeMillis"]; |
| 911 } | 924 } |
| 912 if (_json.containsKey("session")) { | 925 if (_json.containsKey("session")) { |
| 913 session = new Session.fromJson(_json["session"]); | 926 session = new Session.fromJson(_json["session"]); |
| 914 } | 927 } |
| 915 if (_json.containsKey("startTimeMillis")) { | 928 if (_json.containsKey("startTimeMillis")) { |
| 916 startTimeMillis = _json["startTimeMillis"]; | 929 startTimeMillis = _json["startTimeMillis"]; |
| 917 } | 930 } |
| 918 if (_json.containsKey("type")) { | 931 if (_json.containsKey("type")) { |
| 919 type = _json["type"]; | 932 type = _json["type"]; |
| 920 } | 933 } |
| 921 } | 934 } |
| 922 | 935 |
| 923 core.Map<core.String, core.Object> toJson() { | 936 core.Map<core.String, core.Object> toJson() { |
| 924 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 937 final core.Map<core.String, core.Object> _json = |
| 938 new core.Map<core.String, core.Object>(); |
| 925 if (activity != null) { | 939 if (activity != null) { |
| 926 _json["activity"] = activity; | 940 _json["activity"] = activity; |
| 927 } | 941 } |
| 928 if (dataset != null) { | 942 if (dataset != null) { |
| 929 _json["dataset"] = dataset.map((value) => (value).toJson()).toList(); | 943 _json["dataset"] = dataset.map((value) => (value).toJson()).toList(); |
| 930 } | 944 } |
| 931 if (endTimeMillis != null) { | 945 if (endTimeMillis != null) { |
| 932 _json["endTimeMillis"] = endTimeMillis; | 946 _json["endTimeMillis"] = endTimeMillis; |
| 933 } | 947 } |
| 934 if (session != null) { | 948 if (session != null) { |
| 935 _json["session"] = (session).toJson(); | 949 _json["session"] = (session).toJson(); |
| 936 } | 950 } |
| 937 if (startTimeMillis != null) { | 951 if (startTimeMillis != null) { |
| 938 _json["startTimeMillis"] = startTimeMillis; | 952 _json["startTimeMillis"] = startTimeMillis; |
| 939 } | 953 } |
| 940 if (type != null) { | 954 if (type != null) { |
| 941 _json["type"] = type; | 955 _json["type"] = type; |
| 942 } | 956 } |
| 943 return _json; | 957 return _json; |
| 944 } | 958 } |
| 945 } | 959 } |
| 946 | 960 |
| 947 /** The specification of which data to aggregate. */ | 961 /// The specification of which data to aggregate. |
| 948 class AggregateBy { | 962 class AggregateBy { |
| 949 /** | 963 /// A data source ID to aggregate. Mutually exclusive of dataTypeName. Only |
| 950 * A data source ID to aggregate. Mutually exclusive of dataTypeName. Only | 964 /// data from the specified data source ID will be included in the |
| 951 * data from the specified data source ID will be included in the aggregation. | 965 /// aggregation. The dataset in the response will have the same data source |
| 952 * The dataset in the response will have the same data source ID. | 966 /// ID. |
| 953 */ | |
| 954 core.String dataSourceId; | 967 core.String dataSourceId; |
| 955 /** | 968 |
| 956 * The data type to aggregate. All data sources providing this data type will | 969 /// The data type to aggregate. All data sources providing this data type |
| 957 * contribute data to the aggregation. The response will contain a single | 970 /// will contribute data to the aggregation. The response will contain a |
| 958 * dataset for this data type name. The dataset will have a data source ID of | 971 /// single dataset for this data type name. The dataset will have a data |
| 959 * derived:com.google.:com.google.android.gms:aggregated | 972 /// source ID of derived:com.google.:com.google.android.gms:aggregated |
| 960 */ | |
| 961 core.String dataTypeName; | 973 core.String dataTypeName; |
| 962 | 974 |
| 963 AggregateBy(); | 975 AggregateBy(); |
| 964 | 976 |
| 965 AggregateBy.fromJson(core.Map _json) { | 977 AggregateBy.fromJson(core.Map _json) { |
| 966 if (_json.containsKey("dataSourceId")) { | 978 if (_json.containsKey("dataSourceId")) { |
| 967 dataSourceId = _json["dataSourceId"]; | 979 dataSourceId = _json["dataSourceId"]; |
| 968 } | 980 } |
| 969 if (_json.containsKey("dataTypeName")) { | 981 if (_json.containsKey("dataTypeName")) { |
| 970 dataTypeName = _json["dataTypeName"]; | 982 dataTypeName = _json["dataTypeName"]; |
| 971 } | 983 } |
| 972 } | 984 } |
| 973 | 985 |
| 974 core.Map<core.String, core.Object> toJson() { | 986 core.Map<core.String, core.Object> toJson() { |
| 975 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 987 final core.Map<core.String, core.Object> _json = |
| 988 new core.Map<core.String, core.Object>(); |
| 976 if (dataSourceId != null) { | 989 if (dataSourceId != null) { |
| 977 _json["dataSourceId"] = dataSourceId; | 990 _json["dataSourceId"] = dataSourceId; |
| 978 } | 991 } |
| 979 if (dataTypeName != null) { | 992 if (dataTypeName != null) { |
| 980 _json["dataTypeName"] = dataTypeName; | 993 _json["dataTypeName"] = dataTypeName; |
| 981 } | 994 } |
| 982 return _json; | 995 return _json; |
| 983 } | 996 } |
| 984 } | 997 } |
| 985 | 998 |
| 986 /** Next id: 10 */ | 999 /// Next id: 10 |
| 987 class AggregateRequest { | 1000 class AggregateRequest { |
| 988 /** | 1001 /// The specification of data to be aggregated. At least one aggregateBy spec |
| 989 * The specification of data to be aggregated. At least one aggregateBy spec | 1002 /// must be provided. All data that is specified will be aggregated using the |
| 990 * must be provided. All data that is specified will be aggregated using the | 1003 /// same bucketing criteria. There will be one dataset in the response for |
| 991 * same bucketing criteria. There will be one dataset in the response for | 1004 /// every aggregateBy spec. |
| 992 * every aggregateBy spec. | |
| 993 */ | |
| 994 core.List<AggregateBy> aggregateBy; | 1005 core.List<AggregateBy> aggregateBy; |
| 995 /** | 1006 |
| 996 * Specifies that data be aggregated each activity segment recored for a user. | 1007 /// Specifies that data be aggregated each activity segment recored for a |
| 997 * Similar to bucketByActivitySegment, but bucketing is done for each activity | 1008 /// user. Similar to bucketByActivitySegment, but bucketing is done for each |
| 998 * segment rather than all segments of the same type. Mutually exclusive of | 1009 /// activity segment rather than all segments of the same type. Mutually |
| 999 * other bucketing specifications. | 1010 /// exclusive of other bucketing specifications. |
| 1000 */ | |
| 1001 BucketByActivity bucketByActivitySegment; | 1011 BucketByActivity bucketByActivitySegment; |
| 1002 /** | 1012 |
| 1003 * Specifies that data be aggregated by the type of activity being performed | 1013 /// Specifies that data be aggregated by the type of activity being performed |
| 1004 * when the data was recorded. All data that was recorded during a certain | 1014 /// when the data was recorded. All data that was recorded during a certain |
| 1005 * activity type (for the given time range) will be aggregated into the same | 1015 /// activity type (for the given time range) will be aggregated into the same |
| 1006 * bucket. Data that was recorded while the user was not active will not be | 1016 /// bucket. Data that was recorded while the user was not active will not be |
| 1007 * included in the response. Mutually exclusive of other bucketing | 1017 /// included in the response. Mutually exclusive of other bucketing |
| 1008 * specifications. | 1018 /// specifications. |
| 1009 */ | |
| 1010 BucketByActivity bucketByActivityType; | 1019 BucketByActivity bucketByActivityType; |
| 1011 /** | 1020 |
| 1012 * Specifies that data be aggregated by user sessions. Data that does not fall | 1021 /// Specifies that data be aggregated by user sessions. Data that does not |
| 1013 * within the time range of a session will not be included in the response. | 1022 /// fall within the time range of a session will not be included in the |
| 1014 * Mutually exclusive of other bucketing specifications. | 1023 /// response. Mutually exclusive of other bucketing specifications. |
| 1015 */ | |
| 1016 BucketBySession bucketBySession; | 1024 BucketBySession bucketBySession; |
| 1017 /** | 1025 |
| 1018 * Specifies that data be aggregated by a single time interval. Mutually | 1026 /// Specifies that data be aggregated by a single time interval. Mutually |
| 1019 * exclusive of other bucketing specifications. | 1027 /// exclusive of other bucketing specifications. |
| 1020 */ | |
| 1021 BucketByTime bucketByTime; | 1028 BucketByTime bucketByTime; |
| 1022 /** | 1029 |
| 1023 * The end of a window of time. Data that intersects with this time window | 1030 /// The end of a window of time. Data that intersects with this time window |
| 1024 * will be aggregated. The time is in milliseconds since epoch, inclusive. | 1031 /// will be aggregated. The time is in milliseconds since epoch, inclusive. |
| 1025 */ | |
| 1026 core.String endTimeMillis; | 1032 core.String endTimeMillis; |
| 1027 /** | 1033 |
| 1028 * A list of acceptable data quality standards. Only data points which conform | 1034 /// A list of acceptable data quality standards. Only data points which |
| 1029 * to at least one of the specified data quality standards will be returned. | 1035 /// conform to at least one of the specified data quality standards will be |
| 1030 * If the list is empty, all data points are returned. | 1036 /// returned. If the list is empty, all data points are returned. |
| 1031 */ | |
| 1032 core.List<core.String> filteredDataQualityStandard; | 1037 core.List<core.String> filteredDataQualityStandard; |
| 1033 /** | 1038 |
| 1034 * The start of a window of time. Data that intersects with this time window | 1039 /// The start of a window of time. Data that intersects with this time window |
| 1035 * will be aggregated. The time is in milliseconds since epoch, inclusive. | 1040 /// will be aggregated. The time is in milliseconds since epoch, inclusive. |
| 1036 */ | |
| 1037 core.String startTimeMillis; | 1041 core.String startTimeMillis; |
| 1038 | 1042 |
| 1039 AggregateRequest(); | 1043 AggregateRequest(); |
| 1040 | 1044 |
| 1041 AggregateRequest.fromJson(core.Map _json) { | 1045 AggregateRequest.fromJson(core.Map _json) { |
| 1042 if (_json.containsKey("aggregateBy")) { | 1046 if (_json.containsKey("aggregateBy")) { |
| 1043 aggregateBy = _json["aggregateBy"].map((value) => new AggregateBy.fromJson
(value)).toList(); | 1047 aggregateBy = _json["aggregateBy"] |
| 1048 .map((value) => new AggregateBy.fromJson(value)) |
| 1049 .toList(); |
| 1044 } | 1050 } |
| 1045 if (_json.containsKey("bucketByActivitySegment")) { | 1051 if (_json.containsKey("bucketByActivitySegment")) { |
| 1046 bucketByActivitySegment = new BucketByActivity.fromJson(_json["bucketByAct
ivitySegment"]); | 1052 bucketByActivitySegment = |
| 1053 new BucketByActivity.fromJson(_json["bucketByActivitySegment"]); |
| 1047 } | 1054 } |
| 1048 if (_json.containsKey("bucketByActivityType")) { | 1055 if (_json.containsKey("bucketByActivityType")) { |
| 1049 bucketByActivityType = new BucketByActivity.fromJson(_json["bucketByActivi
tyType"]); | 1056 bucketByActivityType = |
| 1057 new BucketByActivity.fromJson(_json["bucketByActivityType"]); |
| 1050 } | 1058 } |
| 1051 if (_json.containsKey("bucketBySession")) { | 1059 if (_json.containsKey("bucketBySession")) { |
| 1052 bucketBySession = new BucketBySession.fromJson(_json["bucketBySession"]); | 1060 bucketBySession = new BucketBySession.fromJson(_json["bucketBySession"]); |
| 1053 } | 1061 } |
| 1054 if (_json.containsKey("bucketByTime")) { | 1062 if (_json.containsKey("bucketByTime")) { |
| 1055 bucketByTime = new BucketByTime.fromJson(_json["bucketByTime"]); | 1063 bucketByTime = new BucketByTime.fromJson(_json["bucketByTime"]); |
| 1056 } | 1064 } |
| 1057 if (_json.containsKey("endTimeMillis")) { | 1065 if (_json.containsKey("endTimeMillis")) { |
| 1058 endTimeMillis = _json["endTimeMillis"]; | 1066 endTimeMillis = _json["endTimeMillis"]; |
| 1059 } | 1067 } |
| 1060 if (_json.containsKey("filteredDataQualityStandard")) { | 1068 if (_json.containsKey("filteredDataQualityStandard")) { |
| 1061 filteredDataQualityStandard = _json["filteredDataQualityStandard"]; | 1069 filteredDataQualityStandard = _json["filteredDataQualityStandard"]; |
| 1062 } | 1070 } |
| 1063 if (_json.containsKey("startTimeMillis")) { | 1071 if (_json.containsKey("startTimeMillis")) { |
| 1064 startTimeMillis = _json["startTimeMillis"]; | 1072 startTimeMillis = _json["startTimeMillis"]; |
| 1065 } | 1073 } |
| 1066 } | 1074 } |
| 1067 | 1075 |
| 1068 core.Map<core.String, core.Object> toJson() { | 1076 core.Map<core.String, core.Object> toJson() { |
| 1069 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1077 final core.Map<core.String, core.Object> _json = |
| 1078 new core.Map<core.String, core.Object>(); |
| 1070 if (aggregateBy != null) { | 1079 if (aggregateBy != null) { |
| 1071 _json["aggregateBy"] = aggregateBy.map((value) => (value).toJson()).toList
(); | 1080 _json["aggregateBy"] = |
| 1081 aggregateBy.map((value) => (value).toJson()).toList(); |
| 1072 } | 1082 } |
| 1073 if (bucketByActivitySegment != null) { | 1083 if (bucketByActivitySegment != null) { |
| 1074 _json["bucketByActivitySegment"] = (bucketByActivitySegment).toJson(); | 1084 _json["bucketByActivitySegment"] = (bucketByActivitySegment).toJson(); |
| 1075 } | 1085 } |
| 1076 if (bucketByActivityType != null) { | 1086 if (bucketByActivityType != null) { |
| 1077 _json["bucketByActivityType"] = (bucketByActivityType).toJson(); | 1087 _json["bucketByActivityType"] = (bucketByActivityType).toJson(); |
| 1078 } | 1088 } |
| 1079 if (bucketBySession != null) { | 1089 if (bucketBySession != null) { |
| 1080 _json["bucketBySession"] = (bucketBySession).toJson(); | 1090 _json["bucketBySession"] = (bucketBySession).toJson(); |
| 1081 } | 1091 } |
| 1082 if (bucketByTime != null) { | 1092 if (bucketByTime != null) { |
| 1083 _json["bucketByTime"] = (bucketByTime).toJson(); | 1093 _json["bucketByTime"] = (bucketByTime).toJson(); |
| 1084 } | 1094 } |
| 1085 if (endTimeMillis != null) { | 1095 if (endTimeMillis != null) { |
| 1086 _json["endTimeMillis"] = endTimeMillis; | 1096 _json["endTimeMillis"] = endTimeMillis; |
| 1087 } | 1097 } |
| 1088 if (filteredDataQualityStandard != null) { | 1098 if (filteredDataQualityStandard != null) { |
| 1089 _json["filteredDataQualityStandard"] = filteredDataQualityStandard; | 1099 _json["filteredDataQualityStandard"] = filteredDataQualityStandard; |
| 1090 } | 1100 } |
| 1091 if (startTimeMillis != null) { | 1101 if (startTimeMillis != null) { |
| 1092 _json["startTimeMillis"] = startTimeMillis; | 1102 _json["startTimeMillis"] = startTimeMillis; |
| 1093 } | 1103 } |
| 1094 return _json; | 1104 return _json; |
| 1095 } | 1105 } |
| 1096 } | 1106 } |
| 1097 | 1107 |
| 1098 class AggregateResponse { | 1108 class AggregateResponse { |
| 1099 /** A list of buckets containing the aggregated data. */ | 1109 /// A list of buckets containing the aggregated data. |
| 1100 core.List<AggregateBucket> bucket; | 1110 core.List<AggregateBucket> bucket; |
| 1101 | 1111 |
| 1102 AggregateResponse(); | 1112 AggregateResponse(); |
| 1103 | 1113 |
| 1104 AggregateResponse.fromJson(core.Map _json) { | 1114 AggregateResponse.fromJson(core.Map _json) { |
| 1105 if (_json.containsKey("bucket")) { | 1115 if (_json.containsKey("bucket")) { |
| 1106 bucket = _json["bucket"].map((value) => new AggregateBucket.fromJson(value
)).toList(); | 1116 bucket = _json["bucket"] |
| 1117 .map((value) => new AggregateBucket.fromJson(value)) |
| 1118 .toList(); |
| 1107 } | 1119 } |
| 1108 } | 1120 } |
| 1109 | 1121 |
| 1110 core.Map<core.String, core.Object> toJson() { | 1122 core.Map<core.String, core.Object> toJson() { |
| 1111 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1123 final core.Map<core.String, core.Object> _json = |
| 1124 new core.Map<core.String, core.Object>(); |
| 1112 if (bucket != null) { | 1125 if (bucket != null) { |
| 1113 _json["bucket"] = bucket.map((value) => (value).toJson()).toList(); | 1126 _json["bucket"] = bucket.map((value) => (value).toJson()).toList(); |
| 1114 } | 1127 } |
| 1115 return _json; | 1128 return _json; |
| 1116 } | 1129 } |
| 1117 } | 1130 } |
| 1118 | 1131 |
| 1119 class Application { | 1132 class Application { |
| 1120 /** An optional URI that can be used to link back to the application. */ | 1133 /// An optional URI that can be used to link back to the application. |
| 1121 core.String detailsUrl; | 1134 core.String detailsUrl; |
| 1122 /** | 1135 |
| 1123 * The name of this application. This is required for REST clients, but we do | 1136 /// The name of this application. This is required for REST clients, but we |
| 1124 * not enforce uniqueness of this name. It is provided as a matter of | 1137 /// do not enforce uniqueness of this name. It is provided as a matter of |
| 1125 * convenience for other developers who would like to identify which REST | 1138 /// convenience for other developers who would like to identify which REST |
| 1126 * created an Application or Data Source. | 1139 /// created an Application or Data Source. |
| 1127 */ | |
| 1128 core.String name; | 1140 core.String name; |
| 1129 /** | 1141 |
| 1130 * Package name for this application. This is used as a unique identifier when | 1142 /// Package name for this application. This is used as a unique identifier |
| 1131 * created by Android applications, but cannot be specified by REST clients. | 1143 /// when created by Android applications, but cannot be specified by REST |
| 1132 * REST clients will have their developer project number reflected into the | 1144 /// clients. REST clients will have their developer project number reflected |
| 1133 * Data Source data stream IDs, instead of the packageName. | 1145 /// into the Data Source data stream IDs, instead of the packageName. |
| 1134 */ | |
| 1135 core.String packageName; | 1146 core.String packageName; |
| 1136 /** | 1147 |
| 1137 * Version of the application. You should update this field whenever the | 1148 /// Version of the application. You should update this field whenever the |
| 1138 * application changes in a way that affects the computation of the data. | 1149 /// application changes in a way that affects the computation of the data. |
| 1139 */ | |
| 1140 core.String version; | 1150 core.String version; |
| 1141 | 1151 |
| 1142 Application(); | 1152 Application(); |
| 1143 | 1153 |
| 1144 Application.fromJson(core.Map _json) { | 1154 Application.fromJson(core.Map _json) { |
| 1145 if (_json.containsKey("detailsUrl")) { | 1155 if (_json.containsKey("detailsUrl")) { |
| 1146 detailsUrl = _json["detailsUrl"]; | 1156 detailsUrl = _json["detailsUrl"]; |
| 1147 } | 1157 } |
| 1148 if (_json.containsKey("name")) { | 1158 if (_json.containsKey("name")) { |
| 1149 name = _json["name"]; | 1159 name = _json["name"]; |
| 1150 } | 1160 } |
| 1151 if (_json.containsKey("packageName")) { | 1161 if (_json.containsKey("packageName")) { |
| 1152 packageName = _json["packageName"]; | 1162 packageName = _json["packageName"]; |
| 1153 } | 1163 } |
| 1154 if (_json.containsKey("version")) { | 1164 if (_json.containsKey("version")) { |
| 1155 version = _json["version"]; | 1165 version = _json["version"]; |
| 1156 } | 1166 } |
| 1157 } | 1167 } |
| 1158 | 1168 |
| 1159 core.Map<core.String, core.Object> toJson() { | 1169 core.Map<core.String, core.Object> toJson() { |
| 1160 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1170 final core.Map<core.String, core.Object> _json = |
| 1171 new core.Map<core.String, core.Object>(); |
| 1161 if (detailsUrl != null) { | 1172 if (detailsUrl != null) { |
| 1162 _json["detailsUrl"] = detailsUrl; | 1173 _json["detailsUrl"] = detailsUrl; |
| 1163 } | 1174 } |
| 1164 if (name != null) { | 1175 if (name != null) { |
| 1165 _json["name"] = name; | 1176 _json["name"] = name; |
| 1166 } | 1177 } |
| 1167 if (packageName != null) { | 1178 if (packageName != null) { |
| 1168 _json["packageName"] = packageName; | 1179 _json["packageName"] = packageName; |
| 1169 } | 1180 } |
| 1170 if (version != null) { | 1181 if (version != null) { |
| 1171 _json["version"] = version; | 1182 _json["version"] = version; |
| 1172 } | 1183 } |
| 1173 return _json; | 1184 return _json; |
| 1174 } | 1185 } |
| 1175 } | 1186 } |
| 1176 | 1187 |
| 1177 class BucketByActivity { | 1188 class BucketByActivity { |
| 1178 /** | 1189 /// The default activity stream will be used if a specific |
| 1179 * The default activity stream will be used if a specific activityDataSourceId | 1190 /// activityDataSourceId is not specified. |
| 1180 * is not specified. | |
| 1181 */ | |
| 1182 core.String activityDataSourceId; | 1191 core.String activityDataSourceId; |
| 1183 /** | 1192 |
| 1184 * Specifies that only activity segments of duration longer than | 1193 /// Specifies that only activity segments of duration longer than |
| 1185 * minDurationMillis are considered and used as a container for aggregated | 1194 /// minDurationMillis are considered and used as a container for aggregated |
| 1186 * data. | 1195 /// data. |
| 1187 */ | |
| 1188 core.String minDurationMillis; | 1196 core.String minDurationMillis; |
| 1189 | 1197 |
| 1190 BucketByActivity(); | 1198 BucketByActivity(); |
| 1191 | 1199 |
| 1192 BucketByActivity.fromJson(core.Map _json) { | 1200 BucketByActivity.fromJson(core.Map _json) { |
| 1193 if (_json.containsKey("activityDataSourceId")) { | 1201 if (_json.containsKey("activityDataSourceId")) { |
| 1194 activityDataSourceId = _json["activityDataSourceId"]; | 1202 activityDataSourceId = _json["activityDataSourceId"]; |
| 1195 } | 1203 } |
| 1196 if (_json.containsKey("minDurationMillis")) { | 1204 if (_json.containsKey("minDurationMillis")) { |
| 1197 minDurationMillis = _json["minDurationMillis"]; | 1205 minDurationMillis = _json["minDurationMillis"]; |
| 1198 } | 1206 } |
| 1199 } | 1207 } |
| 1200 | 1208 |
| 1201 core.Map<core.String, core.Object> toJson() { | 1209 core.Map<core.String, core.Object> toJson() { |
| 1202 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1210 final core.Map<core.String, core.Object> _json = |
| 1211 new core.Map<core.String, core.Object>(); |
| 1203 if (activityDataSourceId != null) { | 1212 if (activityDataSourceId != null) { |
| 1204 _json["activityDataSourceId"] = activityDataSourceId; | 1213 _json["activityDataSourceId"] = activityDataSourceId; |
| 1205 } | 1214 } |
| 1206 if (minDurationMillis != null) { | 1215 if (minDurationMillis != null) { |
| 1207 _json["minDurationMillis"] = minDurationMillis; | 1216 _json["minDurationMillis"] = minDurationMillis; |
| 1208 } | 1217 } |
| 1209 return _json; | 1218 return _json; |
| 1210 } | 1219 } |
| 1211 } | 1220 } |
| 1212 | 1221 |
| 1213 class BucketBySession { | 1222 class BucketBySession { |
| 1214 /** | 1223 /// Specifies that only sessions of duration longer than minDurationMillis |
| 1215 * Specifies that only sessions of duration longer than minDurationMillis are | 1224 /// are considered and used as a container for aggregated data. |
| 1216 * considered and used as a container for aggregated data. | |
| 1217 */ | |
| 1218 core.String minDurationMillis; | 1225 core.String minDurationMillis; |
| 1219 | 1226 |
| 1220 BucketBySession(); | 1227 BucketBySession(); |
| 1221 | 1228 |
| 1222 BucketBySession.fromJson(core.Map _json) { | 1229 BucketBySession.fromJson(core.Map _json) { |
| 1223 if (_json.containsKey("minDurationMillis")) { | 1230 if (_json.containsKey("minDurationMillis")) { |
| 1224 minDurationMillis = _json["minDurationMillis"]; | 1231 minDurationMillis = _json["minDurationMillis"]; |
| 1225 } | 1232 } |
| 1226 } | 1233 } |
| 1227 | 1234 |
| 1228 core.Map<core.String, core.Object> toJson() { | 1235 core.Map<core.String, core.Object> toJson() { |
| 1229 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1236 final core.Map<core.String, core.Object> _json = |
| 1237 new core.Map<core.String, core.Object>(); |
| 1230 if (minDurationMillis != null) { | 1238 if (minDurationMillis != null) { |
| 1231 _json["minDurationMillis"] = minDurationMillis; | 1239 _json["minDurationMillis"] = minDurationMillis; |
| 1232 } | 1240 } |
| 1233 return _json; | 1241 return _json; |
| 1234 } | 1242 } |
| 1235 } | 1243 } |
| 1236 | 1244 |
| 1237 class BucketByTime { | 1245 class BucketByTime { |
| 1238 /** | 1246 /// Specifies that result buckets aggregate data by exactly durationMillis |
| 1239 * Specifies that result buckets aggregate data by exactly durationMillis time | 1247 /// time frames. Time frames that contain no data will be included in the |
| 1240 * frames. Time frames that contain no data will be included in the response | 1248 /// response with an empty dataset. |
| 1241 * with an empty dataset. | |
| 1242 */ | |
| 1243 core.String durationMillis; | 1249 core.String durationMillis; |
| 1244 BucketByTimePeriod period; | 1250 BucketByTimePeriod period; |
| 1245 | 1251 |
| 1246 BucketByTime(); | 1252 BucketByTime(); |
| 1247 | 1253 |
| 1248 BucketByTime.fromJson(core.Map _json) { | 1254 BucketByTime.fromJson(core.Map _json) { |
| 1249 if (_json.containsKey("durationMillis")) { | 1255 if (_json.containsKey("durationMillis")) { |
| 1250 durationMillis = _json["durationMillis"]; | 1256 durationMillis = _json["durationMillis"]; |
| 1251 } | 1257 } |
| 1252 if (_json.containsKey("period")) { | 1258 if (_json.containsKey("period")) { |
| 1253 period = new BucketByTimePeriod.fromJson(_json["period"]); | 1259 period = new BucketByTimePeriod.fromJson(_json["period"]); |
| 1254 } | 1260 } |
| 1255 } | 1261 } |
| 1256 | 1262 |
| 1257 core.Map<core.String, core.Object> toJson() { | 1263 core.Map<core.String, core.Object> toJson() { |
| 1258 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1264 final core.Map<core.String, core.Object> _json = |
| 1265 new core.Map<core.String, core.Object>(); |
| 1259 if (durationMillis != null) { | 1266 if (durationMillis != null) { |
| 1260 _json["durationMillis"] = durationMillis; | 1267 _json["durationMillis"] = durationMillis; |
| 1261 } | 1268 } |
| 1262 if (period != null) { | 1269 if (period != null) { |
| 1263 _json["period"] = (period).toJson(); | 1270 _json["period"] = (period).toJson(); |
| 1264 } | 1271 } |
| 1265 return _json; | 1272 return _json; |
| 1266 } | 1273 } |
| 1267 } | 1274 } |
| 1268 | 1275 |
| 1269 class BucketByTimePeriod { | 1276 class BucketByTimePeriod { |
| 1270 /** org.joda.timezone.DateTimeZone */ | 1277 /// org.joda.timezone.DateTimeZone |
| 1271 core.String timeZoneId; | 1278 core.String timeZoneId; |
| 1272 /** | 1279 |
| 1273 * | 1280 /// |
| 1274 * Possible string values are: | 1281 /// Possible string values are: |
| 1275 * - "day" | 1282 /// - "day" |
| 1276 * - "month" | 1283 /// - "month" |
| 1277 * - "week" | 1284 /// - "week" |
| 1278 */ | |
| 1279 core.String type; | 1285 core.String type; |
| 1280 core.int value; | 1286 core.int value; |
| 1281 | 1287 |
| 1282 BucketByTimePeriod(); | 1288 BucketByTimePeriod(); |
| 1283 | 1289 |
| 1284 BucketByTimePeriod.fromJson(core.Map _json) { | 1290 BucketByTimePeriod.fromJson(core.Map _json) { |
| 1285 if (_json.containsKey("timeZoneId")) { | 1291 if (_json.containsKey("timeZoneId")) { |
| 1286 timeZoneId = _json["timeZoneId"]; | 1292 timeZoneId = _json["timeZoneId"]; |
| 1287 } | 1293 } |
| 1288 if (_json.containsKey("type")) { | 1294 if (_json.containsKey("type")) { |
| 1289 type = _json["type"]; | 1295 type = _json["type"]; |
| 1290 } | 1296 } |
| 1291 if (_json.containsKey("value")) { | 1297 if (_json.containsKey("value")) { |
| 1292 value = _json["value"]; | 1298 value = _json["value"]; |
| 1293 } | 1299 } |
| 1294 } | 1300 } |
| 1295 | 1301 |
| 1296 core.Map<core.String, core.Object> toJson() { | 1302 core.Map<core.String, core.Object> toJson() { |
| 1297 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1303 final core.Map<core.String, core.Object> _json = |
| 1304 new core.Map<core.String, core.Object>(); |
| 1298 if (timeZoneId != null) { | 1305 if (timeZoneId != null) { |
| 1299 _json["timeZoneId"] = timeZoneId; | 1306 _json["timeZoneId"] = timeZoneId; |
| 1300 } | 1307 } |
| 1301 if (type != null) { | 1308 if (type != null) { |
| 1302 _json["type"] = type; | 1309 _json["type"] = type; |
| 1303 } | 1310 } |
| 1304 if (value != null) { | 1311 if (value != null) { |
| 1305 _json["value"] = value; | 1312 _json["value"] = value; |
| 1306 } | 1313 } |
| 1307 return _json; | 1314 return _json; |
| 1308 } | 1315 } |
| 1309 } | 1316 } |
| 1310 | 1317 |
| 1311 /** | 1318 /// Represents a single data point, generated by a particular data source. A |
| 1312 * Represents a single data point, generated by a particular data source. A data | 1319 /// data point holds a value for each field, an end timestamp and an optional |
| 1313 * point holds a value for each field, an end timestamp and an optional start | 1320 /// start time. The exact semantics of each of these attributes are specified |
| 1314 * time. The exact semantics of each of these attributes are specified in the | 1321 /// in the documentation for the particular data type. |
| 1315 * documentation for the particular data type. | 1322 /// |
| 1316 * | 1323 /// A data point can represent an instantaneous measurement, reading or input |
| 1317 * A data point can represent an instantaneous measurement, reading or input | 1324 /// observation, as well as averages or aggregates over a time interval. Check |
| 1318 * observation, as well as averages or aggregates over a time interval. Check | 1325 /// the data type documentation to determine which is the case for a particular |
| 1319 * the data type documentation to determine which is the case for a particular | 1326 /// data type. |
| 1320 * data type. | 1327 /// |
| 1321 * | 1328 /// Data points always contain one value for each field of the data type. |
| 1322 * Data points always contain one value for each field of the data type. | |
| 1323 */ | |
| 1324 class DataPoint { | 1329 class DataPoint { |
| 1325 /** | 1330 /// Used for version checking during transformation; that is, a datapoint can |
| 1326 * Used for version checking during transformation; that is, a datapoint can | 1331 /// only replace another datapoint that has an older computation time stamp. |
| 1327 * only replace another datapoint that has an older computation time stamp. | |
| 1328 */ | |
| 1329 core.String computationTimeMillis; | 1332 core.String computationTimeMillis; |
| 1330 /** The data type defining the format of the values in this data point. */ | 1333 |
| 1334 /// The data type defining the format of the values in this data point. |
| 1331 core.String dataTypeName; | 1335 core.String dataTypeName; |
| 1332 /** | 1336 |
| 1333 * The end time of the interval represented by this data point, in nanoseconds | 1337 /// The end time of the interval represented by this data point, in |
| 1334 * since epoch. | 1338 /// nanoseconds since epoch. |
| 1335 */ | |
| 1336 core.String endTimeNanos; | 1339 core.String endTimeNanos; |
| 1337 /** | 1340 |
| 1338 * Indicates the last time this data point was modified. Useful only in | 1341 /// Indicates the last time this data point was modified. Useful only in |
| 1339 * contexts where we are listing the data changes, rather than representing | 1342 /// contexts where we are listing the data changes, rather than representing |
| 1340 * the current state of the data. | 1343 /// the current state of the data. |
| 1341 */ | |
| 1342 core.String modifiedTimeMillis; | 1344 core.String modifiedTimeMillis; |
| 1343 /** | 1345 |
| 1344 * If the data point is contained in a dataset for a derived data source, this | 1346 /// If the data point is contained in a dataset for a derived data source, |
| 1345 * field will be populated with the data source stream ID that created the | 1347 /// this field will be populated with the data source stream ID that created |
| 1346 * data point originally. | 1348 /// the data point originally. |
| 1347 */ | |
| 1348 core.String originDataSourceId; | 1349 core.String originDataSourceId; |
| 1349 /** The raw timestamp from the original SensorEvent. */ | 1350 |
| 1351 /// The raw timestamp from the original SensorEvent. |
| 1350 core.String rawTimestampNanos; | 1352 core.String rawTimestampNanos; |
| 1351 /** | 1353 |
| 1352 * The start time of the interval represented by this data point, in | 1354 /// The start time of the interval represented by this data point, in |
| 1353 * nanoseconds since epoch. | 1355 /// nanoseconds since epoch. |
| 1354 */ | |
| 1355 core.String startTimeNanos; | 1356 core.String startTimeNanos; |
| 1356 /** | 1357 |
| 1357 * Values of each data type field for the data point. It is expected that each | 1358 /// Values of each data type field for the data point. It is expected that |
| 1358 * value corresponding to a data type field will occur in the same order that | 1359 /// each value corresponding to a data type field will occur in the same |
| 1359 * the field is listed with in the data type specified in a data source. | 1360 /// order that the field is listed with in the data type specified in a data |
| 1360 * | 1361 /// source. |
| 1361 * Only one of integer and floating point fields will be populated, depending | 1362 /// |
| 1362 * on the format enum value within data source's type field. | 1363 /// Only one of integer and floating point fields will be populated, |
| 1363 */ | 1364 /// depending on the format enum value within data source's type field. |
| 1364 core.List<Value> value; | 1365 core.List<Value> value; |
| 1365 | 1366 |
| 1366 DataPoint(); | 1367 DataPoint(); |
| 1367 | 1368 |
| 1368 DataPoint.fromJson(core.Map _json) { | 1369 DataPoint.fromJson(core.Map _json) { |
| 1369 if (_json.containsKey("computationTimeMillis")) { | 1370 if (_json.containsKey("computationTimeMillis")) { |
| 1370 computationTimeMillis = _json["computationTimeMillis"]; | 1371 computationTimeMillis = _json["computationTimeMillis"]; |
| 1371 } | 1372 } |
| 1372 if (_json.containsKey("dataTypeName")) { | 1373 if (_json.containsKey("dataTypeName")) { |
| 1373 dataTypeName = _json["dataTypeName"]; | 1374 dataTypeName = _json["dataTypeName"]; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1386 } | 1387 } |
| 1387 if (_json.containsKey("startTimeNanos")) { | 1388 if (_json.containsKey("startTimeNanos")) { |
| 1388 startTimeNanos = _json["startTimeNanos"]; | 1389 startTimeNanos = _json["startTimeNanos"]; |
| 1389 } | 1390 } |
| 1390 if (_json.containsKey("value")) { | 1391 if (_json.containsKey("value")) { |
| 1391 value = _json["value"].map((value) => new Value.fromJson(value)).toList(); | 1392 value = _json["value"].map((value) => new Value.fromJson(value)).toList(); |
| 1392 } | 1393 } |
| 1393 } | 1394 } |
| 1394 | 1395 |
| 1395 core.Map<core.String, core.Object> toJson() { | 1396 core.Map<core.String, core.Object> toJson() { |
| 1396 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1397 final core.Map<core.String, core.Object> _json = |
| 1398 new core.Map<core.String, core.Object>(); |
| 1397 if (computationTimeMillis != null) { | 1399 if (computationTimeMillis != null) { |
| 1398 _json["computationTimeMillis"] = computationTimeMillis; | 1400 _json["computationTimeMillis"] = computationTimeMillis; |
| 1399 } | 1401 } |
| 1400 if (dataTypeName != null) { | 1402 if (dataTypeName != null) { |
| 1401 _json["dataTypeName"] = dataTypeName; | 1403 _json["dataTypeName"] = dataTypeName; |
| 1402 } | 1404 } |
| 1403 if (endTimeNanos != null) { | 1405 if (endTimeNanos != null) { |
| 1404 _json["endTimeNanos"] = endTimeNanos; | 1406 _json["endTimeNanos"] = endTimeNanos; |
| 1405 } | 1407 } |
| 1406 if (modifiedTimeMillis != null) { | 1408 if (modifiedTimeMillis != null) { |
| 1407 _json["modifiedTimeMillis"] = modifiedTimeMillis; | 1409 _json["modifiedTimeMillis"] = modifiedTimeMillis; |
| 1408 } | 1410 } |
| 1409 if (originDataSourceId != null) { | 1411 if (originDataSourceId != null) { |
| 1410 _json["originDataSourceId"] = originDataSourceId; | 1412 _json["originDataSourceId"] = originDataSourceId; |
| 1411 } | 1413 } |
| 1412 if (rawTimestampNanos != null) { | 1414 if (rawTimestampNanos != null) { |
| 1413 _json["rawTimestampNanos"] = rawTimestampNanos; | 1415 _json["rawTimestampNanos"] = rawTimestampNanos; |
| 1414 } | 1416 } |
| 1415 if (startTimeNanos != null) { | 1417 if (startTimeNanos != null) { |
| 1416 _json["startTimeNanos"] = startTimeNanos; | 1418 _json["startTimeNanos"] = startTimeNanos; |
| 1417 } | 1419 } |
| 1418 if (value != null) { | 1420 if (value != null) { |
| 1419 _json["value"] = value.map((value) => (value).toJson()).toList(); | 1421 _json["value"] = value.map((value) => (value).toJson()).toList(); |
| 1420 } | 1422 } |
| 1421 return _json; | 1423 return _json; |
| 1422 } | 1424 } |
| 1423 } | 1425 } |
| 1424 | 1426 |
| 1425 /** | 1427 /// Definition of a unique source of sensor data. Data sources can expose raw |
| 1426 * Definition of a unique source of sensor data. Data sources can expose raw | 1428 /// data coming from hardware sensors on local or companion devices. They can |
| 1427 * data coming from hardware sensors on local or companion devices. They can | 1429 /// also expose derived data, created by transforming or merging other data |
| 1428 * also expose derived data, created by transforming or merging other data | 1430 /// sources. Multiple data sources can exist for the same data type. Every data |
| 1429 * sources. Multiple data sources can exist for the same data type. Every data | 1431 /// point inserted into or read from this service has an associated data |
| 1430 * point inserted into or read from this service has an associated data source. | 1432 /// source. |
| 1431 * | 1433 /// |
| 1432 * The data source contains enough information to uniquely identify its data, | 1434 /// The data source contains enough information to uniquely identify its data, |
| 1433 * including the hardware device and the application that collected and/or | 1435 /// including the hardware device and the application that collected and/or |
| 1434 * transformed the data. It also holds useful metadata, such as the hardware and | 1436 /// transformed the data. It also holds useful metadata, such as the hardware |
| 1435 * application versions, and the device type. | 1437 /// and application versions, and the device type. |
| 1436 * | 1438 /// |
| 1437 * Each data source produces a unique stream of data, with a unique identifier. | 1439 /// Each data source produces a unique stream of data, with a unique |
| 1438 * Not all changes to data source affect the stream identifier, so that data | 1440 /// identifier. Not all changes to data source affect the stream identifier, so |
| 1439 * collected by updated versions of the same application/device can still be | 1441 /// that data collected by updated versions of the same application/device can |
| 1440 * considered to belong to the same data stream. | 1442 /// still be considered to belong to the same data stream. |
| 1441 */ | |
| 1442 class DataSource { | 1443 class DataSource { |
| 1443 /** | 1444 /// Information about an application which feeds sensor data into the |
| 1444 * Information about an application which feeds sensor data into the platform. | 1445 /// platform. |
| 1445 */ | |
| 1446 Application application; | 1446 Application application; |
| 1447 core.List<core.String> dataQualityStandard; | 1447 core.List<core.String> dataQualityStandard; |
| 1448 /** | 1448 |
| 1449 * A unique identifier for the data stream produced by this data source. The | 1449 /// A unique identifier for the data stream produced by this data source. The |
| 1450 * identifier includes: | 1450 /// identifier includes: |
| 1451 * | 1451 /// |
| 1452 * | 1452 /// |
| 1453 * - The physical device's manufacturer, model, and serial number (UID). | 1453 /// - The physical device's manufacturer, model, and serial number (UID). |
| 1454 * - The application's package name or name. Package name is used when the | 1454 /// - The application's package name or name. Package name is used when the |
| 1455 * data source was created by an Android application. The developer project | 1455 /// data source was created by an Android application. The developer project |
| 1456 * number is used when the data source was created by a REST client. | 1456 /// number is used when the data source was created by a REST client. |
| 1457 * - The data source's type. | 1457 /// - The data source's type. |
| 1458 * - The data source's stream name. Note that not all attributes of the data | 1458 /// - The data source's stream name. Note that not all attributes of the |
| 1459 * source are used as part of the stream identifier. In particular, the | 1459 /// data source are used as part of the stream identifier. In particular, the |
| 1460 * version of the hardware/the application isn't used. This allows us to | 1460 /// version of the hardware/the application isn't used. This allows us to |
| 1461 * preserve the same stream through version updates. This also means that two | 1461 /// preserve the same stream through version updates. This also means that |
| 1462 * DataSource objects may represent the same data stream even if they're not | 1462 /// two DataSource objects may represent the same data stream even if they're |
| 1463 * equal. | 1463 /// not equal. |
| 1464 * | 1464 /// |
| 1465 * The exact format of the data stream ID created by an Android application | 1465 /// The exact format of the data stream ID created by an Android application |
| 1466 * is: | 1466 /// is: |
| 1467 * type:dataType.name:application.packageName:device.manufacturer:device.model
:device.uid:dataStreamName | 1467 /// type:dataType.name:application.packageName:device.manufacturer:device.mode
l:device.uid:dataStreamName |
| 1468 * | 1468 /// |
| 1469 * The exact format of the data stream ID created by a REST client is: | 1469 /// The exact format of the data stream ID created by a REST client is: |
| 1470 * type:dataType.name:developer project | 1470 /// type:dataType.name:developer project |
| 1471 * number:device.manufacturer:device.model:device.uid:dataStreamName | 1471 /// number:device.manufacturer:device.model:device.uid:dataStreamName |
| 1472 * | 1472 /// |
| 1473 * When any of the optional fields that comprise of the data stream ID are | 1473 /// When any of the optional fields that comprise of the data stream ID are |
| 1474 * blank, they will be omitted from the data stream ID. The minimum viable | 1474 /// blank, they will be omitted from the data stream ID. The minimum viable |
| 1475 * data stream ID would be: type:dataType.name:developer project number | 1475 /// data stream ID would be: type:dataType.name:developer project number |
| 1476 * | 1476 /// |
| 1477 * Finally, the developer project number is obfuscated when read by any REST | 1477 /// Finally, the developer project number is obfuscated when read by any REST |
| 1478 * or Android client that did not create the data source. Only the data source | 1478 /// or Android client that did not create the data source. Only the data |
| 1479 * creator will see the developer project number in clear and normal form. | 1479 /// source creator will see the developer project number in clear and normal |
| 1480 */ | 1480 /// form. |
| 1481 core.String dataStreamId; | 1481 core.String dataStreamId; |
| 1482 /** | 1482 |
| 1483 * The stream name uniquely identifies this particular data source among other | 1483 /// The stream name uniquely identifies this particular data source among |
| 1484 * data sources of the same type from the same underlying producer. Setting | 1484 /// other data sources of the same type from the same underlying producer. |
| 1485 * the stream name is optional, but should be done whenever an application | 1485 /// Setting the stream name is optional, but should be done whenever an |
| 1486 * exposes two streams for the same data type, or when a device has two | 1486 /// application exposes two streams for the same data type, or when a device |
| 1487 * equivalent sensors. | 1487 /// has two equivalent sensors. |
| 1488 */ | |
| 1489 core.String dataStreamName; | 1488 core.String dataStreamName; |
| 1490 /** | 1489 |
| 1491 * The data type defines the schema for a stream of data being collected by, | 1490 /// The data type defines the schema for a stream of data being collected by, |
| 1492 * inserted into, or queried from the Fitness API. | 1491 /// inserted into, or queried from the Fitness API. |
| 1493 */ | |
| 1494 DataType dataType; | 1492 DataType dataType; |
| 1495 /** | 1493 |
| 1496 * Representation of an integrated device (such as a phone or a wearable) that | 1494 /// Representation of an integrated device (such as a phone or a wearable) |
| 1497 * can hold sensors. | 1495 /// that can hold sensors. |
| 1498 */ | |
| 1499 Device device; | 1496 Device device; |
| 1500 /** An end-user visible name for this data source. */ | 1497 |
| 1498 /// An end-user visible name for this data source. |
| 1501 core.String name; | 1499 core.String name; |
| 1502 /** | 1500 |
| 1503 * A constant describing the type of this data source. Indicates whether this | 1501 /// A constant describing the type of this data source. Indicates whether |
| 1504 * data source produces raw or derived data. | 1502 /// this data source produces raw or derived data. |
| 1505 * Possible string values are: | 1503 /// Possible string values are: |
| 1506 * - "derived" | 1504 /// - "derived" |
| 1507 * - "raw" | 1505 /// - "raw" |
| 1508 */ | |
| 1509 core.String type; | 1506 core.String type; |
| 1510 | 1507 |
| 1511 DataSource(); | 1508 DataSource(); |
| 1512 | 1509 |
| 1513 DataSource.fromJson(core.Map _json) { | 1510 DataSource.fromJson(core.Map _json) { |
| 1514 if (_json.containsKey("application")) { | 1511 if (_json.containsKey("application")) { |
| 1515 application = new Application.fromJson(_json["application"]); | 1512 application = new Application.fromJson(_json["application"]); |
| 1516 } | 1513 } |
| 1517 if (_json.containsKey("dataQualityStandard")) { | 1514 if (_json.containsKey("dataQualityStandard")) { |
| 1518 dataQualityStandard = _json["dataQualityStandard"]; | 1515 dataQualityStandard = _json["dataQualityStandard"]; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 1531 } | 1528 } |
| 1532 if (_json.containsKey("name")) { | 1529 if (_json.containsKey("name")) { |
| 1533 name = _json["name"]; | 1530 name = _json["name"]; |
| 1534 } | 1531 } |
| 1535 if (_json.containsKey("type")) { | 1532 if (_json.containsKey("type")) { |
| 1536 type = _json["type"]; | 1533 type = _json["type"]; |
| 1537 } | 1534 } |
| 1538 } | 1535 } |
| 1539 | 1536 |
| 1540 core.Map<core.String, core.Object> toJson() { | 1537 core.Map<core.String, core.Object> toJson() { |
| 1541 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1538 final core.Map<core.String, core.Object> _json = |
| 1539 new core.Map<core.String, core.Object>(); |
| 1542 if (application != null) { | 1540 if (application != null) { |
| 1543 _json["application"] = (application).toJson(); | 1541 _json["application"] = (application).toJson(); |
| 1544 } | 1542 } |
| 1545 if (dataQualityStandard != null) { | 1543 if (dataQualityStandard != null) { |
| 1546 _json["dataQualityStandard"] = dataQualityStandard; | 1544 _json["dataQualityStandard"] = dataQualityStandard; |
| 1547 } | 1545 } |
| 1548 if (dataStreamId != null) { | 1546 if (dataStreamId != null) { |
| 1549 _json["dataStreamId"] = dataStreamId; | 1547 _json["dataStreamId"] = dataStreamId; |
| 1550 } | 1548 } |
| 1551 if (dataStreamName != null) { | 1549 if (dataStreamName != null) { |
| 1552 _json["dataStreamName"] = dataStreamName; | 1550 _json["dataStreamName"] = dataStreamName; |
| 1553 } | 1551 } |
| 1554 if (dataType != null) { | 1552 if (dataType != null) { |
| 1555 _json["dataType"] = (dataType).toJson(); | 1553 _json["dataType"] = (dataType).toJson(); |
| 1556 } | 1554 } |
| 1557 if (device != null) { | 1555 if (device != null) { |
| 1558 _json["device"] = (device).toJson(); | 1556 _json["device"] = (device).toJson(); |
| 1559 } | 1557 } |
| 1560 if (name != null) { | 1558 if (name != null) { |
| 1561 _json["name"] = name; | 1559 _json["name"] = name; |
| 1562 } | 1560 } |
| 1563 if (type != null) { | 1561 if (type != null) { |
| 1564 _json["type"] = type; | 1562 _json["type"] = type; |
| 1565 } | 1563 } |
| 1566 return _json; | 1564 return _json; |
| 1567 } | 1565 } |
| 1568 } | 1566 } |
| 1569 | 1567 |
| 1570 class DataType { | 1568 class DataType { |
| 1571 /** A field represents one dimension of a data type. */ | 1569 /// A field represents one dimension of a data type. |
| 1572 core.List<DataTypeField> field; | 1570 core.List<DataTypeField> field; |
| 1573 /** | 1571 |
| 1574 * Each data type has a unique, namespaced, name. All data types in the | 1572 /// Each data type has a unique, namespaced, name. All data types in the |
| 1575 * com.google namespace are shared as part of the platform. | 1573 /// com.google namespace are shared as part of the platform. |
| 1576 */ | |
| 1577 core.String name; | 1574 core.String name; |
| 1578 | 1575 |
| 1579 DataType(); | 1576 DataType(); |
| 1580 | 1577 |
| 1581 DataType.fromJson(core.Map _json) { | 1578 DataType.fromJson(core.Map _json) { |
| 1582 if (_json.containsKey("field")) { | 1579 if (_json.containsKey("field")) { |
| 1583 field = _json["field"].map((value) => new DataTypeField.fromJson(value)).t
oList(); | 1580 field = _json["field"] |
| 1581 .map((value) => new DataTypeField.fromJson(value)) |
| 1582 .toList(); |
| 1584 } | 1583 } |
| 1585 if (_json.containsKey("name")) { | 1584 if (_json.containsKey("name")) { |
| 1586 name = _json["name"]; | 1585 name = _json["name"]; |
| 1587 } | 1586 } |
| 1588 } | 1587 } |
| 1589 | 1588 |
| 1590 core.Map<core.String, core.Object> toJson() { | 1589 core.Map<core.String, core.Object> toJson() { |
| 1591 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1590 final core.Map<core.String, core.Object> _json = |
| 1591 new core.Map<core.String, core.Object>(); |
| 1592 if (field != null) { | 1592 if (field != null) { |
| 1593 _json["field"] = field.map((value) => (value).toJson()).toList(); | 1593 _json["field"] = field.map((value) => (value).toJson()).toList(); |
| 1594 } | 1594 } |
| 1595 if (name != null) { | 1595 if (name != null) { |
| 1596 _json["name"] = name; | 1596 _json["name"] = name; |
| 1597 } | 1597 } |
| 1598 return _json; | 1598 return _json; |
| 1599 } | 1599 } |
| 1600 } | 1600 } |
| 1601 | 1601 |
| 1602 /** | 1602 /// In case of multi-dimensional data (such as an accelerometer with x, y, and |
| 1603 * In case of multi-dimensional data (such as an accelerometer with x, y, and z | 1603 /// z axes) each field represents one dimension. Each data type field has a |
| 1604 * axes) each field represents one dimension. Each data type field has a unique | 1604 /// unique name which identifies it. The field also defines the format of the |
| 1605 * name which identifies it. The field also defines the format of the data (int, | 1605 /// data (int, float, etc.). |
| 1606 * float, etc.). | 1606 /// |
| 1607 * | 1607 /// This message is only instantiated in code and not used for wire comms or |
| 1608 * This message is only instantiated in code and not used for wire comms or | 1608 /// stored in any way. |
| 1609 * stored in any way. | |
| 1610 */ | |
| 1611 class DataTypeField { | 1609 class DataTypeField { |
| 1612 /** | 1610 /// The different supported formats for each field in a data type. |
| 1613 * The different supported formats for each field in a data type. | 1611 /// Possible string values are: |
| 1614 * Possible string values are: | 1612 /// - "blob" |
| 1615 * - "blob" | 1613 /// - "floatList" |
| 1616 * - "floatList" | 1614 /// - "floatPoint" |
| 1617 * - "floatPoint" | 1615 /// - "integer" |
| 1618 * - "integer" | 1616 /// - "integerList" |
| 1619 * - "integerList" | 1617 /// - "map" |
| 1620 * - "map" | 1618 /// - "string" |
| 1621 * - "string" | |
| 1622 */ | |
| 1623 core.String format; | 1619 core.String format; |
| 1624 /** | 1620 |
| 1625 * Defines the name and format of data. Unlike data type names, field names | 1621 /// Defines the name and format of data. Unlike data type names, field names |
| 1626 * are not namespaced, and only need to be unique within the data type. | 1622 /// are not namespaced, and only need to be unique within the data type. |
| 1627 */ | |
| 1628 core.String name; | 1623 core.String name; |
| 1629 core.bool optional; | 1624 core.bool optional; |
| 1630 | 1625 |
| 1631 DataTypeField(); | 1626 DataTypeField(); |
| 1632 | 1627 |
| 1633 DataTypeField.fromJson(core.Map _json) { | 1628 DataTypeField.fromJson(core.Map _json) { |
| 1634 if (_json.containsKey("format")) { | 1629 if (_json.containsKey("format")) { |
| 1635 format = _json["format"]; | 1630 format = _json["format"]; |
| 1636 } | 1631 } |
| 1637 if (_json.containsKey("name")) { | 1632 if (_json.containsKey("name")) { |
| 1638 name = _json["name"]; | 1633 name = _json["name"]; |
| 1639 } | 1634 } |
| 1640 if (_json.containsKey("optional")) { | 1635 if (_json.containsKey("optional")) { |
| 1641 optional = _json["optional"]; | 1636 optional = _json["optional"]; |
| 1642 } | 1637 } |
| 1643 } | 1638 } |
| 1644 | 1639 |
| 1645 core.Map<core.String, core.Object> toJson() { | 1640 core.Map<core.String, core.Object> toJson() { |
| 1646 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1641 final core.Map<core.String, core.Object> _json = |
| 1642 new core.Map<core.String, core.Object>(); |
| 1647 if (format != null) { | 1643 if (format != null) { |
| 1648 _json["format"] = format; | 1644 _json["format"] = format; |
| 1649 } | 1645 } |
| 1650 if (name != null) { | 1646 if (name != null) { |
| 1651 _json["name"] = name; | 1647 _json["name"] = name; |
| 1652 } | 1648 } |
| 1653 if (optional != null) { | 1649 if (optional != null) { |
| 1654 _json["optional"] = optional; | 1650 _json["optional"] = optional; |
| 1655 } | 1651 } |
| 1656 return _json; | 1652 return _json; |
| 1657 } | 1653 } |
| 1658 } | 1654 } |
| 1659 | 1655 |
| 1660 /** | 1656 /// A dataset represents a projection container for data points. They do not |
| 1661 * A dataset represents a projection container for data points. They do not | 1657 /// carry any info of their own. Datasets represent a set of data points from a |
| 1662 * carry any info of their own. Datasets represent a set of data points from a | 1658 /// particular data source. A data point can be found in more than one dataset. |
| 1663 * particular data source. A data point can be found in more than one dataset. | |
| 1664 */ | |
| 1665 class Dataset { | 1659 class Dataset { |
| 1666 /** | 1660 /// The data stream ID of the data source that created the points in this |
| 1667 * The data stream ID of the data source that created the points in this | 1661 /// dataset. |
| 1668 * dataset. | |
| 1669 */ | |
| 1670 core.String dataSourceId; | 1662 core.String dataSourceId; |
| 1671 /** | 1663 |
| 1672 * The largest end time of all data points in this possibly partial | 1664 /// The largest end time of all data points in this possibly partial |
| 1673 * representation of the dataset. Time is in nanoseconds from epoch. This | 1665 /// representation of the dataset. Time is in nanoseconds from epoch. This |
| 1674 * should also match the first part of the dataset identifier. | 1666 /// should also match the first part of the dataset identifier. |
| 1675 */ | |
| 1676 core.String maxEndTimeNs; | 1667 core.String maxEndTimeNs; |
| 1677 /** | 1668 |
| 1678 * The smallest start time of all data points in this possibly partial | 1669 /// The smallest start time of all data points in this possibly partial |
| 1679 * representation of the dataset. Time is in nanoseconds from epoch. This | 1670 /// representation of the dataset. Time is in nanoseconds from epoch. This |
| 1680 * should also match the first part of the dataset identifier. | 1671 /// should also match the first part of the dataset identifier. |
| 1681 */ | |
| 1682 core.String minStartTimeNs; | 1672 core.String minStartTimeNs; |
| 1683 /** | 1673 |
| 1684 * This token will be set when a dataset is received in response to a GET | 1674 /// This token will be set when a dataset is received in response to a GET |
| 1685 * request and the dataset is too large to be included in a single response. | 1675 /// request and the dataset is too large to be included in a single response. |
| 1686 * Provide this value in a subsequent GET request to return the next page of | 1676 /// Provide this value in a subsequent GET request to return the next page of |
| 1687 * data points within this dataset. | 1677 /// data points within this dataset. |
| 1688 */ | |
| 1689 core.String nextPageToken; | 1678 core.String nextPageToken; |
| 1690 /** | 1679 |
| 1691 * A partial list of data points contained in the dataset, ordered by largest | 1680 /// A partial list of data points contained in the dataset, ordered by |
| 1692 * endTimeNanos first. This list is considered complete when retrieving a | 1681 /// largest endTimeNanos first. This list is considered complete when |
| 1693 * small dataset and partial when patching a dataset or retrieving a dataset | 1682 /// retrieving a small dataset and partial when patching a dataset or |
| 1694 * that is too large to include in a single response. | 1683 /// retrieving a dataset that is too large to include in a single response. |
| 1695 */ | |
| 1696 core.List<DataPoint> point; | 1684 core.List<DataPoint> point; |
| 1697 | 1685 |
| 1698 Dataset(); | 1686 Dataset(); |
| 1699 | 1687 |
| 1700 Dataset.fromJson(core.Map _json) { | 1688 Dataset.fromJson(core.Map _json) { |
| 1701 if (_json.containsKey("dataSourceId")) { | 1689 if (_json.containsKey("dataSourceId")) { |
| 1702 dataSourceId = _json["dataSourceId"]; | 1690 dataSourceId = _json["dataSourceId"]; |
| 1703 } | 1691 } |
| 1704 if (_json.containsKey("maxEndTimeNs")) { | 1692 if (_json.containsKey("maxEndTimeNs")) { |
| 1705 maxEndTimeNs = _json["maxEndTimeNs"]; | 1693 maxEndTimeNs = _json["maxEndTimeNs"]; |
| 1706 } | 1694 } |
| 1707 if (_json.containsKey("minStartTimeNs")) { | 1695 if (_json.containsKey("minStartTimeNs")) { |
| 1708 minStartTimeNs = _json["minStartTimeNs"]; | 1696 minStartTimeNs = _json["minStartTimeNs"]; |
| 1709 } | 1697 } |
| 1710 if (_json.containsKey("nextPageToken")) { | 1698 if (_json.containsKey("nextPageToken")) { |
| 1711 nextPageToken = _json["nextPageToken"]; | 1699 nextPageToken = _json["nextPageToken"]; |
| 1712 } | 1700 } |
| 1713 if (_json.containsKey("point")) { | 1701 if (_json.containsKey("point")) { |
| 1714 point = _json["point"].map((value) => new DataPoint.fromJson(value)).toLis
t(); | 1702 point = |
| 1703 _json["point"].map((value) => new DataPoint.fromJson(value)).toList(); |
| 1715 } | 1704 } |
| 1716 } | 1705 } |
| 1717 | 1706 |
| 1718 core.Map<core.String, core.Object> toJson() { | 1707 core.Map<core.String, core.Object> toJson() { |
| 1719 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1708 final core.Map<core.String, core.Object> _json = |
| 1709 new core.Map<core.String, core.Object>(); |
| 1720 if (dataSourceId != null) { | 1710 if (dataSourceId != null) { |
| 1721 _json["dataSourceId"] = dataSourceId; | 1711 _json["dataSourceId"] = dataSourceId; |
| 1722 } | 1712 } |
| 1723 if (maxEndTimeNs != null) { | 1713 if (maxEndTimeNs != null) { |
| 1724 _json["maxEndTimeNs"] = maxEndTimeNs; | 1714 _json["maxEndTimeNs"] = maxEndTimeNs; |
| 1725 } | 1715 } |
| 1726 if (minStartTimeNs != null) { | 1716 if (minStartTimeNs != null) { |
| 1727 _json["minStartTimeNs"] = minStartTimeNs; | 1717 _json["minStartTimeNs"] = minStartTimeNs; |
| 1728 } | 1718 } |
| 1729 if (nextPageToken != null) { | 1719 if (nextPageToken != null) { |
| 1730 _json["nextPageToken"] = nextPageToken; | 1720 _json["nextPageToken"] = nextPageToken; |
| 1731 } | 1721 } |
| 1732 if (point != null) { | 1722 if (point != null) { |
| 1733 _json["point"] = point.map((value) => (value).toJson()).toList(); | 1723 _json["point"] = point.map((value) => (value).toJson()).toList(); |
| 1734 } | 1724 } |
| 1735 return _json; | 1725 return _json; |
| 1736 } | 1726 } |
| 1737 } | 1727 } |
| 1738 | 1728 |
| 1739 /** | 1729 /// Representation of an integrated device (such as a phone or a wearable) that |
| 1740 * Representation of an integrated device (such as a phone or a wearable) that | 1730 /// can hold sensors. Each sensor is exposed as a data source. |
| 1741 * can hold sensors. Each sensor is exposed as a data source. | 1731 /// |
| 1742 * | 1732 /// The main purpose of the device information contained in this class is to |
| 1743 * The main purpose of the device information contained in this class is to | 1733 /// identify the hardware of a particular data source. This can be useful in |
| 1744 * identify the hardware of a particular data source. This can be useful in | 1734 /// different ways, including: |
| 1745 * different ways, including: | 1735 /// - Distinguishing two similar sensors on different devices (the step counter |
| 1746 * - Distinguishing two similar sensors on different devices (the step counter | 1736 /// on two nexus 5 phones, for instance) |
| 1747 * on two nexus 5 phones, for instance) | 1737 /// - Display the source of data to the user (by using the device make / model) |
| 1748 * - Display the source of data to the user (by using the device make / model) | 1738 /// - Treat data differently depending on sensor type (accelerometers on a |
| 1749 * - Treat data differently depending on sensor type (accelerometers on a watch | 1739 /// watch may give different patterns than those on a phone) |
| 1750 * may give different patterns than those on a phone) | 1740 /// - Build different analysis models for each device/version. |
| 1751 * - Build different analysis models for each device/version. | |
| 1752 */ | |
| 1753 class Device { | 1741 class Device { |
| 1754 /** Manufacturer of the product/hardware. */ | 1742 /// Manufacturer of the product/hardware. |
| 1755 core.String manufacturer; | 1743 core.String manufacturer; |
| 1756 /** End-user visible model name for the device. */ | 1744 |
| 1745 /// End-user visible model name for the device. |
| 1757 core.String model; | 1746 core.String model; |
| 1758 /** | 1747 |
| 1759 * A constant representing the type of the device. | 1748 /// A constant representing the type of the device. |
| 1760 * Possible string values are: | 1749 /// Possible string values are: |
| 1761 * - "chestStrap" | 1750 /// - "chestStrap" |
| 1762 * - "headMounted" | 1751 /// - "headMounted" |
| 1763 * - "phone" | 1752 /// - "phone" |
| 1764 * - "scale" | 1753 /// - "scale" |
| 1765 * - "tablet" | 1754 /// - "tablet" |
| 1766 * - "unknown" | 1755 /// - "unknown" |
| 1767 * - "watch" | 1756 /// - "watch" |
| 1768 */ | |
| 1769 core.String type; | 1757 core.String type; |
| 1770 /** | 1758 |
| 1771 * The serial number or other unique ID for the hardware. This field is | 1759 /// The serial number or other unique ID for the hardware. This field is |
| 1772 * obfuscated when read by any REST or Android client that did not create the | 1760 /// obfuscated when read by any REST or Android client that did not create |
| 1773 * data source. Only the data source creator will see the uid field in clear | 1761 /// the data source. Only the data source creator will see the uid field in |
| 1774 * and normal form. | 1762 /// clear and normal form. |
| 1775 */ | |
| 1776 core.String uid; | 1763 core.String uid; |
| 1777 /** Version string for the device hardware/software. */ | 1764 |
| 1765 /// Version string for the device hardware/software. |
| 1778 core.String version; | 1766 core.String version; |
| 1779 | 1767 |
| 1780 Device(); | 1768 Device(); |
| 1781 | 1769 |
| 1782 Device.fromJson(core.Map _json) { | 1770 Device.fromJson(core.Map _json) { |
| 1783 if (_json.containsKey("manufacturer")) { | 1771 if (_json.containsKey("manufacturer")) { |
| 1784 manufacturer = _json["manufacturer"]; | 1772 manufacturer = _json["manufacturer"]; |
| 1785 } | 1773 } |
| 1786 if (_json.containsKey("model")) { | 1774 if (_json.containsKey("model")) { |
| 1787 model = _json["model"]; | 1775 model = _json["model"]; |
| 1788 } | 1776 } |
| 1789 if (_json.containsKey("type")) { | 1777 if (_json.containsKey("type")) { |
| 1790 type = _json["type"]; | 1778 type = _json["type"]; |
| 1791 } | 1779 } |
| 1792 if (_json.containsKey("uid")) { | 1780 if (_json.containsKey("uid")) { |
| 1793 uid = _json["uid"]; | 1781 uid = _json["uid"]; |
| 1794 } | 1782 } |
| 1795 if (_json.containsKey("version")) { | 1783 if (_json.containsKey("version")) { |
| 1796 version = _json["version"]; | 1784 version = _json["version"]; |
| 1797 } | 1785 } |
| 1798 } | 1786 } |
| 1799 | 1787 |
| 1800 core.Map<core.String, core.Object> toJson() { | 1788 core.Map<core.String, core.Object> toJson() { |
| 1801 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1789 final core.Map<core.String, core.Object> _json = |
| 1790 new core.Map<core.String, core.Object>(); |
| 1802 if (manufacturer != null) { | 1791 if (manufacturer != null) { |
| 1803 _json["manufacturer"] = manufacturer; | 1792 _json["manufacturer"] = manufacturer; |
| 1804 } | 1793 } |
| 1805 if (model != null) { | 1794 if (model != null) { |
| 1806 _json["model"] = model; | 1795 _json["model"] = model; |
| 1807 } | 1796 } |
| 1808 if (type != null) { | 1797 if (type != null) { |
| 1809 _json["type"] = type; | 1798 _json["type"] = type; |
| 1810 } | 1799 } |
| 1811 if (uid != null) { | 1800 if (uid != null) { |
| 1812 _json["uid"] = uid; | 1801 _json["uid"] = uid; |
| 1813 } | 1802 } |
| 1814 if (version != null) { | 1803 if (version != null) { |
| 1815 _json["version"] = version; | 1804 _json["version"] = version; |
| 1816 } | 1805 } |
| 1817 return _json; | 1806 return _json; |
| 1818 } | 1807 } |
| 1819 } | 1808 } |
| 1820 | 1809 |
| 1821 class ListDataSourcesResponse { | 1810 class ListDataSourcesResponse { |
| 1822 /** A previously created data source. */ | 1811 /// A previously created data source. |
| 1823 core.List<DataSource> dataSource; | 1812 core.List<DataSource> dataSource; |
| 1824 | 1813 |
| 1825 ListDataSourcesResponse(); | 1814 ListDataSourcesResponse(); |
| 1826 | 1815 |
| 1827 ListDataSourcesResponse.fromJson(core.Map _json) { | 1816 ListDataSourcesResponse.fromJson(core.Map _json) { |
| 1828 if (_json.containsKey("dataSource")) { | 1817 if (_json.containsKey("dataSource")) { |
| 1829 dataSource = _json["dataSource"].map((value) => new DataSource.fromJson(va
lue)).toList(); | 1818 dataSource = _json["dataSource"] |
| 1819 .map((value) => new DataSource.fromJson(value)) |
| 1820 .toList(); |
| 1830 } | 1821 } |
| 1831 } | 1822 } |
| 1832 | 1823 |
| 1833 core.Map<core.String, core.Object> toJson() { | 1824 core.Map<core.String, core.Object> toJson() { |
| 1834 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1825 final core.Map<core.String, core.Object> _json = |
| 1826 new core.Map<core.String, core.Object>(); |
| 1835 if (dataSource != null) { | 1827 if (dataSource != null) { |
| 1836 _json["dataSource"] = dataSource.map((value) => (value).toJson()).toList()
; | 1828 _json["dataSource"] = |
| 1829 dataSource.map((value) => (value).toJson()).toList(); |
| 1837 } | 1830 } |
| 1838 return _json; | 1831 return _json; |
| 1839 } | 1832 } |
| 1840 } | 1833 } |
| 1841 | 1834 |
| 1842 class ListSessionsResponse { | 1835 class ListSessionsResponse { |
| 1843 /** | 1836 /// If includeDeleted is set to true in the request, this list will contain |
| 1844 * If includeDeleted is set to true in the request, this list will contain | 1837 /// sessions deleted with original end times that are within the startTime |
| 1845 * sessions deleted with original end times that are within the startTime and | 1838 /// and endTime frame. |
| 1846 * endTime frame. | |
| 1847 */ | |
| 1848 core.List<Session> deletedSession; | 1839 core.List<Session> deletedSession; |
| 1849 /** Flag to indicate server has more data to transfer */ | 1840 |
| 1841 /// Flag to indicate server has more data to transfer |
| 1850 core.bool hasMoreData; | 1842 core.bool hasMoreData; |
| 1851 /** | 1843 |
| 1852 * The continuation token, which is used to page through large result sets. | 1844 /// The continuation token, which is used to page through large result sets. |
| 1853 * Provide this value in a subsequent request to return the next page of | 1845 /// Provide this value in a subsequent request to return the next page of |
| 1854 * results. | 1846 /// results. |
| 1855 */ | |
| 1856 core.String nextPageToken; | 1847 core.String nextPageToken; |
| 1857 /** | 1848 |
| 1858 * Sessions with an end time that is between startTime and endTime of the | 1849 /// Sessions with an end time that is between startTime and endTime of the |
| 1859 * request. | 1850 /// request. |
| 1860 */ | |
| 1861 core.List<Session> session; | 1851 core.List<Session> session; |
| 1862 | 1852 |
| 1863 ListSessionsResponse(); | 1853 ListSessionsResponse(); |
| 1864 | 1854 |
| 1865 ListSessionsResponse.fromJson(core.Map _json) { | 1855 ListSessionsResponse.fromJson(core.Map _json) { |
| 1866 if (_json.containsKey("deletedSession")) { | 1856 if (_json.containsKey("deletedSession")) { |
| 1867 deletedSession = _json["deletedSession"].map((value) => new Session.fromJs
on(value)).toList(); | 1857 deletedSession = _json["deletedSession"] |
| 1858 .map((value) => new Session.fromJson(value)) |
| 1859 .toList(); |
| 1868 } | 1860 } |
| 1869 if (_json.containsKey("hasMoreData")) { | 1861 if (_json.containsKey("hasMoreData")) { |
| 1870 hasMoreData = _json["hasMoreData"]; | 1862 hasMoreData = _json["hasMoreData"]; |
| 1871 } | 1863 } |
| 1872 if (_json.containsKey("nextPageToken")) { | 1864 if (_json.containsKey("nextPageToken")) { |
| 1873 nextPageToken = _json["nextPageToken"]; | 1865 nextPageToken = _json["nextPageToken"]; |
| 1874 } | 1866 } |
| 1875 if (_json.containsKey("session")) { | 1867 if (_json.containsKey("session")) { |
| 1876 session = _json["session"].map((value) => new Session.fromJson(value)).toL
ist(); | 1868 session = |
| 1869 _json["session"].map((value) => new Session.fromJson(value)).toList(); |
| 1877 } | 1870 } |
| 1878 } | 1871 } |
| 1879 | 1872 |
| 1880 core.Map<core.String, core.Object> toJson() { | 1873 core.Map<core.String, core.Object> toJson() { |
| 1881 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1874 final core.Map<core.String, core.Object> _json = |
| 1875 new core.Map<core.String, core.Object>(); |
| 1882 if (deletedSession != null) { | 1876 if (deletedSession != null) { |
| 1883 _json["deletedSession"] = deletedSession.map((value) => (value).toJson()).
toList(); | 1877 _json["deletedSession"] = |
| 1878 deletedSession.map((value) => (value).toJson()).toList(); |
| 1884 } | 1879 } |
| 1885 if (hasMoreData != null) { | 1880 if (hasMoreData != null) { |
| 1886 _json["hasMoreData"] = hasMoreData; | 1881 _json["hasMoreData"] = hasMoreData; |
| 1887 } | 1882 } |
| 1888 if (nextPageToken != null) { | 1883 if (nextPageToken != null) { |
| 1889 _json["nextPageToken"] = nextPageToken; | 1884 _json["nextPageToken"] = nextPageToken; |
| 1890 } | 1885 } |
| 1891 if (session != null) { | 1886 if (session != null) { |
| 1892 _json["session"] = session.map((value) => (value).toJson()).toList(); | 1887 _json["session"] = session.map((value) => (value).toJson()).toList(); |
| 1893 } | 1888 } |
| 1894 return _json; | 1889 return _json; |
| 1895 } | 1890 } |
| 1896 } | 1891 } |
| 1897 | 1892 |
| 1898 /** | 1893 /// Holder object for the value of an entry in a map field of a data point. |
| 1899 * Holder object for the value of an entry in a map field of a data point. | 1894 /// |
| 1900 * | 1895 /// A map value supports a subset of the formats that the regular Value |
| 1901 * A map value supports a subset of the formats that the regular Value supports. | 1896 /// supports. |
| 1902 */ | |
| 1903 class MapValue { | 1897 class MapValue { |
| 1904 /** Floating point value. */ | 1898 /// Floating point value. |
| 1905 core.double fpVal; | 1899 core.double fpVal; |
| 1906 | 1900 |
| 1907 MapValue(); | 1901 MapValue(); |
| 1908 | 1902 |
| 1909 MapValue.fromJson(core.Map _json) { | 1903 MapValue.fromJson(core.Map _json) { |
| 1910 if (_json.containsKey("fpVal")) { | 1904 if (_json.containsKey("fpVal")) { |
| 1911 fpVal = _json["fpVal"]; | 1905 fpVal = _json["fpVal"]; |
| 1912 } | 1906 } |
| 1913 } | 1907 } |
| 1914 | 1908 |
| 1915 core.Map<core.String, core.Object> toJson() { | 1909 core.Map<core.String, core.Object> toJson() { |
| 1916 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1910 final core.Map<core.String, core.Object> _json = |
| 1911 new core.Map<core.String, core.Object>(); |
| 1917 if (fpVal != null) { | 1912 if (fpVal != null) { |
| 1918 _json["fpVal"] = fpVal; | 1913 _json["fpVal"] = fpVal; |
| 1919 } | 1914 } |
| 1920 return _json; | 1915 return _json; |
| 1921 } | 1916 } |
| 1922 } | 1917 } |
| 1923 | 1918 |
| 1924 /** | 1919 /// Sessions contain metadata, such as a user-friendly name and time interval |
| 1925 * Sessions contain metadata, such as a user-friendly name and time interval | 1920 /// information. |
| 1926 * information. | |
| 1927 */ | |
| 1928 class Session { | 1921 class Session { |
| 1929 /** | 1922 /// Session active time. While start_time_millis and end_time_millis define |
| 1930 * Session active time. While start_time_millis and end_time_millis define the | 1923 /// the full session time, the active time can be shorter and specified by |
| 1931 * full session time, the active time can be shorter and specified by | 1924 /// active_time_millis. If the inactive time during the session is known, it |
| 1932 * active_time_millis. If the inactive time during the session is known, it | 1925 /// should also be inserted via a com.google.activity.segment data point with |
| 1933 * should also be inserted via a com.google.activity.segment data point with a | 1926 /// a STILL activity value |
| 1934 * STILL activity value | |
| 1935 */ | |
| 1936 core.String activeTimeMillis; | 1927 core.String activeTimeMillis; |
| 1937 /** The type of activity this session represents. */ | 1928 |
| 1929 /// The type of activity this session represents. |
| 1938 core.int activityType; | 1930 core.int activityType; |
| 1939 /** The application that created the session. */ | 1931 |
| 1932 /// The application that created the session. |
| 1940 Application application; | 1933 Application application; |
| 1941 /** A description for this session. */ | 1934 |
| 1935 /// A description for this session. |
| 1942 core.String description; | 1936 core.String description; |
| 1943 /** An end time, in milliseconds since epoch, inclusive. */ | 1937 |
| 1938 /// An end time, in milliseconds since epoch, inclusive. |
| 1944 core.String endTimeMillis; | 1939 core.String endTimeMillis; |
| 1945 /** | 1940 |
| 1946 * A client-generated identifier that is unique across all sessions owned by | 1941 /// A client-generated identifier that is unique across all sessions owned by |
| 1947 * this particular user. | 1942 /// this particular user. |
| 1948 */ | |
| 1949 core.String id; | 1943 core.String id; |
| 1950 /** A timestamp that indicates when the session was last modified. */ | 1944 |
| 1945 /// A timestamp that indicates when the session was last modified. |
| 1951 core.String modifiedTimeMillis; | 1946 core.String modifiedTimeMillis; |
| 1952 /** A human readable name of the session. */ | 1947 |
| 1948 /// A human readable name of the session. |
| 1953 core.String name; | 1949 core.String name; |
| 1954 /** A start time, in milliseconds since epoch, inclusive. */ | 1950 |
| 1951 /// A start time, in milliseconds since epoch, inclusive. |
| 1955 core.String startTimeMillis; | 1952 core.String startTimeMillis; |
| 1956 | 1953 |
| 1957 Session(); | 1954 Session(); |
| 1958 | 1955 |
| 1959 Session.fromJson(core.Map _json) { | 1956 Session.fromJson(core.Map _json) { |
| 1960 if (_json.containsKey("activeTimeMillis")) { | 1957 if (_json.containsKey("activeTimeMillis")) { |
| 1961 activeTimeMillis = _json["activeTimeMillis"]; | 1958 activeTimeMillis = _json["activeTimeMillis"]; |
| 1962 } | 1959 } |
| 1963 if (_json.containsKey("activityType")) { | 1960 if (_json.containsKey("activityType")) { |
| 1964 activityType = _json["activityType"]; | 1961 activityType = _json["activityType"]; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 1980 } | 1977 } |
| 1981 if (_json.containsKey("name")) { | 1978 if (_json.containsKey("name")) { |
| 1982 name = _json["name"]; | 1979 name = _json["name"]; |
| 1983 } | 1980 } |
| 1984 if (_json.containsKey("startTimeMillis")) { | 1981 if (_json.containsKey("startTimeMillis")) { |
| 1985 startTimeMillis = _json["startTimeMillis"]; | 1982 startTimeMillis = _json["startTimeMillis"]; |
| 1986 } | 1983 } |
| 1987 } | 1984 } |
| 1988 | 1985 |
| 1989 core.Map<core.String, core.Object> toJson() { | 1986 core.Map<core.String, core.Object> toJson() { |
| 1990 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 1987 final core.Map<core.String, core.Object> _json = |
| 1988 new core.Map<core.String, core.Object>(); |
| 1991 if (activeTimeMillis != null) { | 1989 if (activeTimeMillis != null) { |
| 1992 _json["activeTimeMillis"] = activeTimeMillis; | 1990 _json["activeTimeMillis"] = activeTimeMillis; |
| 1993 } | 1991 } |
| 1994 if (activityType != null) { | 1992 if (activityType != null) { |
| 1995 _json["activityType"] = activityType; | 1993 _json["activityType"] = activityType; |
| 1996 } | 1994 } |
| 1997 if (application != null) { | 1995 if (application != null) { |
| 1998 _json["application"] = (application).toJson(); | 1996 _json["application"] = (application).toJson(); |
| 1999 } | 1997 } |
| 2000 if (description != null) { | 1998 if (description != null) { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 2012 if (name != null) { | 2010 if (name != null) { |
| 2013 _json["name"] = name; | 2011 _json["name"] = name; |
| 2014 } | 2012 } |
| 2015 if (startTimeMillis != null) { | 2013 if (startTimeMillis != null) { |
| 2016 _json["startTimeMillis"] = startTimeMillis; | 2014 _json["startTimeMillis"] = startTimeMillis; |
| 2017 } | 2015 } |
| 2018 return _json; | 2016 return _json; |
| 2019 } | 2017 } |
| 2020 } | 2018 } |
| 2021 | 2019 |
| 2022 /** | 2020 /// Holder object for the value of a single field in a data point. |
| 2023 * Holder object for the value of a single field in a data point. | 2021 /// |
| 2024 * | 2022 /// A field value has a particular format and is only ever set to one of an |
| 2025 * A field value has a particular format and is only ever set to one of an | 2023 /// integer or a floating point value. LINT.IfChange |
| 2026 * integer or a floating point value. LINT.IfChange | |
| 2027 */ | |
| 2028 class Value { | 2024 class Value { |
| 2029 /** Floating point value. When this is set, other values must not be set. */ | 2025 /// Floating point value. When this is set, other values must not be set. |
| 2030 core.double fpVal; | 2026 core.double fpVal; |
| 2031 /** Integer value. When this is set, other values must not be set. */ | 2027 |
| 2028 /// Integer value. When this is set, other values must not be set. |
| 2032 core.int intVal; | 2029 core.int intVal; |
| 2033 /** | 2030 |
| 2034 * Map value. The valid key space and units for the corresponding value of | 2031 /// Map value. The valid key space and units for the corresponding value of |
| 2035 * each entry should be documented as part of the data type definition. Keys | 2032 /// each entry should be documented as part of the data type definition. Keys |
| 2036 * should be kept small whenever possible. Data streams with large keys and | 2033 /// should be kept small whenever possible. Data streams with large keys and |
| 2037 * high data frequency may be down sampled. | 2034 /// high data frequency may be down sampled. |
| 2038 */ | |
| 2039 core.List<ValueMapValEntry> mapVal; | 2035 core.List<ValueMapValEntry> mapVal; |
| 2040 /** | 2036 |
| 2041 * String value. When this is set, other values must not be set. Strings | 2037 /// String value. When this is set, other values must not be set. Strings |
| 2042 * should be kept small whenever possible. Data streams with large string | 2038 /// should be kept small whenever possible. Data streams with large string |
| 2043 * values and high data frequency may be down sampled. | 2039 /// values and high data frequency may be down sampled. |
| 2044 */ | |
| 2045 core.String stringVal; | 2040 core.String stringVal; |
| 2046 | 2041 |
| 2047 Value(); | 2042 Value(); |
| 2048 | 2043 |
| 2049 Value.fromJson(core.Map _json) { | 2044 Value.fromJson(core.Map _json) { |
| 2050 if (_json.containsKey("fpVal")) { | 2045 if (_json.containsKey("fpVal")) { |
| 2051 fpVal = _json["fpVal"]; | 2046 fpVal = _json["fpVal"]; |
| 2052 } | 2047 } |
| 2053 if (_json.containsKey("intVal")) { | 2048 if (_json.containsKey("intVal")) { |
| 2054 intVal = _json["intVal"]; | 2049 intVal = _json["intVal"]; |
| 2055 } | 2050 } |
| 2056 if (_json.containsKey("mapVal")) { | 2051 if (_json.containsKey("mapVal")) { |
| 2057 mapVal = _json["mapVal"].map((value) => new ValueMapValEntry.fromJson(valu
e)).toList(); | 2052 mapVal = _json["mapVal"] |
| 2053 .map((value) => new ValueMapValEntry.fromJson(value)) |
| 2054 .toList(); |
| 2058 } | 2055 } |
| 2059 if (_json.containsKey("stringVal")) { | 2056 if (_json.containsKey("stringVal")) { |
| 2060 stringVal = _json["stringVal"]; | 2057 stringVal = _json["stringVal"]; |
| 2061 } | 2058 } |
| 2062 } | 2059 } |
| 2063 | 2060 |
| 2064 core.Map<core.String, core.Object> toJson() { | 2061 core.Map<core.String, core.Object> toJson() { |
| 2065 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2062 final core.Map<core.String, core.Object> _json = |
| 2063 new core.Map<core.String, core.Object>(); |
| 2066 if (fpVal != null) { | 2064 if (fpVal != null) { |
| 2067 _json["fpVal"] = fpVal; | 2065 _json["fpVal"] = fpVal; |
| 2068 } | 2066 } |
| 2069 if (intVal != null) { | 2067 if (intVal != null) { |
| 2070 _json["intVal"] = intVal; | 2068 _json["intVal"] = intVal; |
| 2071 } | 2069 } |
| 2072 if (mapVal != null) { | 2070 if (mapVal != null) { |
| 2073 _json["mapVal"] = mapVal.map((value) => (value).toJson()).toList(); | 2071 _json["mapVal"] = mapVal.map((value) => (value).toJson()).toList(); |
| 2074 } | 2072 } |
| 2075 if (stringVal != null) { | 2073 if (stringVal != null) { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 2088 ValueMapValEntry.fromJson(core.Map _json) { | 2086 ValueMapValEntry.fromJson(core.Map _json) { |
| 2089 if (_json.containsKey("key")) { | 2087 if (_json.containsKey("key")) { |
| 2090 key = _json["key"]; | 2088 key = _json["key"]; |
| 2091 } | 2089 } |
| 2092 if (_json.containsKey("value")) { | 2090 if (_json.containsKey("value")) { |
| 2093 value = new MapValue.fromJson(_json["value"]); | 2091 value = new MapValue.fromJson(_json["value"]); |
| 2094 } | 2092 } |
| 2095 } | 2093 } |
| 2096 | 2094 |
| 2097 core.Map<core.String, core.Object> toJson() { | 2095 core.Map<core.String, core.Object> toJson() { |
| 2098 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 2096 final core.Map<core.String, core.Object> _json = |
| 2097 new core.Map<core.String, core.Object>(); |
| 2099 if (key != null) { | 2098 if (key != null) { |
| 2100 _json["key"] = key; | 2099 _json["key"] = key; |
| 2101 } | 2100 } |
| 2102 if (value != null) { | 2101 if (value != null) { |
| 2103 _json["value"] = (value).toJson(); | 2102 _json["value"] = (value).toJson(); |
| 2104 } | 2103 } |
| 2105 return _json; | 2104 return _json; |
| 2106 } | 2105 } |
| 2107 } | 2106 } |
| OLD | NEW |