| OLD | NEW |
| 1 library googleapis.fitness.v1; | 1 library googleapis.fitness.v1; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import "package:crypto/crypto.dart" as crypto; | 8 import "package:crypto/crypto.dart" as crypto; |
| 9 import 'package:http/http.dart' as http; | 9 import 'package:http/http.dart' as http; |
| 10 import '../src/common_internal.dart' as common_internal; | 10 import '../src/common_internal.dart' as common_internal; |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 * the authenticated user. Only me is supported at this time. | 420 * the authenticated user. Only me is supported at this time. |
| 421 * | 421 * |
| 422 * [dataSourceId] - The data stream ID of the data source that created the | 422 * [dataSourceId] - The data stream ID of the data source that created the |
| 423 * dataset. | 423 * dataset. |
| 424 * | 424 * |
| 425 * [datasetId] - Dataset identifier that is a composite of the minimum data | 425 * [datasetId] - Dataset identifier that is a composite of the minimum data |
| 426 * point start time and maximum data point end time represented as nanoseconds | 426 * point start time and maximum data point end time represented as nanoseconds |
| 427 * from the epoch. The ID is formatted like: "startTime-endTime" where | 427 * from the epoch. The ID is formatted like: "startTime-endTime" where |
| 428 * startTime and endTime are 64 bit integers. | 428 * startTime and endTime are 64 bit integers. |
| 429 * | 429 * |
| 430 * [pageToken] - The continuation token, which is used to page through large |
| 431 * datasets. To get the next page of a dataset, set this parameter to the |
| 432 * value of nextPageToken from the previous response. Each subsequent call |
| 433 * will yield a partial dataset with data point end timestamps that are |
| 434 * strictly smaller than those in the previous partial response. |
| 435 * |
| 430 * Completes with a [Dataset]. | 436 * Completes with a [Dataset]. |
| 431 * | 437 * |
| 432 * Completes with a [common.ApiRequestError] if the API endpoint returned an | 438 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 433 * error. | 439 * error. |
| 434 * | 440 * |
| 435 * If the used [http.Client] completes with an error when making a REST call, | 441 * If the used [http.Client] completes with an error when making a REST call, |
| 436 * this method will complete with the same error. | 442 * this method will complete with the same error. |
| 437 */ | 443 */ |
| 438 async.Future<Dataset> get(core.String userId, core.String dataSourceId, core.S
tring datasetId) { | 444 async.Future<Dataset> get(core.String userId, core.String dataSourceId, core.S
tring datasetId, {core.String pageToken}) { |
| 439 var _url = null; | 445 var _url = null; |
| 440 var _queryParams = new core.Map(); | 446 var _queryParams = new core.Map(); |
| 441 var _uploadMedia = null; | 447 var _uploadMedia = null; |
| 442 var _uploadOptions = null; | 448 var _uploadOptions = null; |
| 443 var _downloadOptions = common.DownloadOptions.Metadata; | 449 var _downloadOptions = common.DownloadOptions.Metadata; |
| 444 var _body = null; | 450 var _body = null; |
| 445 | 451 |
| 446 if (userId == null) { | 452 if (userId == null) { |
| 447 throw new core.ArgumentError("Parameter userId is required."); | 453 throw new core.ArgumentError("Parameter userId is required."); |
| 448 } | 454 } |
| 449 if (dataSourceId == null) { | 455 if (dataSourceId == null) { |
| 450 throw new core.ArgumentError("Parameter dataSourceId is required."); | 456 throw new core.ArgumentError("Parameter dataSourceId is required."); |
| 451 } | 457 } |
| 452 if (datasetId == null) { | 458 if (datasetId == null) { |
| 453 throw new core.ArgumentError("Parameter datasetId is required."); | 459 throw new core.ArgumentError("Parameter datasetId is required."); |
| 454 } | 460 } |
| 461 if (pageToken != null) { |
| 462 _queryParams["pageToken"] = [pageToken]; |
| 463 } |
| 455 | 464 |
| 456 | 465 |
| 457 _url = common_internal.Escaper.ecapeVariable('$userId') + '/dataSources/' +
common_internal.Escaper.ecapeVariable('$dataSourceId') + '/datasets/' + common_i
nternal.Escaper.ecapeVariable('$datasetId'); | 466 _url = common_internal.Escaper.ecapeVariable('$userId') + '/dataSources/' +
common_internal.Escaper.ecapeVariable('$dataSourceId') + '/datasets/' + common_i
nternal.Escaper.ecapeVariable('$datasetId'); |
| 458 | 467 |
| 459 var _response = _requester.request(_url, | 468 var _response = _requester.request(_url, |
| 460 "GET", | 469 "GET", |
| 461 body: _body, | 470 body: _body, |
| 462 queryParams: _queryParams, | 471 queryParams: _queryParams, |
| 463 uploadOptions: _uploadOptions, | 472 uploadOptions: _uploadOptions, |
| 464 uploadMedia: _uploadMedia, | 473 uploadMedia: _uploadMedia, |
| (...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 core.String maxEndTimeNs; | 1176 core.String maxEndTimeNs; |
| 1168 | 1177 |
| 1169 /** | 1178 /** |
| 1170 * The smallest start time of all data points in this possibly partial | 1179 * The smallest start time of all data points in this possibly partial |
| 1171 * representation of the dataset. Time is in nanoseconds from epoch. This | 1180 * representation of the dataset. Time is in nanoseconds from epoch. This |
| 1172 * should also match the first part of the dataset identifier. | 1181 * should also match the first part of the dataset identifier. |
| 1173 */ | 1182 */ |
| 1174 core.String minStartTimeNs; | 1183 core.String minStartTimeNs; |
| 1175 | 1184 |
| 1176 /** | 1185 /** |
| 1177 * A partial list of data points contained in the dataset. This list is | 1186 * This token will be set when a dataset is received in response to a GET |
| 1178 * considered complete when retrieving a dataset and partial when patching a | 1187 * request and the dataset is too large to be included in a single response. |
| 1179 * dataset. | 1188 * Provide this value in a subsequent GET request to return the next page of |
| 1189 * data points within this dataset. |
| 1190 */ |
| 1191 core.String nextPageToken; |
| 1192 |
| 1193 /** |
| 1194 * A partial list of data points contained in the dataset, ordered by largest |
| 1195 * endTimeNanos first. This list is considered complete when retrieving a |
| 1196 * small dataset and partial when patching a dataset or retrieving a dataset |
| 1197 * that is too large to include in a single response. |
| 1180 */ | 1198 */ |
| 1181 core.List<DataPoint> point; | 1199 core.List<DataPoint> point; |
| 1182 | 1200 |
| 1183 | 1201 |
| 1184 Dataset(); | 1202 Dataset(); |
| 1185 | 1203 |
| 1186 Dataset.fromJson(core.Map _json) { | 1204 Dataset.fromJson(core.Map _json) { |
| 1187 if (_json.containsKey("dataSourceId")) { | 1205 if (_json.containsKey("dataSourceId")) { |
| 1188 dataSourceId = _json["dataSourceId"]; | 1206 dataSourceId = _json["dataSourceId"]; |
| 1189 } | 1207 } |
| 1190 if (_json.containsKey("maxEndTimeNs")) { | 1208 if (_json.containsKey("maxEndTimeNs")) { |
| 1191 maxEndTimeNs = _json["maxEndTimeNs"]; | 1209 maxEndTimeNs = _json["maxEndTimeNs"]; |
| 1192 } | 1210 } |
| 1193 if (_json.containsKey("minStartTimeNs")) { | 1211 if (_json.containsKey("minStartTimeNs")) { |
| 1194 minStartTimeNs = _json["minStartTimeNs"]; | 1212 minStartTimeNs = _json["minStartTimeNs"]; |
| 1195 } | 1213 } |
| 1214 if (_json.containsKey("nextPageToken")) { |
| 1215 nextPageToken = _json["nextPageToken"]; |
| 1216 } |
| 1196 if (_json.containsKey("point")) { | 1217 if (_json.containsKey("point")) { |
| 1197 point = _json["point"].map((value) => new DataPoint.fromJson(value)).toLis
t(); | 1218 point = _json["point"].map((value) => new DataPoint.fromJson(value)).toLis
t(); |
| 1198 } | 1219 } |
| 1199 } | 1220 } |
| 1200 | 1221 |
| 1201 core.Map toJson() { | 1222 core.Map toJson() { |
| 1202 var _json = new core.Map(); | 1223 var _json = new core.Map(); |
| 1203 if (dataSourceId != null) { | 1224 if (dataSourceId != null) { |
| 1204 _json["dataSourceId"] = dataSourceId; | 1225 _json["dataSourceId"] = dataSourceId; |
| 1205 } | 1226 } |
| 1206 if (maxEndTimeNs != null) { | 1227 if (maxEndTimeNs != null) { |
| 1207 _json["maxEndTimeNs"] = maxEndTimeNs; | 1228 _json["maxEndTimeNs"] = maxEndTimeNs; |
| 1208 } | 1229 } |
| 1209 if (minStartTimeNs != null) { | 1230 if (minStartTimeNs != null) { |
| 1210 _json["minStartTimeNs"] = minStartTimeNs; | 1231 _json["minStartTimeNs"] = minStartTimeNs; |
| 1211 } | 1232 } |
| 1233 if (nextPageToken != null) { |
| 1234 _json["nextPageToken"] = nextPageToken; |
| 1235 } |
| 1212 if (point != null) { | 1236 if (point != null) { |
| 1213 _json["point"] = point.map((value) => (value).toJson()).toList(); | 1237 _json["point"] = point.map((value) => (value).toJson()).toList(); |
| 1214 } | 1238 } |
| 1215 return _json; | 1239 return _json; |
| 1216 } | 1240 } |
| 1217 } | 1241 } |
| 1218 | 1242 |
| 1219 | 1243 |
| 1220 /** | 1244 /** |
| 1221 * Representation of an integrated device (such as a phone or a wearable) that | 1245 * Representation of an integrated device (such as a phone or a wearable) that |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1474 } | 1498 } |
| 1475 | 1499 |
| 1476 | 1500 |
| 1477 /** | 1501 /** |
| 1478 * Holder object for the value of a single field in a data point. | 1502 * Holder object for the value of a single field in a data point. |
| 1479 * | 1503 * |
| 1480 * A field value has a particular format and is only ever set to one of an | 1504 * A field value has a particular format and is only ever set to one of an |
| 1481 * integer or a floating point value. | 1505 * integer or a floating point value. |
| 1482 */ | 1506 */ |
| 1483 class Value { | 1507 class Value { |
| 1484 /** Floating point value. */ | 1508 /** Floating point value. When this is set, intVal must not be set. */ |
| 1485 core.double fpVal; | 1509 core.double fpVal; |
| 1486 | 1510 |
| 1487 /** Integer value. */ | 1511 /** Integer value. When this is set, fpVal must not be set. */ |
| 1488 core.int intVal; | 1512 core.int intVal; |
| 1489 | 1513 |
| 1490 | 1514 |
| 1491 Value(); | 1515 Value(); |
| 1492 | 1516 |
| 1493 Value.fromJson(core.Map _json) { | 1517 Value.fromJson(core.Map _json) { |
| 1494 if (_json.containsKey("fpVal")) { | 1518 if (_json.containsKey("fpVal")) { |
| 1495 fpVal = _json["fpVal"]; | 1519 fpVal = _json["fpVal"]; |
| 1496 } | 1520 } |
| 1497 if (_json.containsKey("intVal")) { | 1521 if (_json.containsKey("intVal")) { |
| 1498 intVal = _json["intVal"]; | 1522 intVal = _json["intVal"]; |
| 1499 } | 1523 } |
| 1500 } | 1524 } |
| 1501 | 1525 |
| 1502 core.Map toJson() { | 1526 core.Map toJson() { |
| 1503 var _json = new core.Map(); | 1527 var _json = new core.Map(); |
| 1504 if (fpVal != null) { | 1528 if (fpVal != null) { |
| 1505 _json["fpVal"] = fpVal; | 1529 _json["fpVal"] = fpVal; |
| 1506 } | 1530 } |
| 1507 if (intVal != null) { | 1531 if (intVal != null) { |
| 1508 _json["intVal"] = intVal; | 1532 _json["intVal"] = intVal; |
| 1509 } | 1533 } |
| 1510 return _json; | 1534 return _json; |
| 1511 } | 1535 } |
| 1512 } | 1536 } |
| 1513 | 1537 |
| 1514 | 1538 |
| OLD | NEW |