OLD | NEW |
(Empty) | |
| 1 library googleapis.coordinate.v1; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; |
| 7 |
| 8 import "package:crypto/crypto.dart" as crypto; |
| 9 import 'package:http/http.dart' as http; |
| 10 import '../src/common_internal.dart' as common_internal; |
| 11 import '../common/common.dart' as common; |
| 12 |
| 13 export '../common/common.dart' show ApiRequestError; |
| 14 export '../common/common.dart' show DetailedApiRequestError; |
| 15 |
| 16 /** Lets you view and manage jobs in a Coordinate team. */ |
| 17 class CoordinateApi { |
| 18 /** View and manage your Google Maps Coordinate jobs */ |
| 19 static const CoordinateScope = "https://www.googleapis.com/auth/coordinate"; |
| 20 |
| 21 /** View your Google Coordinate jobs */ |
| 22 static const CoordinateReadonlyScope = "https://www.googleapis.com/auth/coordi
nate.readonly"; |
| 23 |
| 24 |
| 25 final common_internal.ApiRequester _requester; |
| 26 |
| 27 CustomFieldDefResourceApi get customFieldDef => new CustomFieldDefResourceApi(
_requester); |
| 28 JobsResourceApi get jobs => new JobsResourceApi(_requester); |
| 29 LocationResourceApi get location => new LocationResourceApi(_requester); |
| 30 ScheduleResourceApi get schedule => new ScheduleResourceApi(_requester); |
| 31 WorkerResourceApi get worker => new WorkerResourceApi(_requester); |
| 32 |
| 33 CoordinateApi(http.Client client) : |
| 34 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "/coordinate/v1/teams/"); |
| 35 } |
| 36 |
| 37 |
| 38 /** Not documented yet. */ |
| 39 class CustomFieldDefResourceApi { |
| 40 final common_internal.ApiRequester _requester; |
| 41 |
| 42 CustomFieldDefResourceApi(common_internal.ApiRequester client) : |
| 43 _requester = client; |
| 44 |
| 45 /** |
| 46 * Retrieves a list of custom field definitions for a team. |
| 47 * |
| 48 * Request parameters: |
| 49 * |
| 50 * [teamId] - Team ID |
| 51 * |
| 52 * Completes with a [CustomFieldDefListResponse]. |
| 53 * |
| 54 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 55 * error. |
| 56 * |
| 57 * If the used [http.Client] completes with an error when making a REST call, |
| 58 * this method will complete with the same error. |
| 59 */ |
| 60 async.Future<CustomFieldDefListResponse> list(core.String teamId) { |
| 61 var _url = null; |
| 62 var _queryParams = new core.Map(); |
| 63 var _uploadMedia = null; |
| 64 var _uploadOptions = null; |
| 65 var _downloadOptions = common.DownloadOptions.Metadata; |
| 66 var _body = null; |
| 67 |
| 68 if (teamId == null) { |
| 69 throw new core.ArgumentError("Parameter teamId is required."); |
| 70 } |
| 71 |
| 72 |
| 73 _url = common_internal.Escaper.ecapeVariable('$teamId') + '/custom_fields'; |
| 74 |
| 75 var _response = _requester.request(_url, |
| 76 "GET", |
| 77 body: _body, |
| 78 queryParams: _queryParams, |
| 79 uploadOptions: _uploadOptions, |
| 80 uploadMedia: _uploadMedia, |
| 81 downloadOptions: _downloadOptions); |
| 82 return _response.then((data) => new CustomFieldDefListResponse.fromJson(data
)); |
| 83 } |
| 84 |
| 85 } |
| 86 |
| 87 |
| 88 /** Not documented yet. */ |
| 89 class JobsResourceApi { |
| 90 final common_internal.ApiRequester _requester; |
| 91 |
| 92 JobsResourceApi(common_internal.ApiRequester client) : |
| 93 _requester = client; |
| 94 |
| 95 /** |
| 96 * Retrieves a job, including all the changes made to the job. |
| 97 * |
| 98 * Request parameters: |
| 99 * |
| 100 * [teamId] - Team ID |
| 101 * |
| 102 * [jobId] - Job number |
| 103 * |
| 104 * Completes with a [Job]. |
| 105 * |
| 106 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 107 * error. |
| 108 * |
| 109 * If the used [http.Client] completes with an error when making a REST call, |
| 110 * this method will complete with the same error. |
| 111 */ |
| 112 async.Future<Job> get(core.String teamId, core.String jobId) { |
| 113 var _url = null; |
| 114 var _queryParams = new core.Map(); |
| 115 var _uploadMedia = null; |
| 116 var _uploadOptions = null; |
| 117 var _downloadOptions = common.DownloadOptions.Metadata; |
| 118 var _body = null; |
| 119 |
| 120 if (teamId == null) { |
| 121 throw new core.ArgumentError("Parameter teamId is required."); |
| 122 } |
| 123 if (jobId == null) { |
| 124 throw new core.ArgumentError("Parameter jobId is required."); |
| 125 } |
| 126 |
| 127 |
| 128 _url = common_internal.Escaper.ecapeVariable('$teamId') + '/jobs/' + common_
internal.Escaper.ecapeVariable('$jobId'); |
| 129 |
| 130 var _response = _requester.request(_url, |
| 131 "GET", |
| 132 body: _body, |
| 133 queryParams: _queryParams, |
| 134 uploadOptions: _uploadOptions, |
| 135 uploadMedia: _uploadMedia, |
| 136 downloadOptions: _downloadOptions); |
| 137 return _response.then((data) => new Job.fromJson(data)); |
| 138 } |
| 139 |
| 140 /** |
| 141 * Inserts a new job. Only the state field of the job should be set. |
| 142 * |
| 143 * [request] - The metadata request object. |
| 144 * |
| 145 * Request parameters: |
| 146 * |
| 147 * [teamId] - Team ID |
| 148 * |
| 149 * [address] - Job address as newline (Unix) separated string |
| 150 * |
| 151 * [lat] - The latitude coordinate of this job's location. |
| 152 * |
| 153 * [lng] - The longitude coordinate of this job's location. |
| 154 * |
| 155 * [title] - Job title |
| 156 * |
| 157 * [assignee] - Assignee email address, or empty string to unassign. |
| 158 * |
| 159 * [customField] - Map from custom field id (from /team//custom_fields) to the |
| 160 * field value. For example '123=Alice' |
| 161 * |
| 162 * [customerName] - Customer name |
| 163 * |
| 164 * [customerPhoneNumber] - Customer phone number |
| 165 * |
| 166 * [note] - Job note as newline (Unix) separated string |
| 167 * |
| 168 * Completes with a [Job]. |
| 169 * |
| 170 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 171 * error. |
| 172 * |
| 173 * If the used [http.Client] completes with an error when making a REST call, |
| 174 * this method will complete with the same error. |
| 175 */ |
| 176 async.Future<Job> insert(Job request, core.String teamId, core.String address,
core.double lat, core.double lng, core.String title, {core.String assignee, cor
e.List<core.String> customField, core.String customerName, core.String customerP
honeNumber, core.String note}) { |
| 177 var _url = null; |
| 178 var _queryParams = new core.Map(); |
| 179 var _uploadMedia = null; |
| 180 var _uploadOptions = null; |
| 181 var _downloadOptions = common.DownloadOptions.Metadata; |
| 182 var _body = null; |
| 183 |
| 184 if (request != null) { |
| 185 _body = convert.JSON.encode((request).toJson()); |
| 186 } |
| 187 if (teamId == null) { |
| 188 throw new core.ArgumentError("Parameter teamId is required."); |
| 189 } |
| 190 if (address == null) { |
| 191 throw new core.ArgumentError("Parameter address is required."); |
| 192 } |
| 193 _queryParams["address"] = [address]; |
| 194 if (lat == null) { |
| 195 throw new core.ArgumentError("Parameter lat is required."); |
| 196 } |
| 197 _queryParams["lat"] = ["${lat}"]; |
| 198 if (lng == null) { |
| 199 throw new core.ArgumentError("Parameter lng is required."); |
| 200 } |
| 201 _queryParams["lng"] = ["${lng}"]; |
| 202 if (title == null) { |
| 203 throw new core.ArgumentError("Parameter title is required."); |
| 204 } |
| 205 _queryParams["title"] = [title]; |
| 206 if (assignee != null) { |
| 207 _queryParams["assignee"] = [assignee]; |
| 208 } |
| 209 if (customField != null) { |
| 210 _queryParams["customField"] = customField; |
| 211 } |
| 212 if (customerName != null) { |
| 213 _queryParams["customerName"] = [customerName]; |
| 214 } |
| 215 if (customerPhoneNumber != null) { |
| 216 _queryParams["customerPhoneNumber"] = [customerPhoneNumber]; |
| 217 } |
| 218 if (note != null) { |
| 219 _queryParams["note"] = [note]; |
| 220 } |
| 221 |
| 222 |
| 223 _url = common_internal.Escaper.ecapeVariable('$teamId') + '/jobs'; |
| 224 |
| 225 var _response = _requester.request(_url, |
| 226 "POST", |
| 227 body: _body, |
| 228 queryParams: _queryParams, |
| 229 uploadOptions: _uploadOptions, |
| 230 uploadMedia: _uploadMedia, |
| 231 downloadOptions: _downloadOptions); |
| 232 return _response.then((data) => new Job.fromJson(data)); |
| 233 } |
| 234 |
| 235 /** |
| 236 * Retrieves jobs created or modified since the given timestamp. |
| 237 * |
| 238 * Request parameters: |
| 239 * |
| 240 * [teamId] - Team ID |
| 241 * |
| 242 * [maxResults] - Maximum number of results to return in one page. |
| 243 * |
| 244 * [minModifiedTimestampMs] - Minimum time a job was modified in milliseconds |
| 245 * since epoch. |
| 246 * |
| 247 * [pageToken] - Continuation token |
| 248 * |
| 249 * Completes with a [JobListResponse]. |
| 250 * |
| 251 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 252 * error. |
| 253 * |
| 254 * If the used [http.Client] completes with an error when making a REST call, |
| 255 * this method will complete with the same error. |
| 256 */ |
| 257 async.Future<JobListResponse> list(core.String teamId, {core.int maxResults, c
ore.String minModifiedTimestampMs, core.String pageToken}) { |
| 258 var _url = null; |
| 259 var _queryParams = new core.Map(); |
| 260 var _uploadMedia = null; |
| 261 var _uploadOptions = null; |
| 262 var _downloadOptions = common.DownloadOptions.Metadata; |
| 263 var _body = null; |
| 264 |
| 265 if (teamId == null) { |
| 266 throw new core.ArgumentError("Parameter teamId is required."); |
| 267 } |
| 268 if (maxResults != null) { |
| 269 _queryParams["maxResults"] = ["${maxResults}"]; |
| 270 } |
| 271 if (minModifiedTimestampMs != null) { |
| 272 _queryParams["minModifiedTimestampMs"] = [minModifiedTimestampMs]; |
| 273 } |
| 274 if (pageToken != null) { |
| 275 _queryParams["pageToken"] = [pageToken]; |
| 276 } |
| 277 |
| 278 |
| 279 _url = common_internal.Escaper.ecapeVariable('$teamId') + '/jobs'; |
| 280 |
| 281 var _response = _requester.request(_url, |
| 282 "GET", |
| 283 body: _body, |
| 284 queryParams: _queryParams, |
| 285 uploadOptions: _uploadOptions, |
| 286 uploadMedia: _uploadMedia, |
| 287 downloadOptions: _downloadOptions); |
| 288 return _response.then((data) => new JobListResponse.fromJson(data)); |
| 289 } |
| 290 |
| 291 /** |
| 292 * Updates a job. Fields that are set in the job state will be updated. This |
| 293 * method supports patch semantics. |
| 294 * |
| 295 * [request] - The metadata request object. |
| 296 * |
| 297 * Request parameters: |
| 298 * |
| 299 * [teamId] - Team ID |
| 300 * |
| 301 * [jobId] - Job number |
| 302 * |
| 303 * [address] - Job address as newline (Unix) separated string |
| 304 * |
| 305 * [assignee] - Assignee email address, or empty string to unassign. |
| 306 * |
| 307 * [customField] - Map from custom field id (from /team//custom_fields) to the |
| 308 * field value. For example '123=Alice' |
| 309 * |
| 310 * [customerName] - Customer name |
| 311 * |
| 312 * [customerPhoneNumber] - Customer phone number |
| 313 * |
| 314 * [lat] - The latitude coordinate of this job's location. |
| 315 * |
| 316 * [lng] - The longitude coordinate of this job's location. |
| 317 * |
| 318 * [note] - Job note as newline (Unix) separated string |
| 319 * |
| 320 * [progress] - Job progress |
| 321 * Possible string values are: |
| 322 * - "COMPLETED" : Completed |
| 323 * - "IN_PROGRESS" : In progress |
| 324 * - "NOT_ACCEPTED" : Not accepted |
| 325 * - "NOT_STARTED" : Not started |
| 326 * - "OBSOLETE" : Obsolete |
| 327 * |
| 328 * [title] - Job title |
| 329 * |
| 330 * Completes with a [Job]. |
| 331 * |
| 332 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 333 * error. |
| 334 * |
| 335 * If the used [http.Client] completes with an error when making a REST call, |
| 336 * this method will complete with the same error. |
| 337 */ |
| 338 async.Future<Job> patch(Job request, core.String teamId, core.String jobId, {c
ore.String address, core.String assignee, core.List<core.String> customField, co
re.String customerName, core.String customerPhoneNumber, core.double lat, core.d
ouble lng, core.String note, core.String progress, core.String title}) { |
| 339 var _url = null; |
| 340 var _queryParams = new core.Map(); |
| 341 var _uploadMedia = null; |
| 342 var _uploadOptions = null; |
| 343 var _downloadOptions = common.DownloadOptions.Metadata; |
| 344 var _body = null; |
| 345 |
| 346 if (request != null) { |
| 347 _body = convert.JSON.encode((request).toJson()); |
| 348 } |
| 349 if (teamId == null) { |
| 350 throw new core.ArgumentError("Parameter teamId is required."); |
| 351 } |
| 352 if (jobId == null) { |
| 353 throw new core.ArgumentError("Parameter jobId is required."); |
| 354 } |
| 355 if (address != null) { |
| 356 _queryParams["address"] = [address]; |
| 357 } |
| 358 if (assignee != null) { |
| 359 _queryParams["assignee"] = [assignee]; |
| 360 } |
| 361 if (customField != null) { |
| 362 _queryParams["customField"] = customField; |
| 363 } |
| 364 if (customerName != null) { |
| 365 _queryParams["customerName"] = [customerName]; |
| 366 } |
| 367 if (customerPhoneNumber != null) { |
| 368 _queryParams["customerPhoneNumber"] = [customerPhoneNumber]; |
| 369 } |
| 370 if (lat != null) { |
| 371 _queryParams["lat"] = ["${lat}"]; |
| 372 } |
| 373 if (lng != null) { |
| 374 _queryParams["lng"] = ["${lng}"]; |
| 375 } |
| 376 if (note != null) { |
| 377 _queryParams["note"] = [note]; |
| 378 } |
| 379 if (progress != null) { |
| 380 _queryParams["progress"] = [progress]; |
| 381 } |
| 382 if (title != null) { |
| 383 _queryParams["title"] = [title]; |
| 384 } |
| 385 |
| 386 |
| 387 _url = common_internal.Escaper.ecapeVariable('$teamId') + '/jobs/' + common_
internal.Escaper.ecapeVariable('$jobId'); |
| 388 |
| 389 var _response = _requester.request(_url, |
| 390 "PATCH", |
| 391 body: _body, |
| 392 queryParams: _queryParams, |
| 393 uploadOptions: _uploadOptions, |
| 394 uploadMedia: _uploadMedia, |
| 395 downloadOptions: _downloadOptions); |
| 396 return _response.then((data) => new Job.fromJson(data)); |
| 397 } |
| 398 |
| 399 /** |
| 400 * Updates a job. Fields that are set in the job state will be updated. |
| 401 * |
| 402 * [request] - The metadata request object. |
| 403 * |
| 404 * Request parameters: |
| 405 * |
| 406 * [teamId] - Team ID |
| 407 * |
| 408 * [jobId] - Job number |
| 409 * |
| 410 * [address] - Job address as newline (Unix) separated string |
| 411 * |
| 412 * [assignee] - Assignee email address, or empty string to unassign. |
| 413 * |
| 414 * [customField] - Map from custom field id (from /team//custom_fields) to the |
| 415 * field value. For example '123=Alice' |
| 416 * |
| 417 * [customerName] - Customer name |
| 418 * |
| 419 * [customerPhoneNumber] - Customer phone number |
| 420 * |
| 421 * [lat] - The latitude coordinate of this job's location. |
| 422 * |
| 423 * [lng] - The longitude coordinate of this job's location. |
| 424 * |
| 425 * [note] - Job note as newline (Unix) separated string |
| 426 * |
| 427 * [progress] - Job progress |
| 428 * Possible string values are: |
| 429 * - "COMPLETED" : Completed |
| 430 * - "IN_PROGRESS" : In progress |
| 431 * - "NOT_ACCEPTED" : Not accepted |
| 432 * - "NOT_STARTED" : Not started |
| 433 * - "OBSOLETE" : Obsolete |
| 434 * |
| 435 * [title] - Job title |
| 436 * |
| 437 * Completes with a [Job]. |
| 438 * |
| 439 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 440 * error. |
| 441 * |
| 442 * If the used [http.Client] completes with an error when making a REST call, |
| 443 * this method will complete with the same error. |
| 444 */ |
| 445 async.Future<Job> update(Job request, core.String teamId, core.String jobId, {
core.String address, core.String assignee, core.List<core.String> customField, c
ore.String customerName, core.String customerPhoneNumber, core.double lat, core.
double lng, core.String note, core.String progress, core.String title}) { |
| 446 var _url = null; |
| 447 var _queryParams = new core.Map(); |
| 448 var _uploadMedia = null; |
| 449 var _uploadOptions = null; |
| 450 var _downloadOptions = common.DownloadOptions.Metadata; |
| 451 var _body = null; |
| 452 |
| 453 if (request != null) { |
| 454 _body = convert.JSON.encode((request).toJson()); |
| 455 } |
| 456 if (teamId == null) { |
| 457 throw new core.ArgumentError("Parameter teamId is required."); |
| 458 } |
| 459 if (jobId == null) { |
| 460 throw new core.ArgumentError("Parameter jobId is required."); |
| 461 } |
| 462 if (address != null) { |
| 463 _queryParams["address"] = [address]; |
| 464 } |
| 465 if (assignee != null) { |
| 466 _queryParams["assignee"] = [assignee]; |
| 467 } |
| 468 if (customField != null) { |
| 469 _queryParams["customField"] = customField; |
| 470 } |
| 471 if (customerName != null) { |
| 472 _queryParams["customerName"] = [customerName]; |
| 473 } |
| 474 if (customerPhoneNumber != null) { |
| 475 _queryParams["customerPhoneNumber"] = [customerPhoneNumber]; |
| 476 } |
| 477 if (lat != null) { |
| 478 _queryParams["lat"] = ["${lat}"]; |
| 479 } |
| 480 if (lng != null) { |
| 481 _queryParams["lng"] = ["${lng}"]; |
| 482 } |
| 483 if (note != null) { |
| 484 _queryParams["note"] = [note]; |
| 485 } |
| 486 if (progress != null) { |
| 487 _queryParams["progress"] = [progress]; |
| 488 } |
| 489 if (title != null) { |
| 490 _queryParams["title"] = [title]; |
| 491 } |
| 492 |
| 493 |
| 494 _url = common_internal.Escaper.ecapeVariable('$teamId') + '/jobs/' + common_
internal.Escaper.ecapeVariable('$jobId'); |
| 495 |
| 496 var _response = _requester.request(_url, |
| 497 "PUT", |
| 498 body: _body, |
| 499 queryParams: _queryParams, |
| 500 uploadOptions: _uploadOptions, |
| 501 uploadMedia: _uploadMedia, |
| 502 downloadOptions: _downloadOptions); |
| 503 return _response.then((data) => new Job.fromJson(data)); |
| 504 } |
| 505 |
| 506 } |
| 507 |
| 508 |
| 509 /** Not documented yet. */ |
| 510 class LocationResourceApi { |
| 511 final common_internal.ApiRequester _requester; |
| 512 |
| 513 LocationResourceApi(common_internal.ApiRequester client) : |
| 514 _requester = client; |
| 515 |
| 516 /** |
| 517 * Retrieves a list of locations for a worker. |
| 518 * |
| 519 * Request parameters: |
| 520 * |
| 521 * [teamId] - Team ID |
| 522 * |
| 523 * [workerEmail] - Worker email address. |
| 524 * |
| 525 * [startTimestampMs] - Start timestamp in milliseconds since the epoch. |
| 526 * |
| 527 * [maxResults] - Maximum number of results to return in one page. |
| 528 * |
| 529 * [pageToken] - Continuation token |
| 530 * |
| 531 * Completes with a [LocationListResponse]. |
| 532 * |
| 533 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 534 * error. |
| 535 * |
| 536 * If the used [http.Client] completes with an error when making a REST call, |
| 537 * this method will complete with the same error. |
| 538 */ |
| 539 async.Future<LocationListResponse> list(core.String teamId, core.String worker
Email, core.String startTimestampMs, {core.int maxResults, core.String pageToken
}) { |
| 540 var _url = null; |
| 541 var _queryParams = new core.Map(); |
| 542 var _uploadMedia = null; |
| 543 var _uploadOptions = null; |
| 544 var _downloadOptions = common.DownloadOptions.Metadata; |
| 545 var _body = null; |
| 546 |
| 547 if (teamId == null) { |
| 548 throw new core.ArgumentError("Parameter teamId is required."); |
| 549 } |
| 550 if (workerEmail == null) { |
| 551 throw new core.ArgumentError("Parameter workerEmail is required."); |
| 552 } |
| 553 if (startTimestampMs == null) { |
| 554 throw new core.ArgumentError("Parameter startTimestampMs is required."); |
| 555 } |
| 556 _queryParams["startTimestampMs"] = [startTimestampMs]; |
| 557 if (maxResults != null) { |
| 558 _queryParams["maxResults"] = ["${maxResults}"]; |
| 559 } |
| 560 if (pageToken != null) { |
| 561 _queryParams["pageToken"] = [pageToken]; |
| 562 } |
| 563 |
| 564 |
| 565 _url = common_internal.Escaper.ecapeVariable('$teamId') + '/workers/' + comm
on_internal.Escaper.ecapeVariable('$workerEmail') + '/locations'; |
| 566 |
| 567 var _response = _requester.request(_url, |
| 568 "GET", |
| 569 body: _body, |
| 570 queryParams: _queryParams, |
| 571 uploadOptions: _uploadOptions, |
| 572 uploadMedia: _uploadMedia, |
| 573 downloadOptions: _downloadOptions); |
| 574 return _response.then((data) => new LocationListResponse.fromJson(data)); |
| 575 } |
| 576 |
| 577 } |
| 578 |
| 579 |
| 580 /** Not documented yet. */ |
| 581 class ScheduleResourceApi { |
| 582 final common_internal.ApiRequester _requester; |
| 583 |
| 584 ScheduleResourceApi(common_internal.ApiRequester client) : |
| 585 _requester = client; |
| 586 |
| 587 /** |
| 588 * Retrieves the schedule for a job. |
| 589 * |
| 590 * Request parameters: |
| 591 * |
| 592 * [teamId] - Team ID |
| 593 * |
| 594 * [jobId] - Job number |
| 595 * |
| 596 * Completes with a [Schedule]. |
| 597 * |
| 598 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 599 * error. |
| 600 * |
| 601 * If the used [http.Client] completes with an error when making a REST call, |
| 602 * this method will complete with the same error. |
| 603 */ |
| 604 async.Future<Schedule> get(core.String teamId, core.String jobId) { |
| 605 var _url = null; |
| 606 var _queryParams = new core.Map(); |
| 607 var _uploadMedia = null; |
| 608 var _uploadOptions = null; |
| 609 var _downloadOptions = common.DownloadOptions.Metadata; |
| 610 var _body = null; |
| 611 |
| 612 if (teamId == null) { |
| 613 throw new core.ArgumentError("Parameter teamId is required."); |
| 614 } |
| 615 if (jobId == null) { |
| 616 throw new core.ArgumentError("Parameter jobId is required."); |
| 617 } |
| 618 |
| 619 |
| 620 _url = common_internal.Escaper.ecapeVariable('$teamId') + '/jobs/' + common_
internal.Escaper.ecapeVariable('$jobId') + '/schedule'; |
| 621 |
| 622 var _response = _requester.request(_url, |
| 623 "GET", |
| 624 body: _body, |
| 625 queryParams: _queryParams, |
| 626 uploadOptions: _uploadOptions, |
| 627 uploadMedia: _uploadMedia, |
| 628 downloadOptions: _downloadOptions); |
| 629 return _response.then((data) => new Schedule.fromJson(data)); |
| 630 } |
| 631 |
| 632 /** |
| 633 * Replaces the schedule of a job with the provided schedule. This method |
| 634 * supports patch semantics. |
| 635 * |
| 636 * [request] - The metadata request object. |
| 637 * |
| 638 * Request parameters: |
| 639 * |
| 640 * [teamId] - Team ID |
| 641 * |
| 642 * [jobId] - Job number |
| 643 * |
| 644 * [allDay] - Whether the job is scheduled for the whole day. Time of day in |
| 645 * start/end times is ignored if this is true. |
| 646 * |
| 647 * [duration] - Job duration in milliseconds. |
| 648 * |
| 649 * [endTime] - Scheduled end time in milliseconds since epoch. |
| 650 * |
| 651 * [startTime] - Scheduled start time in milliseconds since epoch. |
| 652 * |
| 653 * Completes with a [Schedule]. |
| 654 * |
| 655 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 656 * error. |
| 657 * |
| 658 * If the used [http.Client] completes with an error when making a REST call, |
| 659 * this method will complete with the same error. |
| 660 */ |
| 661 async.Future<Schedule> patch(Schedule request, core.String teamId, core.String
jobId, {core.bool allDay, core.String duration, core.String endTime, core.Strin
g startTime}) { |
| 662 var _url = null; |
| 663 var _queryParams = new core.Map(); |
| 664 var _uploadMedia = null; |
| 665 var _uploadOptions = null; |
| 666 var _downloadOptions = common.DownloadOptions.Metadata; |
| 667 var _body = null; |
| 668 |
| 669 if (request != null) { |
| 670 _body = convert.JSON.encode((request).toJson()); |
| 671 } |
| 672 if (teamId == null) { |
| 673 throw new core.ArgumentError("Parameter teamId is required."); |
| 674 } |
| 675 if (jobId == null) { |
| 676 throw new core.ArgumentError("Parameter jobId is required."); |
| 677 } |
| 678 if (allDay != null) { |
| 679 _queryParams["allDay"] = ["${allDay}"]; |
| 680 } |
| 681 if (duration != null) { |
| 682 _queryParams["duration"] = [duration]; |
| 683 } |
| 684 if (endTime != null) { |
| 685 _queryParams["endTime"] = [endTime]; |
| 686 } |
| 687 if (startTime != null) { |
| 688 _queryParams["startTime"] = [startTime]; |
| 689 } |
| 690 |
| 691 |
| 692 _url = common_internal.Escaper.ecapeVariable('$teamId') + '/jobs/' + common_
internal.Escaper.ecapeVariable('$jobId') + '/schedule'; |
| 693 |
| 694 var _response = _requester.request(_url, |
| 695 "PATCH", |
| 696 body: _body, |
| 697 queryParams: _queryParams, |
| 698 uploadOptions: _uploadOptions, |
| 699 uploadMedia: _uploadMedia, |
| 700 downloadOptions: _downloadOptions); |
| 701 return _response.then((data) => new Schedule.fromJson(data)); |
| 702 } |
| 703 |
| 704 /** |
| 705 * Replaces the schedule of a job with the provided schedule. |
| 706 * |
| 707 * [request] - The metadata request object. |
| 708 * |
| 709 * Request parameters: |
| 710 * |
| 711 * [teamId] - Team ID |
| 712 * |
| 713 * [jobId] - Job number |
| 714 * |
| 715 * [allDay] - Whether the job is scheduled for the whole day. Time of day in |
| 716 * start/end times is ignored if this is true. |
| 717 * |
| 718 * [duration] - Job duration in milliseconds. |
| 719 * |
| 720 * [endTime] - Scheduled end time in milliseconds since epoch. |
| 721 * |
| 722 * [startTime] - Scheduled start time in milliseconds since epoch. |
| 723 * |
| 724 * Completes with a [Schedule]. |
| 725 * |
| 726 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 727 * error. |
| 728 * |
| 729 * If the used [http.Client] completes with an error when making a REST call, |
| 730 * this method will complete with the same error. |
| 731 */ |
| 732 async.Future<Schedule> update(Schedule request, core.String teamId, core.Strin
g jobId, {core.bool allDay, core.String duration, core.String endTime, core.Stri
ng startTime}) { |
| 733 var _url = null; |
| 734 var _queryParams = new core.Map(); |
| 735 var _uploadMedia = null; |
| 736 var _uploadOptions = null; |
| 737 var _downloadOptions = common.DownloadOptions.Metadata; |
| 738 var _body = null; |
| 739 |
| 740 if (request != null) { |
| 741 _body = convert.JSON.encode((request).toJson()); |
| 742 } |
| 743 if (teamId == null) { |
| 744 throw new core.ArgumentError("Parameter teamId is required."); |
| 745 } |
| 746 if (jobId == null) { |
| 747 throw new core.ArgumentError("Parameter jobId is required."); |
| 748 } |
| 749 if (allDay != null) { |
| 750 _queryParams["allDay"] = ["${allDay}"]; |
| 751 } |
| 752 if (duration != null) { |
| 753 _queryParams["duration"] = [duration]; |
| 754 } |
| 755 if (endTime != null) { |
| 756 _queryParams["endTime"] = [endTime]; |
| 757 } |
| 758 if (startTime != null) { |
| 759 _queryParams["startTime"] = [startTime]; |
| 760 } |
| 761 |
| 762 |
| 763 _url = common_internal.Escaper.ecapeVariable('$teamId') + '/jobs/' + common_
internal.Escaper.ecapeVariable('$jobId') + '/schedule'; |
| 764 |
| 765 var _response = _requester.request(_url, |
| 766 "PUT", |
| 767 body: _body, |
| 768 queryParams: _queryParams, |
| 769 uploadOptions: _uploadOptions, |
| 770 uploadMedia: _uploadMedia, |
| 771 downloadOptions: _downloadOptions); |
| 772 return _response.then((data) => new Schedule.fromJson(data)); |
| 773 } |
| 774 |
| 775 } |
| 776 |
| 777 |
| 778 /** Not documented yet. */ |
| 779 class WorkerResourceApi { |
| 780 final common_internal.ApiRequester _requester; |
| 781 |
| 782 WorkerResourceApi(common_internal.ApiRequester client) : |
| 783 _requester = client; |
| 784 |
| 785 /** |
| 786 * Retrieves a list of workers in a team. |
| 787 * |
| 788 * Request parameters: |
| 789 * |
| 790 * [teamId] - Team ID |
| 791 * |
| 792 * Completes with a [WorkerListResponse]. |
| 793 * |
| 794 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 795 * error. |
| 796 * |
| 797 * If the used [http.Client] completes with an error when making a REST call, |
| 798 * this method will complete with the same error. |
| 799 */ |
| 800 async.Future<WorkerListResponse> list(core.String teamId) { |
| 801 var _url = null; |
| 802 var _queryParams = new core.Map(); |
| 803 var _uploadMedia = null; |
| 804 var _uploadOptions = null; |
| 805 var _downloadOptions = common.DownloadOptions.Metadata; |
| 806 var _body = null; |
| 807 |
| 808 if (teamId == null) { |
| 809 throw new core.ArgumentError("Parameter teamId is required."); |
| 810 } |
| 811 |
| 812 |
| 813 _url = common_internal.Escaper.ecapeVariable('$teamId') + '/workers'; |
| 814 |
| 815 var _response = _requester.request(_url, |
| 816 "GET", |
| 817 body: _body, |
| 818 queryParams: _queryParams, |
| 819 uploadOptions: _uploadOptions, |
| 820 uploadMedia: _uploadMedia, |
| 821 downloadOptions: _downloadOptions); |
| 822 return _response.then((data) => new WorkerListResponse.fromJson(data)); |
| 823 } |
| 824 |
| 825 } |
| 826 |
| 827 |
| 828 |
| 829 /** Custom field. */ |
| 830 class CustomField { |
| 831 /** Custom field id. */ |
| 832 core.String customFieldId; |
| 833 |
| 834 /** Identifies this object as a custom field. */ |
| 835 core.String kind; |
| 836 |
| 837 /** Custom field value. */ |
| 838 core.String value; |
| 839 |
| 840 |
| 841 CustomField(); |
| 842 |
| 843 CustomField.fromJson(core.Map _json) { |
| 844 if (_json.containsKey("customFieldId")) { |
| 845 customFieldId = _json["customFieldId"]; |
| 846 } |
| 847 if (_json.containsKey("kind")) { |
| 848 kind = _json["kind"]; |
| 849 } |
| 850 if (_json.containsKey("value")) { |
| 851 value = _json["value"]; |
| 852 } |
| 853 } |
| 854 |
| 855 core.Map toJson() { |
| 856 var _json = new core.Map(); |
| 857 if (customFieldId != null) { |
| 858 _json["customFieldId"] = customFieldId; |
| 859 } |
| 860 if (kind != null) { |
| 861 _json["kind"] = kind; |
| 862 } |
| 863 if (value != null) { |
| 864 _json["value"] = value; |
| 865 } |
| 866 return _json; |
| 867 } |
| 868 } |
| 869 |
| 870 |
| 871 /** Custom field definition. */ |
| 872 class CustomFieldDef { |
| 873 /** Whether the field is enabled. */ |
| 874 core.bool enabled; |
| 875 |
| 876 /** Custom field id. */ |
| 877 core.String id; |
| 878 |
| 879 /** Identifies this object as a custom field definition. */ |
| 880 core.String kind; |
| 881 |
| 882 /** Custom field name. */ |
| 883 core.String name; |
| 884 |
| 885 /** Whether the field is required for checkout. */ |
| 886 core.bool requiredForCheckout; |
| 887 |
| 888 /** Custom field type. */ |
| 889 core.String type; |
| 890 |
| 891 |
| 892 CustomFieldDef(); |
| 893 |
| 894 CustomFieldDef.fromJson(core.Map _json) { |
| 895 if (_json.containsKey("enabled")) { |
| 896 enabled = _json["enabled"]; |
| 897 } |
| 898 if (_json.containsKey("id")) { |
| 899 id = _json["id"]; |
| 900 } |
| 901 if (_json.containsKey("kind")) { |
| 902 kind = _json["kind"]; |
| 903 } |
| 904 if (_json.containsKey("name")) { |
| 905 name = _json["name"]; |
| 906 } |
| 907 if (_json.containsKey("requiredForCheckout")) { |
| 908 requiredForCheckout = _json["requiredForCheckout"]; |
| 909 } |
| 910 if (_json.containsKey("type")) { |
| 911 type = _json["type"]; |
| 912 } |
| 913 } |
| 914 |
| 915 core.Map toJson() { |
| 916 var _json = new core.Map(); |
| 917 if (enabled != null) { |
| 918 _json["enabled"] = enabled; |
| 919 } |
| 920 if (id != null) { |
| 921 _json["id"] = id; |
| 922 } |
| 923 if (kind != null) { |
| 924 _json["kind"] = kind; |
| 925 } |
| 926 if (name != null) { |
| 927 _json["name"] = name; |
| 928 } |
| 929 if (requiredForCheckout != null) { |
| 930 _json["requiredForCheckout"] = requiredForCheckout; |
| 931 } |
| 932 if (type != null) { |
| 933 _json["type"] = type; |
| 934 } |
| 935 return _json; |
| 936 } |
| 937 } |
| 938 |
| 939 |
| 940 /** Collection of custom field definitions for a team. */ |
| 941 class CustomFieldDefListResponse { |
| 942 /** Collection of custom field definitions in a team. */ |
| 943 core.List<CustomFieldDef> items; |
| 944 |
| 945 /** |
| 946 * Identifies this object as a collection of custom field definitions in a |
| 947 * team. |
| 948 */ |
| 949 core.String kind; |
| 950 |
| 951 |
| 952 CustomFieldDefListResponse(); |
| 953 |
| 954 CustomFieldDefListResponse.fromJson(core.Map _json) { |
| 955 if (_json.containsKey("items")) { |
| 956 items = _json["items"].map((value) => new CustomFieldDef.fromJson(value)).
toList(); |
| 957 } |
| 958 if (_json.containsKey("kind")) { |
| 959 kind = _json["kind"]; |
| 960 } |
| 961 } |
| 962 |
| 963 core.Map toJson() { |
| 964 var _json = new core.Map(); |
| 965 if (items != null) { |
| 966 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 967 } |
| 968 if (kind != null) { |
| 969 _json["kind"] = kind; |
| 970 } |
| 971 return _json; |
| 972 } |
| 973 } |
| 974 |
| 975 |
| 976 /** Collection of custom fields. */ |
| 977 class CustomFields { |
| 978 /** Collection of custom fields. */ |
| 979 core.List<CustomField> customField; |
| 980 |
| 981 /** Identifies this object as a collection of custom fields. */ |
| 982 core.String kind; |
| 983 |
| 984 |
| 985 CustomFields(); |
| 986 |
| 987 CustomFields.fromJson(core.Map _json) { |
| 988 if (_json.containsKey("customField")) { |
| 989 customField = _json["customField"].map((value) => new CustomField.fromJson
(value)).toList(); |
| 990 } |
| 991 if (_json.containsKey("kind")) { |
| 992 kind = _json["kind"]; |
| 993 } |
| 994 } |
| 995 |
| 996 core.Map toJson() { |
| 997 var _json = new core.Map(); |
| 998 if (customField != null) { |
| 999 _json["customField"] = customField.map((value) => (value).toJson()).toList
(); |
| 1000 } |
| 1001 if (kind != null) { |
| 1002 _json["kind"] = kind; |
| 1003 } |
| 1004 return _json; |
| 1005 } |
| 1006 } |
| 1007 |
| 1008 |
| 1009 /** A job. */ |
| 1010 class Job { |
| 1011 /** Job id. */ |
| 1012 core.String id; |
| 1013 |
| 1014 /** |
| 1015 * List of job changes since it was created. The first change corresponds to |
| 1016 * the state of the job when it was created. |
| 1017 */ |
| 1018 core.List<JobChange> jobChange; |
| 1019 |
| 1020 /** Identifies this object as a job. */ |
| 1021 core.String kind; |
| 1022 |
| 1023 /** Current job state. */ |
| 1024 JobState state; |
| 1025 |
| 1026 |
| 1027 Job(); |
| 1028 |
| 1029 Job.fromJson(core.Map _json) { |
| 1030 if (_json.containsKey("id")) { |
| 1031 id = _json["id"]; |
| 1032 } |
| 1033 if (_json.containsKey("jobChange")) { |
| 1034 jobChange = _json["jobChange"].map((value) => new JobChange.fromJson(value
)).toList(); |
| 1035 } |
| 1036 if (_json.containsKey("kind")) { |
| 1037 kind = _json["kind"]; |
| 1038 } |
| 1039 if (_json.containsKey("state")) { |
| 1040 state = new JobState.fromJson(_json["state"]); |
| 1041 } |
| 1042 } |
| 1043 |
| 1044 core.Map toJson() { |
| 1045 var _json = new core.Map(); |
| 1046 if (id != null) { |
| 1047 _json["id"] = id; |
| 1048 } |
| 1049 if (jobChange != null) { |
| 1050 _json["jobChange"] = jobChange.map((value) => (value).toJson()).toList(); |
| 1051 } |
| 1052 if (kind != null) { |
| 1053 _json["kind"] = kind; |
| 1054 } |
| 1055 if (state != null) { |
| 1056 _json["state"] = (state).toJson(); |
| 1057 } |
| 1058 return _json; |
| 1059 } |
| 1060 } |
| 1061 |
| 1062 |
| 1063 /** Change to a job. For example assigning the job to a different worker. */ |
| 1064 class JobChange { |
| 1065 /** Identifies this object as a job change. */ |
| 1066 core.String kind; |
| 1067 |
| 1068 /** Change applied to the job. Only the fields that were changed are set. */ |
| 1069 JobState state; |
| 1070 |
| 1071 /** Time at which this change was applied. */ |
| 1072 core.String timestamp; |
| 1073 |
| 1074 |
| 1075 JobChange(); |
| 1076 |
| 1077 JobChange.fromJson(core.Map _json) { |
| 1078 if (_json.containsKey("kind")) { |
| 1079 kind = _json["kind"]; |
| 1080 } |
| 1081 if (_json.containsKey("state")) { |
| 1082 state = new JobState.fromJson(_json["state"]); |
| 1083 } |
| 1084 if (_json.containsKey("timestamp")) { |
| 1085 timestamp = _json["timestamp"]; |
| 1086 } |
| 1087 } |
| 1088 |
| 1089 core.Map toJson() { |
| 1090 var _json = new core.Map(); |
| 1091 if (kind != null) { |
| 1092 _json["kind"] = kind; |
| 1093 } |
| 1094 if (state != null) { |
| 1095 _json["state"] = (state).toJson(); |
| 1096 } |
| 1097 if (timestamp != null) { |
| 1098 _json["timestamp"] = timestamp; |
| 1099 } |
| 1100 return _json; |
| 1101 } |
| 1102 } |
| 1103 |
| 1104 |
| 1105 /** Response from a List Jobs request. */ |
| 1106 class JobListResponse { |
| 1107 /** Jobs in the collection. */ |
| 1108 core.List<Job> items; |
| 1109 |
| 1110 /** Identifies this object as a list of jobs. */ |
| 1111 core.String kind; |
| 1112 |
| 1113 /** A token to provide to get the next page of results. */ |
| 1114 core.String nextPageToken; |
| 1115 |
| 1116 |
| 1117 JobListResponse(); |
| 1118 |
| 1119 JobListResponse.fromJson(core.Map _json) { |
| 1120 if (_json.containsKey("items")) { |
| 1121 items = _json["items"].map((value) => new Job.fromJson(value)).toList(); |
| 1122 } |
| 1123 if (_json.containsKey("kind")) { |
| 1124 kind = _json["kind"]; |
| 1125 } |
| 1126 if (_json.containsKey("nextPageToken")) { |
| 1127 nextPageToken = _json["nextPageToken"]; |
| 1128 } |
| 1129 } |
| 1130 |
| 1131 core.Map toJson() { |
| 1132 var _json = new core.Map(); |
| 1133 if (items != null) { |
| 1134 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 1135 } |
| 1136 if (kind != null) { |
| 1137 _json["kind"] = kind; |
| 1138 } |
| 1139 if (nextPageToken != null) { |
| 1140 _json["nextPageToken"] = nextPageToken; |
| 1141 } |
| 1142 return _json; |
| 1143 } |
| 1144 } |
| 1145 |
| 1146 |
| 1147 /** Current state of a job. */ |
| 1148 class JobState { |
| 1149 /** Email address of the assignee. */ |
| 1150 core.String assignee; |
| 1151 |
| 1152 /** Custom fields. */ |
| 1153 CustomFields customFields; |
| 1154 |
| 1155 /** Customer name. */ |
| 1156 core.String customerName; |
| 1157 |
| 1158 /** Customer phone number. */ |
| 1159 core.String customerPhoneNumber; |
| 1160 |
| 1161 /** Identifies this object as a job state. */ |
| 1162 core.String kind; |
| 1163 |
| 1164 /** Job location. */ |
| 1165 Location location; |
| 1166 |
| 1167 /** Note added to the job. */ |
| 1168 core.List<core.String> note; |
| 1169 |
| 1170 /** Job progress. */ |
| 1171 core.String progress; |
| 1172 |
| 1173 /** Job title. */ |
| 1174 core.String title; |
| 1175 |
| 1176 |
| 1177 JobState(); |
| 1178 |
| 1179 JobState.fromJson(core.Map _json) { |
| 1180 if (_json.containsKey("assignee")) { |
| 1181 assignee = _json["assignee"]; |
| 1182 } |
| 1183 if (_json.containsKey("customFields")) { |
| 1184 customFields = new CustomFields.fromJson(_json["customFields"]); |
| 1185 } |
| 1186 if (_json.containsKey("customerName")) { |
| 1187 customerName = _json["customerName"]; |
| 1188 } |
| 1189 if (_json.containsKey("customerPhoneNumber")) { |
| 1190 customerPhoneNumber = _json["customerPhoneNumber"]; |
| 1191 } |
| 1192 if (_json.containsKey("kind")) { |
| 1193 kind = _json["kind"]; |
| 1194 } |
| 1195 if (_json.containsKey("location")) { |
| 1196 location = new Location.fromJson(_json["location"]); |
| 1197 } |
| 1198 if (_json.containsKey("note")) { |
| 1199 note = _json["note"]; |
| 1200 } |
| 1201 if (_json.containsKey("progress")) { |
| 1202 progress = _json["progress"]; |
| 1203 } |
| 1204 if (_json.containsKey("title")) { |
| 1205 title = _json["title"]; |
| 1206 } |
| 1207 } |
| 1208 |
| 1209 core.Map toJson() { |
| 1210 var _json = new core.Map(); |
| 1211 if (assignee != null) { |
| 1212 _json["assignee"] = assignee; |
| 1213 } |
| 1214 if (customFields != null) { |
| 1215 _json["customFields"] = (customFields).toJson(); |
| 1216 } |
| 1217 if (customerName != null) { |
| 1218 _json["customerName"] = customerName; |
| 1219 } |
| 1220 if (customerPhoneNumber != null) { |
| 1221 _json["customerPhoneNumber"] = customerPhoneNumber; |
| 1222 } |
| 1223 if (kind != null) { |
| 1224 _json["kind"] = kind; |
| 1225 } |
| 1226 if (location != null) { |
| 1227 _json["location"] = (location).toJson(); |
| 1228 } |
| 1229 if (note != null) { |
| 1230 _json["note"] = note; |
| 1231 } |
| 1232 if (progress != null) { |
| 1233 _json["progress"] = progress; |
| 1234 } |
| 1235 if (title != null) { |
| 1236 _json["title"] = title; |
| 1237 } |
| 1238 return _json; |
| 1239 } |
| 1240 } |
| 1241 |
| 1242 |
| 1243 /** Location of a job. */ |
| 1244 class Location { |
| 1245 /** Address. */ |
| 1246 core.List<core.String> addressLine; |
| 1247 |
| 1248 /** Identifies this object as a location. */ |
| 1249 core.String kind; |
| 1250 |
| 1251 /** Latitude. */ |
| 1252 core.double lat; |
| 1253 |
| 1254 /** Longitude. */ |
| 1255 core.double lng; |
| 1256 |
| 1257 |
| 1258 Location(); |
| 1259 |
| 1260 Location.fromJson(core.Map _json) { |
| 1261 if (_json.containsKey("addressLine")) { |
| 1262 addressLine = _json["addressLine"]; |
| 1263 } |
| 1264 if (_json.containsKey("kind")) { |
| 1265 kind = _json["kind"]; |
| 1266 } |
| 1267 if (_json.containsKey("lat")) { |
| 1268 lat = _json["lat"]; |
| 1269 } |
| 1270 if (_json.containsKey("lng")) { |
| 1271 lng = _json["lng"]; |
| 1272 } |
| 1273 } |
| 1274 |
| 1275 core.Map toJson() { |
| 1276 var _json = new core.Map(); |
| 1277 if (addressLine != null) { |
| 1278 _json["addressLine"] = addressLine; |
| 1279 } |
| 1280 if (kind != null) { |
| 1281 _json["kind"] = kind; |
| 1282 } |
| 1283 if (lat != null) { |
| 1284 _json["lat"] = lat; |
| 1285 } |
| 1286 if (lng != null) { |
| 1287 _json["lng"] = lng; |
| 1288 } |
| 1289 return _json; |
| 1290 } |
| 1291 } |
| 1292 |
| 1293 |
| 1294 /** Response from a List Locations request. */ |
| 1295 class LocationListResponse { |
| 1296 /** Locations in the collection. */ |
| 1297 core.List<LocationRecord> items; |
| 1298 |
| 1299 /** Identifies this object as a list of locations. */ |
| 1300 core.String kind; |
| 1301 |
| 1302 /** A token to provide to get the next page of results. */ |
| 1303 core.String nextPageToken; |
| 1304 |
| 1305 /** Pagination information for token pagination. */ |
| 1306 TokenPagination tokenPagination; |
| 1307 |
| 1308 |
| 1309 LocationListResponse(); |
| 1310 |
| 1311 LocationListResponse.fromJson(core.Map _json) { |
| 1312 if (_json.containsKey("items")) { |
| 1313 items = _json["items"].map((value) => new LocationRecord.fromJson(value)).
toList(); |
| 1314 } |
| 1315 if (_json.containsKey("kind")) { |
| 1316 kind = _json["kind"]; |
| 1317 } |
| 1318 if (_json.containsKey("nextPageToken")) { |
| 1319 nextPageToken = _json["nextPageToken"]; |
| 1320 } |
| 1321 if (_json.containsKey("tokenPagination")) { |
| 1322 tokenPagination = new TokenPagination.fromJson(_json["tokenPagination"]); |
| 1323 } |
| 1324 } |
| 1325 |
| 1326 core.Map toJson() { |
| 1327 var _json = new core.Map(); |
| 1328 if (items != null) { |
| 1329 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 1330 } |
| 1331 if (kind != null) { |
| 1332 _json["kind"] = kind; |
| 1333 } |
| 1334 if (nextPageToken != null) { |
| 1335 _json["nextPageToken"] = nextPageToken; |
| 1336 } |
| 1337 if (tokenPagination != null) { |
| 1338 _json["tokenPagination"] = (tokenPagination).toJson(); |
| 1339 } |
| 1340 return _json; |
| 1341 } |
| 1342 } |
| 1343 |
| 1344 |
| 1345 /** Recorded location of a worker. */ |
| 1346 class LocationRecord { |
| 1347 /** The collection time in milliseconds since the epoch. */ |
| 1348 core.String collectionTime; |
| 1349 |
| 1350 /** |
| 1351 * The location accuracy in meters. This is the radius of a 95% confidence |
| 1352 * interval around the location measurement. |
| 1353 */ |
| 1354 core.double confidenceRadius; |
| 1355 |
| 1356 /** Identifies this object as a location. */ |
| 1357 core.String kind; |
| 1358 |
| 1359 /** Latitude. */ |
| 1360 core.double latitude; |
| 1361 |
| 1362 /** Longitude. */ |
| 1363 core.double longitude; |
| 1364 |
| 1365 |
| 1366 LocationRecord(); |
| 1367 |
| 1368 LocationRecord.fromJson(core.Map _json) { |
| 1369 if (_json.containsKey("collectionTime")) { |
| 1370 collectionTime = _json["collectionTime"]; |
| 1371 } |
| 1372 if (_json.containsKey("confidenceRadius")) { |
| 1373 confidenceRadius = _json["confidenceRadius"]; |
| 1374 } |
| 1375 if (_json.containsKey("kind")) { |
| 1376 kind = _json["kind"]; |
| 1377 } |
| 1378 if (_json.containsKey("latitude")) { |
| 1379 latitude = _json["latitude"]; |
| 1380 } |
| 1381 if (_json.containsKey("longitude")) { |
| 1382 longitude = _json["longitude"]; |
| 1383 } |
| 1384 } |
| 1385 |
| 1386 core.Map toJson() { |
| 1387 var _json = new core.Map(); |
| 1388 if (collectionTime != null) { |
| 1389 _json["collectionTime"] = collectionTime; |
| 1390 } |
| 1391 if (confidenceRadius != null) { |
| 1392 _json["confidenceRadius"] = confidenceRadius; |
| 1393 } |
| 1394 if (kind != null) { |
| 1395 _json["kind"] = kind; |
| 1396 } |
| 1397 if (latitude != null) { |
| 1398 _json["latitude"] = latitude; |
| 1399 } |
| 1400 if (longitude != null) { |
| 1401 _json["longitude"] = longitude; |
| 1402 } |
| 1403 return _json; |
| 1404 } |
| 1405 } |
| 1406 |
| 1407 |
| 1408 /** Job schedule. */ |
| 1409 class Schedule { |
| 1410 /** |
| 1411 * Whether the job is scheduled for the whole day. Time of day in start/end |
| 1412 * times is ignored if this is true. |
| 1413 */ |
| 1414 core.bool allDay; |
| 1415 |
| 1416 /** Job duration in milliseconds. */ |
| 1417 core.String duration; |
| 1418 |
| 1419 /** Scheduled end time in milliseconds since epoch. */ |
| 1420 core.String endTime; |
| 1421 |
| 1422 /** Identifies this object as a job schedule. */ |
| 1423 core.String kind; |
| 1424 |
| 1425 /** Scheduled start time in milliseconds since epoch. */ |
| 1426 core.String startTime; |
| 1427 |
| 1428 |
| 1429 Schedule(); |
| 1430 |
| 1431 Schedule.fromJson(core.Map _json) { |
| 1432 if (_json.containsKey("allDay")) { |
| 1433 allDay = _json["allDay"]; |
| 1434 } |
| 1435 if (_json.containsKey("duration")) { |
| 1436 duration = _json["duration"]; |
| 1437 } |
| 1438 if (_json.containsKey("endTime")) { |
| 1439 endTime = _json["endTime"]; |
| 1440 } |
| 1441 if (_json.containsKey("kind")) { |
| 1442 kind = _json["kind"]; |
| 1443 } |
| 1444 if (_json.containsKey("startTime")) { |
| 1445 startTime = _json["startTime"]; |
| 1446 } |
| 1447 } |
| 1448 |
| 1449 core.Map toJson() { |
| 1450 var _json = new core.Map(); |
| 1451 if (allDay != null) { |
| 1452 _json["allDay"] = allDay; |
| 1453 } |
| 1454 if (duration != null) { |
| 1455 _json["duration"] = duration; |
| 1456 } |
| 1457 if (endTime != null) { |
| 1458 _json["endTime"] = endTime; |
| 1459 } |
| 1460 if (kind != null) { |
| 1461 _json["kind"] = kind; |
| 1462 } |
| 1463 if (startTime != null) { |
| 1464 _json["startTime"] = startTime; |
| 1465 } |
| 1466 return _json; |
| 1467 } |
| 1468 } |
| 1469 |
| 1470 |
| 1471 /** Pagination information. */ |
| 1472 class TokenPagination { |
| 1473 /** Identifies this object as pagination information. */ |
| 1474 core.String kind; |
| 1475 |
| 1476 /** A token to provide to get the next page of results. */ |
| 1477 core.String nextPageToken; |
| 1478 |
| 1479 /** A token to provide to get the previous page of results. */ |
| 1480 core.String previousPageToken; |
| 1481 |
| 1482 |
| 1483 TokenPagination(); |
| 1484 |
| 1485 TokenPagination.fromJson(core.Map _json) { |
| 1486 if (_json.containsKey("kind")) { |
| 1487 kind = _json["kind"]; |
| 1488 } |
| 1489 if (_json.containsKey("nextPageToken")) { |
| 1490 nextPageToken = _json["nextPageToken"]; |
| 1491 } |
| 1492 if (_json.containsKey("previousPageToken")) { |
| 1493 previousPageToken = _json["previousPageToken"]; |
| 1494 } |
| 1495 } |
| 1496 |
| 1497 core.Map toJson() { |
| 1498 var _json = new core.Map(); |
| 1499 if (kind != null) { |
| 1500 _json["kind"] = kind; |
| 1501 } |
| 1502 if (nextPageToken != null) { |
| 1503 _json["nextPageToken"] = nextPageToken; |
| 1504 } |
| 1505 if (previousPageToken != null) { |
| 1506 _json["previousPageToken"] = previousPageToken; |
| 1507 } |
| 1508 return _json; |
| 1509 } |
| 1510 } |
| 1511 |
| 1512 |
| 1513 /** A worker in a Coordinate team. */ |
| 1514 class Worker { |
| 1515 /** Worker email address. */ |
| 1516 core.String id; |
| 1517 |
| 1518 /** Identifies this object as a worker. */ |
| 1519 core.String kind; |
| 1520 |
| 1521 |
| 1522 Worker(); |
| 1523 |
| 1524 Worker.fromJson(core.Map _json) { |
| 1525 if (_json.containsKey("id")) { |
| 1526 id = _json["id"]; |
| 1527 } |
| 1528 if (_json.containsKey("kind")) { |
| 1529 kind = _json["kind"]; |
| 1530 } |
| 1531 } |
| 1532 |
| 1533 core.Map toJson() { |
| 1534 var _json = new core.Map(); |
| 1535 if (id != null) { |
| 1536 _json["id"] = id; |
| 1537 } |
| 1538 if (kind != null) { |
| 1539 _json["kind"] = kind; |
| 1540 } |
| 1541 return _json; |
| 1542 } |
| 1543 } |
| 1544 |
| 1545 |
| 1546 /** Response from a List Workers request. */ |
| 1547 class WorkerListResponse { |
| 1548 /** Workers in the collection. */ |
| 1549 core.List<Worker> items; |
| 1550 |
| 1551 /** Identifies this object as a list of workers. */ |
| 1552 core.String kind; |
| 1553 |
| 1554 |
| 1555 WorkerListResponse(); |
| 1556 |
| 1557 WorkerListResponse.fromJson(core.Map _json) { |
| 1558 if (_json.containsKey("items")) { |
| 1559 items = _json["items"].map((value) => new Worker.fromJson(value)).toList()
; |
| 1560 } |
| 1561 if (_json.containsKey("kind")) { |
| 1562 kind = _json["kind"]; |
| 1563 } |
| 1564 } |
| 1565 |
| 1566 core.Map toJson() { |
| 1567 var _json = new core.Map(); |
| 1568 if (items != null) { |
| 1569 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 1570 } |
| 1571 if (kind != null) { |
| 1572 _json["kind"] = kind; |
| 1573 } |
| 1574 return _json; |
| 1575 } |
| 1576 } |
| 1577 |
| 1578 |
OLD | NEW |