OLD | NEW |
(Empty) | |
| 1 library googleapis.fusiontables.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 /** API for working with Fusion Tables data. */ |
| 17 class FusiontablesApi { |
| 18 /** Manage your Fusion Tables */ |
| 19 static const FusiontablesScope = "https://www.googleapis.com/auth/fusiontables
"; |
| 20 |
| 21 /** View your Fusion Tables */ |
| 22 static const FusiontablesReadonlyScope = "https://www.googleapis.com/auth/fusi
ontables.readonly"; |
| 23 |
| 24 |
| 25 final common_internal.ApiRequester _requester; |
| 26 |
| 27 ColumnResourceApi get column => new ColumnResourceApi(_requester); |
| 28 QueryResourceApi get query => new QueryResourceApi(_requester); |
| 29 StyleResourceApi get style => new StyleResourceApi(_requester); |
| 30 TableResourceApi get table => new TableResourceApi(_requester); |
| 31 TaskResourceApi get task => new TaskResourceApi(_requester); |
| 32 TemplateResourceApi get template => new TemplateResourceApi(_requester); |
| 33 |
| 34 FusiontablesApi(http.Client client) : |
| 35 _requester = new common_internal.ApiRequester(client, "https://www.googlea
pis.com/", "/fusiontables/v1/"); |
| 36 } |
| 37 |
| 38 |
| 39 /** Not documented yet. */ |
| 40 class ColumnResourceApi { |
| 41 final common_internal.ApiRequester _requester; |
| 42 |
| 43 ColumnResourceApi(common_internal.ApiRequester client) : |
| 44 _requester = client; |
| 45 |
| 46 /** |
| 47 * Deletes the column. |
| 48 * |
| 49 * Request parameters: |
| 50 * |
| 51 * [tableId] - Table from which the column is being deleted. |
| 52 * |
| 53 * [columnId] - Name or identifier for the column being deleted. |
| 54 * |
| 55 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 56 * error. |
| 57 * |
| 58 * If the used [http.Client] completes with an error when making a REST call, |
| 59 * this method will complete with the same error. |
| 60 */ |
| 61 async.Future delete(core.String tableId, core.String columnId) { |
| 62 var _url = null; |
| 63 var _queryParams = new core.Map(); |
| 64 var _uploadMedia = null; |
| 65 var _uploadOptions = null; |
| 66 var _downloadOptions = common.DownloadOptions.Metadata; |
| 67 var _body = null; |
| 68 |
| 69 if (tableId == null) { |
| 70 throw new core.ArgumentError("Parameter tableId is required."); |
| 71 } |
| 72 if (columnId == null) { |
| 73 throw new core.ArgumentError("Parameter columnId is required."); |
| 74 } |
| 75 |
| 76 _downloadOptions = null; |
| 77 |
| 78 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/col
umns/' + common_internal.Escaper.ecapeVariable('$columnId'); |
| 79 |
| 80 var _response = _requester.request(_url, |
| 81 "DELETE", |
| 82 body: _body, |
| 83 queryParams: _queryParams, |
| 84 uploadOptions: _uploadOptions, |
| 85 uploadMedia: _uploadMedia, |
| 86 downloadOptions: _downloadOptions); |
| 87 return _response.then((data) => null); |
| 88 } |
| 89 |
| 90 /** |
| 91 * Retrieves a specific column by its id. |
| 92 * |
| 93 * Request parameters: |
| 94 * |
| 95 * [tableId] - Table to which the column belongs. |
| 96 * |
| 97 * [columnId] - Name or identifier for the column that is being requested. |
| 98 * |
| 99 * Completes with a [Column]. |
| 100 * |
| 101 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 102 * error. |
| 103 * |
| 104 * If the used [http.Client] completes with an error when making a REST call, |
| 105 * this method will complete with the same error. |
| 106 */ |
| 107 async.Future<Column> get(core.String tableId, core.String columnId) { |
| 108 var _url = null; |
| 109 var _queryParams = new core.Map(); |
| 110 var _uploadMedia = null; |
| 111 var _uploadOptions = null; |
| 112 var _downloadOptions = common.DownloadOptions.Metadata; |
| 113 var _body = null; |
| 114 |
| 115 if (tableId == null) { |
| 116 throw new core.ArgumentError("Parameter tableId is required."); |
| 117 } |
| 118 if (columnId == null) { |
| 119 throw new core.ArgumentError("Parameter columnId is required."); |
| 120 } |
| 121 |
| 122 |
| 123 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/col
umns/' + common_internal.Escaper.ecapeVariable('$columnId'); |
| 124 |
| 125 var _response = _requester.request(_url, |
| 126 "GET", |
| 127 body: _body, |
| 128 queryParams: _queryParams, |
| 129 uploadOptions: _uploadOptions, |
| 130 uploadMedia: _uploadMedia, |
| 131 downloadOptions: _downloadOptions); |
| 132 return _response.then((data) => new Column.fromJson(data)); |
| 133 } |
| 134 |
| 135 /** |
| 136 * Adds a new column to the table. |
| 137 * |
| 138 * [request] - The metadata request object. |
| 139 * |
| 140 * Request parameters: |
| 141 * |
| 142 * [tableId] - Table for which a new column is being added. |
| 143 * |
| 144 * Completes with a [Column]. |
| 145 * |
| 146 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 147 * error. |
| 148 * |
| 149 * If the used [http.Client] completes with an error when making a REST call, |
| 150 * this method will complete with the same error. |
| 151 */ |
| 152 async.Future<Column> insert(Column request, core.String tableId) { |
| 153 var _url = null; |
| 154 var _queryParams = new core.Map(); |
| 155 var _uploadMedia = null; |
| 156 var _uploadOptions = null; |
| 157 var _downloadOptions = common.DownloadOptions.Metadata; |
| 158 var _body = null; |
| 159 |
| 160 if (request != null) { |
| 161 _body = convert.JSON.encode((request).toJson()); |
| 162 } |
| 163 if (tableId == null) { |
| 164 throw new core.ArgumentError("Parameter tableId is required."); |
| 165 } |
| 166 |
| 167 |
| 168 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/col
umns'; |
| 169 |
| 170 var _response = _requester.request(_url, |
| 171 "POST", |
| 172 body: _body, |
| 173 queryParams: _queryParams, |
| 174 uploadOptions: _uploadOptions, |
| 175 uploadMedia: _uploadMedia, |
| 176 downloadOptions: _downloadOptions); |
| 177 return _response.then((data) => new Column.fromJson(data)); |
| 178 } |
| 179 |
| 180 /** |
| 181 * Retrieves a list of columns. |
| 182 * |
| 183 * Request parameters: |
| 184 * |
| 185 * [tableId] - Table whose columns are being listed. |
| 186 * |
| 187 * [maxResults] - Maximum number of columns to return. Optional. Default is 5. |
| 188 * |
| 189 * [pageToken] - Continuation token specifying which result page to return. |
| 190 * Optional. |
| 191 * |
| 192 * Completes with a [ColumnList]. |
| 193 * |
| 194 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 195 * error. |
| 196 * |
| 197 * If the used [http.Client] completes with an error when making a REST call, |
| 198 * this method will complete with the same error. |
| 199 */ |
| 200 async.Future<ColumnList> list(core.String tableId, {core.int maxResults, core.
String pageToken}) { |
| 201 var _url = null; |
| 202 var _queryParams = new core.Map(); |
| 203 var _uploadMedia = null; |
| 204 var _uploadOptions = null; |
| 205 var _downloadOptions = common.DownloadOptions.Metadata; |
| 206 var _body = null; |
| 207 |
| 208 if (tableId == null) { |
| 209 throw new core.ArgumentError("Parameter tableId is required."); |
| 210 } |
| 211 if (maxResults != null) { |
| 212 _queryParams["maxResults"] = ["${maxResults}"]; |
| 213 } |
| 214 if (pageToken != null) { |
| 215 _queryParams["pageToken"] = [pageToken]; |
| 216 } |
| 217 |
| 218 |
| 219 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/col
umns'; |
| 220 |
| 221 var _response = _requester.request(_url, |
| 222 "GET", |
| 223 body: _body, |
| 224 queryParams: _queryParams, |
| 225 uploadOptions: _uploadOptions, |
| 226 uploadMedia: _uploadMedia, |
| 227 downloadOptions: _downloadOptions); |
| 228 return _response.then((data) => new ColumnList.fromJson(data)); |
| 229 } |
| 230 |
| 231 /** |
| 232 * Updates the name or type of an existing column. This method supports patch |
| 233 * semantics. |
| 234 * |
| 235 * [request] - The metadata request object. |
| 236 * |
| 237 * Request parameters: |
| 238 * |
| 239 * [tableId] - Table for which the column is being updated. |
| 240 * |
| 241 * [columnId] - Name or identifier for the column that is being updated. |
| 242 * |
| 243 * Completes with a [Column]. |
| 244 * |
| 245 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 246 * error. |
| 247 * |
| 248 * If the used [http.Client] completes with an error when making a REST call, |
| 249 * this method will complete with the same error. |
| 250 */ |
| 251 async.Future<Column> patch(Column request, core.String tableId, core.String co
lumnId) { |
| 252 var _url = null; |
| 253 var _queryParams = new core.Map(); |
| 254 var _uploadMedia = null; |
| 255 var _uploadOptions = null; |
| 256 var _downloadOptions = common.DownloadOptions.Metadata; |
| 257 var _body = null; |
| 258 |
| 259 if (request != null) { |
| 260 _body = convert.JSON.encode((request).toJson()); |
| 261 } |
| 262 if (tableId == null) { |
| 263 throw new core.ArgumentError("Parameter tableId is required."); |
| 264 } |
| 265 if (columnId == null) { |
| 266 throw new core.ArgumentError("Parameter columnId is required."); |
| 267 } |
| 268 |
| 269 |
| 270 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/col
umns/' + common_internal.Escaper.ecapeVariable('$columnId'); |
| 271 |
| 272 var _response = _requester.request(_url, |
| 273 "PATCH", |
| 274 body: _body, |
| 275 queryParams: _queryParams, |
| 276 uploadOptions: _uploadOptions, |
| 277 uploadMedia: _uploadMedia, |
| 278 downloadOptions: _downloadOptions); |
| 279 return _response.then((data) => new Column.fromJson(data)); |
| 280 } |
| 281 |
| 282 /** |
| 283 * Updates the name or type of an existing column. |
| 284 * |
| 285 * [request] - The metadata request object. |
| 286 * |
| 287 * Request parameters: |
| 288 * |
| 289 * [tableId] - Table for which the column is being updated. |
| 290 * |
| 291 * [columnId] - Name or identifier for the column that is being updated. |
| 292 * |
| 293 * Completes with a [Column]. |
| 294 * |
| 295 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 296 * error. |
| 297 * |
| 298 * If the used [http.Client] completes with an error when making a REST call, |
| 299 * this method will complete with the same error. |
| 300 */ |
| 301 async.Future<Column> update(Column request, core.String tableId, core.String c
olumnId) { |
| 302 var _url = null; |
| 303 var _queryParams = new core.Map(); |
| 304 var _uploadMedia = null; |
| 305 var _uploadOptions = null; |
| 306 var _downloadOptions = common.DownloadOptions.Metadata; |
| 307 var _body = null; |
| 308 |
| 309 if (request != null) { |
| 310 _body = convert.JSON.encode((request).toJson()); |
| 311 } |
| 312 if (tableId == null) { |
| 313 throw new core.ArgumentError("Parameter tableId is required."); |
| 314 } |
| 315 if (columnId == null) { |
| 316 throw new core.ArgumentError("Parameter columnId is required."); |
| 317 } |
| 318 |
| 319 |
| 320 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/col
umns/' + common_internal.Escaper.ecapeVariable('$columnId'); |
| 321 |
| 322 var _response = _requester.request(_url, |
| 323 "PUT", |
| 324 body: _body, |
| 325 queryParams: _queryParams, |
| 326 uploadOptions: _uploadOptions, |
| 327 uploadMedia: _uploadMedia, |
| 328 downloadOptions: _downloadOptions); |
| 329 return _response.then((data) => new Column.fromJson(data)); |
| 330 } |
| 331 |
| 332 } |
| 333 |
| 334 |
| 335 /** Not documented yet. */ |
| 336 class QueryResourceApi { |
| 337 final common_internal.ApiRequester _requester; |
| 338 |
| 339 QueryResourceApi(common_internal.ApiRequester client) : |
| 340 _requester = client; |
| 341 |
| 342 /** |
| 343 * Executes an SQL SELECT/INSERT/UPDATE/DELETE/SHOW/DESCRIBE/CREATE statement. |
| 344 * |
| 345 * Request parameters: |
| 346 * |
| 347 * [sql_1] - An SQL SELECT/SHOW/DESCRIBE/INSERT/UPDATE/DELETE/CREATE |
| 348 * statement. |
| 349 * |
| 350 * [hdrs] - Should column names be included (in the first row)?. Default is |
| 351 * true. |
| 352 * |
| 353 * [typed] - Should typed values be returned in the (JSON) response -- numbers |
| 354 * for numeric values and parsed geometries for KML values? Default is true. |
| 355 * |
| 356 * [downloadOptions] - Options for downloading. A download can be either a |
| 357 * Metadata (default) or Media download. Partial Media downloads are possible |
| 358 * as well. |
| 359 * |
| 360 * Completes with a |
| 361 * |
| 362 * - [Sqlresponse] for Metadata downloads (see [downloadOptions]). |
| 363 * |
| 364 * - [common.Media] for Media downloads (see [downloadOptions]). |
| 365 * |
| 366 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 367 * error. |
| 368 * |
| 369 * If the used [http.Client] completes with an error when making a REST call, |
| 370 * this method will complete with the same error. |
| 371 */ |
| 372 async.Future sql(core.String sql_1, {core.bool hdrs, core.bool typed, common.D
ownloadOptions downloadOptions: common.DownloadOptions.Metadata}) { |
| 373 var _url = null; |
| 374 var _queryParams = new core.Map(); |
| 375 var _uploadMedia = null; |
| 376 var _uploadOptions = null; |
| 377 var _downloadOptions = common.DownloadOptions.Metadata; |
| 378 var _body = null; |
| 379 |
| 380 if (sql_1 == null) { |
| 381 throw new core.ArgumentError("Parameter sql_1 is required."); |
| 382 } |
| 383 _queryParams["sql"] = [sql_1]; |
| 384 if (hdrs != null) { |
| 385 _queryParams["hdrs"] = ["${hdrs}"]; |
| 386 } |
| 387 if (typed != null) { |
| 388 _queryParams["typed"] = ["${typed}"]; |
| 389 } |
| 390 |
| 391 _downloadOptions = downloadOptions; |
| 392 |
| 393 _url = 'query'; |
| 394 |
| 395 var _response = _requester.request(_url, |
| 396 "POST", |
| 397 body: _body, |
| 398 queryParams: _queryParams, |
| 399 uploadOptions: _uploadOptions, |
| 400 uploadMedia: _uploadMedia, |
| 401 downloadOptions: _downloadOptions); |
| 402 if (_downloadOptions == null || |
| 403 _downloadOptions == common.DownloadOptions.Metadata) { |
| 404 return _response.then((data) => new Sqlresponse.fromJson(data)); |
| 405 } else { |
| 406 return _response; |
| 407 } |
| 408 } |
| 409 |
| 410 /** |
| 411 * Executes an SQL SELECT/SHOW/DESCRIBE statement. |
| 412 * |
| 413 * Request parameters: |
| 414 * |
| 415 * [sql_1] - An SQL SELECT/SHOW/DESCRIBE statement. |
| 416 * |
| 417 * [hdrs] - Should column names be included (in the first row)?. Default is |
| 418 * true. |
| 419 * |
| 420 * [typed] - Should typed values be returned in the (JSON) response -- numbers |
| 421 * for numeric values and parsed geometries for KML values? Default is true. |
| 422 * |
| 423 * [downloadOptions] - Options for downloading. A download can be either a |
| 424 * Metadata (default) or Media download. Partial Media downloads are possible |
| 425 * as well. |
| 426 * |
| 427 * Completes with a |
| 428 * |
| 429 * - [Sqlresponse] for Metadata downloads (see [downloadOptions]). |
| 430 * |
| 431 * - [common.Media] for Media downloads (see [downloadOptions]). |
| 432 * |
| 433 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 434 * error. |
| 435 * |
| 436 * If the used [http.Client] completes with an error when making a REST call, |
| 437 * this method will complete with the same error. |
| 438 */ |
| 439 async.Future sqlGet(core.String sql_1, {core.bool hdrs, core.bool typed, commo
n.DownloadOptions downloadOptions: common.DownloadOptions.Metadata}) { |
| 440 var _url = null; |
| 441 var _queryParams = new core.Map(); |
| 442 var _uploadMedia = null; |
| 443 var _uploadOptions = null; |
| 444 var _downloadOptions = common.DownloadOptions.Metadata; |
| 445 var _body = null; |
| 446 |
| 447 if (sql_1 == null) { |
| 448 throw new core.ArgumentError("Parameter sql_1 is required."); |
| 449 } |
| 450 _queryParams["sql"] = [sql_1]; |
| 451 if (hdrs != null) { |
| 452 _queryParams["hdrs"] = ["${hdrs}"]; |
| 453 } |
| 454 if (typed != null) { |
| 455 _queryParams["typed"] = ["${typed}"]; |
| 456 } |
| 457 |
| 458 _downloadOptions = downloadOptions; |
| 459 |
| 460 _url = 'query'; |
| 461 |
| 462 var _response = _requester.request(_url, |
| 463 "GET", |
| 464 body: _body, |
| 465 queryParams: _queryParams, |
| 466 uploadOptions: _uploadOptions, |
| 467 uploadMedia: _uploadMedia, |
| 468 downloadOptions: _downloadOptions); |
| 469 if (_downloadOptions == null || |
| 470 _downloadOptions == common.DownloadOptions.Metadata) { |
| 471 return _response.then((data) => new Sqlresponse.fromJson(data)); |
| 472 } else { |
| 473 return _response; |
| 474 } |
| 475 } |
| 476 |
| 477 } |
| 478 |
| 479 |
| 480 /** Not documented yet. */ |
| 481 class StyleResourceApi { |
| 482 final common_internal.ApiRequester _requester; |
| 483 |
| 484 StyleResourceApi(common_internal.ApiRequester client) : |
| 485 _requester = client; |
| 486 |
| 487 /** |
| 488 * Deletes a style. |
| 489 * |
| 490 * Request parameters: |
| 491 * |
| 492 * [tableId] - Table from which the style is being deleted |
| 493 * |
| 494 * [styleId] - Identifier (within a table) for the style being deleted |
| 495 * |
| 496 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 497 * error. |
| 498 * |
| 499 * If the used [http.Client] completes with an error when making a REST call, |
| 500 * this method will complete with the same error. |
| 501 */ |
| 502 async.Future delete(core.String tableId, core.int styleId) { |
| 503 var _url = null; |
| 504 var _queryParams = new core.Map(); |
| 505 var _uploadMedia = null; |
| 506 var _uploadOptions = null; |
| 507 var _downloadOptions = common.DownloadOptions.Metadata; |
| 508 var _body = null; |
| 509 |
| 510 if (tableId == null) { |
| 511 throw new core.ArgumentError("Parameter tableId is required."); |
| 512 } |
| 513 if (styleId == null) { |
| 514 throw new core.ArgumentError("Parameter styleId is required."); |
| 515 } |
| 516 |
| 517 _downloadOptions = null; |
| 518 |
| 519 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/sty
les/' + common_internal.Escaper.ecapeVariable('$styleId'); |
| 520 |
| 521 var _response = _requester.request(_url, |
| 522 "DELETE", |
| 523 body: _body, |
| 524 queryParams: _queryParams, |
| 525 uploadOptions: _uploadOptions, |
| 526 uploadMedia: _uploadMedia, |
| 527 downloadOptions: _downloadOptions); |
| 528 return _response.then((data) => null); |
| 529 } |
| 530 |
| 531 /** |
| 532 * Gets a specific style. |
| 533 * |
| 534 * Request parameters: |
| 535 * |
| 536 * [tableId] - Table to which the requested style belongs |
| 537 * |
| 538 * [styleId] - Identifier (integer) for a specific style in a table |
| 539 * |
| 540 * Completes with a [StyleSetting]. |
| 541 * |
| 542 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 543 * error. |
| 544 * |
| 545 * If the used [http.Client] completes with an error when making a REST call, |
| 546 * this method will complete with the same error. |
| 547 */ |
| 548 async.Future<StyleSetting> get(core.String tableId, core.int styleId) { |
| 549 var _url = null; |
| 550 var _queryParams = new core.Map(); |
| 551 var _uploadMedia = null; |
| 552 var _uploadOptions = null; |
| 553 var _downloadOptions = common.DownloadOptions.Metadata; |
| 554 var _body = null; |
| 555 |
| 556 if (tableId == null) { |
| 557 throw new core.ArgumentError("Parameter tableId is required."); |
| 558 } |
| 559 if (styleId == null) { |
| 560 throw new core.ArgumentError("Parameter styleId is required."); |
| 561 } |
| 562 |
| 563 |
| 564 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/sty
les/' + common_internal.Escaper.ecapeVariable('$styleId'); |
| 565 |
| 566 var _response = _requester.request(_url, |
| 567 "GET", |
| 568 body: _body, |
| 569 queryParams: _queryParams, |
| 570 uploadOptions: _uploadOptions, |
| 571 uploadMedia: _uploadMedia, |
| 572 downloadOptions: _downloadOptions); |
| 573 return _response.then((data) => new StyleSetting.fromJson(data)); |
| 574 } |
| 575 |
| 576 /** |
| 577 * Adds a new style for the table. |
| 578 * |
| 579 * [request] - The metadata request object. |
| 580 * |
| 581 * Request parameters: |
| 582 * |
| 583 * [tableId] - Table for which a new style is being added |
| 584 * |
| 585 * Completes with a [StyleSetting]. |
| 586 * |
| 587 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 588 * error. |
| 589 * |
| 590 * If the used [http.Client] completes with an error when making a REST call, |
| 591 * this method will complete with the same error. |
| 592 */ |
| 593 async.Future<StyleSetting> insert(StyleSetting request, core.String tableId) { |
| 594 var _url = null; |
| 595 var _queryParams = new core.Map(); |
| 596 var _uploadMedia = null; |
| 597 var _uploadOptions = null; |
| 598 var _downloadOptions = common.DownloadOptions.Metadata; |
| 599 var _body = null; |
| 600 |
| 601 if (request != null) { |
| 602 _body = convert.JSON.encode((request).toJson()); |
| 603 } |
| 604 if (tableId == null) { |
| 605 throw new core.ArgumentError("Parameter tableId is required."); |
| 606 } |
| 607 |
| 608 |
| 609 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/sty
les'; |
| 610 |
| 611 var _response = _requester.request(_url, |
| 612 "POST", |
| 613 body: _body, |
| 614 queryParams: _queryParams, |
| 615 uploadOptions: _uploadOptions, |
| 616 uploadMedia: _uploadMedia, |
| 617 downloadOptions: _downloadOptions); |
| 618 return _response.then((data) => new StyleSetting.fromJson(data)); |
| 619 } |
| 620 |
| 621 /** |
| 622 * Retrieves a list of styles. |
| 623 * |
| 624 * Request parameters: |
| 625 * |
| 626 * [tableId] - Table whose styles are being listed |
| 627 * |
| 628 * [maxResults] - Maximum number of styles to return. Optional. Default is 5. |
| 629 * |
| 630 * [pageToken] - Continuation token specifying which result page to return. |
| 631 * Optional. |
| 632 * |
| 633 * Completes with a [StyleSettingList]. |
| 634 * |
| 635 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 636 * error. |
| 637 * |
| 638 * If the used [http.Client] completes with an error when making a REST call, |
| 639 * this method will complete with the same error. |
| 640 */ |
| 641 async.Future<StyleSettingList> list(core.String tableId, {core.int maxResults,
core.String pageToken}) { |
| 642 var _url = null; |
| 643 var _queryParams = new core.Map(); |
| 644 var _uploadMedia = null; |
| 645 var _uploadOptions = null; |
| 646 var _downloadOptions = common.DownloadOptions.Metadata; |
| 647 var _body = null; |
| 648 |
| 649 if (tableId == null) { |
| 650 throw new core.ArgumentError("Parameter tableId is required."); |
| 651 } |
| 652 if (maxResults != null) { |
| 653 _queryParams["maxResults"] = ["${maxResults}"]; |
| 654 } |
| 655 if (pageToken != null) { |
| 656 _queryParams["pageToken"] = [pageToken]; |
| 657 } |
| 658 |
| 659 |
| 660 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/sty
les'; |
| 661 |
| 662 var _response = _requester.request(_url, |
| 663 "GET", |
| 664 body: _body, |
| 665 queryParams: _queryParams, |
| 666 uploadOptions: _uploadOptions, |
| 667 uploadMedia: _uploadMedia, |
| 668 downloadOptions: _downloadOptions); |
| 669 return _response.then((data) => new StyleSettingList.fromJson(data)); |
| 670 } |
| 671 |
| 672 /** |
| 673 * Updates an existing style. This method supports patch semantics. |
| 674 * |
| 675 * [request] - The metadata request object. |
| 676 * |
| 677 * Request parameters: |
| 678 * |
| 679 * [tableId] - Table whose style is being updated. |
| 680 * |
| 681 * [styleId] - Identifier (within a table) for the style being updated. |
| 682 * |
| 683 * Completes with a [StyleSetting]. |
| 684 * |
| 685 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 686 * error. |
| 687 * |
| 688 * If the used [http.Client] completes with an error when making a REST call, |
| 689 * this method will complete with the same error. |
| 690 */ |
| 691 async.Future<StyleSetting> patch(StyleSetting request, core.String tableId, co
re.int styleId) { |
| 692 var _url = null; |
| 693 var _queryParams = new core.Map(); |
| 694 var _uploadMedia = null; |
| 695 var _uploadOptions = null; |
| 696 var _downloadOptions = common.DownloadOptions.Metadata; |
| 697 var _body = null; |
| 698 |
| 699 if (request != null) { |
| 700 _body = convert.JSON.encode((request).toJson()); |
| 701 } |
| 702 if (tableId == null) { |
| 703 throw new core.ArgumentError("Parameter tableId is required."); |
| 704 } |
| 705 if (styleId == null) { |
| 706 throw new core.ArgumentError("Parameter styleId is required."); |
| 707 } |
| 708 |
| 709 |
| 710 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/sty
les/' + common_internal.Escaper.ecapeVariable('$styleId'); |
| 711 |
| 712 var _response = _requester.request(_url, |
| 713 "PATCH", |
| 714 body: _body, |
| 715 queryParams: _queryParams, |
| 716 uploadOptions: _uploadOptions, |
| 717 uploadMedia: _uploadMedia, |
| 718 downloadOptions: _downloadOptions); |
| 719 return _response.then((data) => new StyleSetting.fromJson(data)); |
| 720 } |
| 721 |
| 722 /** |
| 723 * Updates an existing style. |
| 724 * |
| 725 * [request] - The metadata request object. |
| 726 * |
| 727 * Request parameters: |
| 728 * |
| 729 * [tableId] - Table whose style is being updated. |
| 730 * |
| 731 * [styleId] - Identifier (within a table) for the style being updated. |
| 732 * |
| 733 * Completes with a [StyleSetting]. |
| 734 * |
| 735 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 736 * error. |
| 737 * |
| 738 * If the used [http.Client] completes with an error when making a REST call, |
| 739 * this method will complete with the same error. |
| 740 */ |
| 741 async.Future<StyleSetting> update(StyleSetting request, core.String tableId, c
ore.int styleId) { |
| 742 var _url = null; |
| 743 var _queryParams = new core.Map(); |
| 744 var _uploadMedia = null; |
| 745 var _uploadOptions = null; |
| 746 var _downloadOptions = common.DownloadOptions.Metadata; |
| 747 var _body = null; |
| 748 |
| 749 if (request != null) { |
| 750 _body = convert.JSON.encode((request).toJson()); |
| 751 } |
| 752 if (tableId == null) { |
| 753 throw new core.ArgumentError("Parameter tableId is required."); |
| 754 } |
| 755 if (styleId == null) { |
| 756 throw new core.ArgumentError("Parameter styleId is required."); |
| 757 } |
| 758 |
| 759 |
| 760 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/sty
les/' + common_internal.Escaper.ecapeVariable('$styleId'); |
| 761 |
| 762 var _response = _requester.request(_url, |
| 763 "PUT", |
| 764 body: _body, |
| 765 queryParams: _queryParams, |
| 766 uploadOptions: _uploadOptions, |
| 767 uploadMedia: _uploadMedia, |
| 768 downloadOptions: _downloadOptions); |
| 769 return _response.then((data) => new StyleSetting.fromJson(data)); |
| 770 } |
| 771 |
| 772 } |
| 773 |
| 774 |
| 775 /** Not documented yet. */ |
| 776 class TableResourceApi { |
| 777 final common_internal.ApiRequester _requester; |
| 778 |
| 779 TableResourceApi(common_internal.ApiRequester client) : |
| 780 _requester = client; |
| 781 |
| 782 /** |
| 783 * Copies a table. |
| 784 * |
| 785 * Request parameters: |
| 786 * |
| 787 * [tableId] - ID of the table that is being copied. |
| 788 * |
| 789 * [copyPresentation] - Whether to also copy tabs, styles, and templates. |
| 790 * Default is false. |
| 791 * |
| 792 * Completes with a [Table]. |
| 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<Table> copy(core.String tableId, {core.bool copyPresentation}) { |
| 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 (tableId == null) { |
| 809 throw new core.ArgumentError("Parameter tableId is required."); |
| 810 } |
| 811 if (copyPresentation != null) { |
| 812 _queryParams["copyPresentation"] = ["${copyPresentation}"]; |
| 813 } |
| 814 |
| 815 |
| 816 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/cop
y'; |
| 817 |
| 818 var _response = _requester.request(_url, |
| 819 "POST", |
| 820 body: _body, |
| 821 queryParams: _queryParams, |
| 822 uploadOptions: _uploadOptions, |
| 823 uploadMedia: _uploadMedia, |
| 824 downloadOptions: _downloadOptions); |
| 825 return _response.then((data) => new Table.fromJson(data)); |
| 826 } |
| 827 |
| 828 /** |
| 829 * Deletes a table. |
| 830 * |
| 831 * Request parameters: |
| 832 * |
| 833 * [tableId] - ID of the table that is being deleted. |
| 834 * |
| 835 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 836 * error. |
| 837 * |
| 838 * If the used [http.Client] completes with an error when making a REST call, |
| 839 * this method will complete with the same error. |
| 840 */ |
| 841 async.Future delete(core.String tableId) { |
| 842 var _url = null; |
| 843 var _queryParams = new core.Map(); |
| 844 var _uploadMedia = null; |
| 845 var _uploadOptions = null; |
| 846 var _downloadOptions = common.DownloadOptions.Metadata; |
| 847 var _body = null; |
| 848 |
| 849 if (tableId == null) { |
| 850 throw new core.ArgumentError("Parameter tableId is required."); |
| 851 } |
| 852 |
| 853 _downloadOptions = null; |
| 854 |
| 855 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId'); |
| 856 |
| 857 var _response = _requester.request(_url, |
| 858 "DELETE", |
| 859 body: _body, |
| 860 queryParams: _queryParams, |
| 861 uploadOptions: _uploadOptions, |
| 862 uploadMedia: _uploadMedia, |
| 863 downloadOptions: _downloadOptions); |
| 864 return _response.then((data) => null); |
| 865 } |
| 866 |
| 867 /** |
| 868 * Retrieves a specific table by its id. |
| 869 * |
| 870 * Request parameters: |
| 871 * |
| 872 * [tableId] - Identifier(ID) for the table being requested. |
| 873 * |
| 874 * Completes with a [Table]. |
| 875 * |
| 876 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 877 * error. |
| 878 * |
| 879 * If the used [http.Client] completes with an error when making a REST call, |
| 880 * this method will complete with the same error. |
| 881 */ |
| 882 async.Future<Table> get(core.String tableId) { |
| 883 var _url = null; |
| 884 var _queryParams = new core.Map(); |
| 885 var _uploadMedia = null; |
| 886 var _uploadOptions = null; |
| 887 var _downloadOptions = common.DownloadOptions.Metadata; |
| 888 var _body = null; |
| 889 |
| 890 if (tableId == null) { |
| 891 throw new core.ArgumentError("Parameter tableId is required."); |
| 892 } |
| 893 |
| 894 |
| 895 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId'); |
| 896 |
| 897 var _response = _requester.request(_url, |
| 898 "GET", |
| 899 body: _body, |
| 900 queryParams: _queryParams, |
| 901 uploadOptions: _uploadOptions, |
| 902 uploadMedia: _uploadMedia, |
| 903 downloadOptions: _downloadOptions); |
| 904 return _response.then((data) => new Table.fromJson(data)); |
| 905 } |
| 906 |
| 907 /** |
| 908 * Import more rows into a table. |
| 909 * |
| 910 * Request parameters: |
| 911 * |
| 912 * [tableId] - The table into which new rows are being imported. |
| 913 * |
| 914 * [delimiter] - The delimiter used to separate cell values. This can only |
| 915 * consist of a single character. Default is ','. |
| 916 * |
| 917 * [encoding] - The encoding of the content. Default is UTF-8. Use |
| 918 * 'auto-detect' if you are unsure of the encoding. |
| 919 * |
| 920 * [endLine] - The index of the last line from which to start importing, |
| 921 * exclusive. Thus, the number of imported lines is endLine - startLine. If |
| 922 * this parameter is not provided, the file will be imported until the last |
| 923 * line of the file. If endLine is negative, then the imported content will |
| 924 * exclude the last endLine lines. That is, if endline is negative, no line |
| 925 * will be imported whose index is greater than N + endLine where N is the |
| 926 * number of lines in the file, and the number of imported lines will be N + |
| 927 * endLine - startLine. |
| 928 * |
| 929 * [isStrict] - Whether the CSV must have the same number of values for each |
| 930 * row. If false, rows with fewer values will be padded with empty values. |
| 931 * Default is true. |
| 932 * |
| 933 * [startLine] - The index of the first line from which to start importing, |
| 934 * inclusive. Default is 0. |
| 935 * |
| 936 * [uploadMedia] - The media to upload. |
| 937 * |
| 938 * [uploadOptions] - Options for the media upload. Streaming Media without the |
| 939 * length being known ahead of time is only supported via resumable uploads. |
| 940 * |
| 941 * Completes with a [Import]. |
| 942 * |
| 943 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 944 * error. |
| 945 * |
| 946 * If the used [http.Client] completes with an error when making a REST call, |
| 947 * this method will complete with the same error. |
| 948 */ |
| 949 async.Future<Import> importRows(core.String tableId, {core.String delimiter, c
ore.String encoding, core.int endLine, core.bool isStrict, core.int startLine, c
ommon.UploadOptions uploadOptions : common.UploadOptions.Default, common.Media u
ploadMedia}) { |
| 950 var _url = null; |
| 951 var _queryParams = new core.Map(); |
| 952 var _uploadMedia = null; |
| 953 var _uploadOptions = null; |
| 954 var _downloadOptions = common.DownloadOptions.Metadata; |
| 955 var _body = null; |
| 956 |
| 957 if (tableId == null) { |
| 958 throw new core.ArgumentError("Parameter tableId is required."); |
| 959 } |
| 960 if (delimiter != null) { |
| 961 _queryParams["delimiter"] = [delimiter]; |
| 962 } |
| 963 if (encoding != null) { |
| 964 _queryParams["encoding"] = [encoding]; |
| 965 } |
| 966 if (endLine != null) { |
| 967 _queryParams["endLine"] = ["${endLine}"]; |
| 968 } |
| 969 if (isStrict != null) { |
| 970 _queryParams["isStrict"] = ["${isStrict}"]; |
| 971 } |
| 972 if (startLine != null) { |
| 973 _queryParams["startLine"] = ["${startLine}"]; |
| 974 } |
| 975 |
| 976 _uploadMedia = uploadMedia; |
| 977 _uploadOptions = uploadOptions; |
| 978 |
| 979 if (_uploadMedia == null) { |
| 980 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/i
mport'; |
| 981 } else if (_uploadOptions is common.ResumableUploadOptions) { |
| 982 _url = '/resumable/upload/fusiontables/v1/tables/' + common_internal.Escap
er.ecapeVariable('$tableId') + '/import'; |
| 983 } else { |
| 984 _url = '/upload/fusiontables/v1/tables/' + common_internal.Escaper.ecapeVa
riable('$tableId') + '/import'; |
| 985 } |
| 986 |
| 987 |
| 988 var _response = _requester.request(_url, |
| 989 "POST", |
| 990 body: _body, |
| 991 queryParams: _queryParams, |
| 992 uploadOptions: _uploadOptions, |
| 993 uploadMedia: _uploadMedia, |
| 994 downloadOptions: _downloadOptions); |
| 995 return _response.then((data) => new Import.fromJson(data)); |
| 996 } |
| 997 |
| 998 /** |
| 999 * Import a new table. |
| 1000 * |
| 1001 * Request parameters: |
| 1002 * |
| 1003 * [name] - The name to be assigned to the new table. |
| 1004 * |
| 1005 * [delimiter] - The delimiter used to separate cell values. This can only |
| 1006 * consist of a single character. Default is ','. |
| 1007 * |
| 1008 * [encoding] - The encoding of the content. Default is UTF-8. Use |
| 1009 * 'auto-detect' if you are unsure of the encoding. |
| 1010 * |
| 1011 * [uploadMedia] - The media to upload. |
| 1012 * |
| 1013 * [uploadOptions] - Options for the media upload. Streaming Media without the |
| 1014 * length being known ahead of time is only supported via resumable uploads. |
| 1015 * |
| 1016 * Completes with a [Table]. |
| 1017 * |
| 1018 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1019 * error. |
| 1020 * |
| 1021 * If the used [http.Client] completes with an error when making a REST call, |
| 1022 * this method will complete with the same error. |
| 1023 */ |
| 1024 async.Future<Table> importTable(core.String name, {core.String delimiter, core
.String encoding, common.UploadOptions uploadOptions : common.UploadOptions.Defa
ult, common.Media uploadMedia}) { |
| 1025 var _url = null; |
| 1026 var _queryParams = new core.Map(); |
| 1027 var _uploadMedia = null; |
| 1028 var _uploadOptions = null; |
| 1029 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1030 var _body = null; |
| 1031 |
| 1032 if (name == null) { |
| 1033 throw new core.ArgumentError("Parameter name is required."); |
| 1034 } |
| 1035 _queryParams["name"] = [name]; |
| 1036 if (delimiter != null) { |
| 1037 _queryParams["delimiter"] = [delimiter]; |
| 1038 } |
| 1039 if (encoding != null) { |
| 1040 _queryParams["encoding"] = [encoding]; |
| 1041 } |
| 1042 |
| 1043 _uploadMedia = uploadMedia; |
| 1044 _uploadOptions = uploadOptions; |
| 1045 |
| 1046 if (_uploadMedia == null) { |
| 1047 _url = 'tables/import'; |
| 1048 } else if (_uploadOptions is common.ResumableUploadOptions) { |
| 1049 _url = '/resumable/upload/fusiontables/v1/tables/import'; |
| 1050 } else { |
| 1051 _url = '/upload/fusiontables/v1/tables/import'; |
| 1052 } |
| 1053 |
| 1054 |
| 1055 var _response = _requester.request(_url, |
| 1056 "POST", |
| 1057 body: _body, |
| 1058 queryParams: _queryParams, |
| 1059 uploadOptions: _uploadOptions, |
| 1060 uploadMedia: _uploadMedia, |
| 1061 downloadOptions: _downloadOptions); |
| 1062 return _response.then((data) => new Table.fromJson(data)); |
| 1063 } |
| 1064 |
| 1065 /** |
| 1066 * Creates a new table. |
| 1067 * |
| 1068 * [request] - The metadata request object. |
| 1069 * |
| 1070 * Request parameters: |
| 1071 * |
| 1072 * Completes with a [Table]. |
| 1073 * |
| 1074 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1075 * error. |
| 1076 * |
| 1077 * If the used [http.Client] completes with an error when making a REST call, |
| 1078 * this method will complete with the same error. |
| 1079 */ |
| 1080 async.Future<Table> insert(Table request) { |
| 1081 var _url = null; |
| 1082 var _queryParams = new core.Map(); |
| 1083 var _uploadMedia = null; |
| 1084 var _uploadOptions = null; |
| 1085 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1086 var _body = null; |
| 1087 |
| 1088 if (request != null) { |
| 1089 _body = convert.JSON.encode((request).toJson()); |
| 1090 } |
| 1091 |
| 1092 |
| 1093 _url = 'tables'; |
| 1094 |
| 1095 var _response = _requester.request(_url, |
| 1096 "POST", |
| 1097 body: _body, |
| 1098 queryParams: _queryParams, |
| 1099 uploadOptions: _uploadOptions, |
| 1100 uploadMedia: _uploadMedia, |
| 1101 downloadOptions: _downloadOptions); |
| 1102 return _response.then((data) => new Table.fromJson(data)); |
| 1103 } |
| 1104 |
| 1105 /** |
| 1106 * Retrieves a list of tables a user owns. |
| 1107 * |
| 1108 * Request parameters: |
| 1109 * |
| 1110 * [maxResults] - Maximum number of styles to return. Optional. Default is 5. |
| 1111 * |
| 1112 * [pageToken] - Continuation token specifying which result page to return. |
| 1113 * Optional. |
| 1114 * |
| 1115 * Completes with a [TableList]. |
| 1116 * |
| 1117 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1118 * error. |
| 1119 * |
| 1120 * If the used [http.Client] completes with an error when making a REST call, |
| 1121 * this method will complete with the same error. |
| 1122 */ |
| 1123 async.Future<TableList> list({core.int maxResults, core.String pageToken}) { |
| 1124 var _url = null; |
| 1125 var _queryParams = new core.Map(); |
| 1126 var _uploadMedia = null; |
| 1127 var _uploadOptions = null; |
| 1128 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1129 var _body = null; |
| 1130 |
| 1131 if (maxResults != null) { |
| 1132 _queryParams["maxResults"] = ["${maxResults}"]; |
| 1133 } |
| 1134 if (pageToken != null) { |
| 1135 _queryParams["pageToken"] = [pageToken]; |
| 1136 } |
| 1137 |
| 1138 |
| 1139 _url = 'tables'; |
| 1140 |
| 1141 var _response = _requester.request(_url, |
| 1142 "GET", |
| 1143 body: _body, |
| 1144 queryParams: _queryParams, |
| 1145 uploadOptions: _uploadOptions, |
| 1146 uploadMedia: _uploadMedia, |
| 1147 downloadOptions: _downloadOptions); |
| 1148 return _response.then((data) => new TableList.fromJson(data)); |
| 1149 } |
| 1150 |
| 1151 /** |
| 1152 * Updates an existing table. Unless explicitly requested, only the name, |
| 1153 * description, and attribution will be updated. This method supports patch |
| 1154 * semantics. |
| 1155 * |
| 1156 * [request] - The metadata request object. |
| 1157 * |
| 1158 * Request parameters: |
| 1159 * |
| 1160 * [tableId] - ID of the table that is being updated. |
| 1161 * |
| 1162 * [replaceViewDefinition] - Should the view definition also be updated? The |
| 1163 * specified view definition replaces the existing one. Only a view can be |
| 1164 * updated with a new definition. |
| 1165 * |
| 1166 * Completes with a [Table]. |
| 1167 * |
| 1168 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1169 * error. |
| 1170 * |
| 1171 * If the used [http.Client] completes with an error when making a REST call, |
| 1172 * this method will complete with the same error. |
| 1173 */ |
| 1174 async.Future<Table> patch(Table request, core.String tableId, {core.bool repla
ceViewDefinition}) { |
| 1175 var _url = null; |
| 1176 var _queryParams = new core.Map(); |
| 1177 var _uploadMedia = null; |
| 1178 var _uploadOptions = null; |
| 1179 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1180 var _body = null; |
| 1181 |
| 1182 if (request != null) { |
| 1183 _body = convert.JSON.encode((request).toJson()); |
| 1184 } |
| 1185 if (tableId == null) { |
| 1186 throw new core.ArgumentError("Parameter tableId is required."); |
| 1187 } |
| 1188 if (replaceViewDefinition != null) { |
| 1189 _queryParams["replaceViewDefinition"] = ["${replaceViewDefinition}"]; |
| 1190 } |
| 1191 |
| 1192 |
| 1193 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId'); |
| 1194 |
| 1195 var _response = _requester.request(_url, |
| 1196 "PATCH", |
| 1197 body: _body, |
| 1198 queryParams: _queryParams, |
| 1199 uploadOptions: _uploadOptions, |
| 1200 uploadMedia: _uploadMedia, |
| 1201 downloadOptions: _downloadOptions); |
| 1202 return _response.then((data) => new Table.fromJson(data)); |
| 1203 } |
| 1204 |
| 1205 /** |
| 1206 * Updates an existing table. Unless explicitly requested, only the name, |
| 1207 * description, and attribution will be updated. |
| 1208 * |
| 1209 * [request] - The metadata request object. |
| 1210 * |
| 1211 * Request parameters: |
| 1212 * |
| 1213 * [tableId] - ID of the table that is being updated. |
| 1214 * |
| 1215 * [replaceViewDefinition] - Should the view definition also be updated? The |
| 1216 * specified view definition replaces the existing one. Only a view can be |
| 1217 * updated with a new definition. |
| 1218 * |
| 1219 * Completes with a [Table]. |
| 1220 * |
| 1221 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1222 * error. |
| 1223 * |
| 1224 * If the used [http.Client] completes with an error when making a REST call, |
| 1225 * this method will complete with the same error. |
| 1226 */ |
| 1227 async.Future<Table> update(Table request, core.String tableId, {core.bool repl
aceViewDefinition}) { |
| 1228 var _url = null; |
| 1229 var _queryParams = new core.Map(); |
| 1230 var _uploadMedia = null; |
| 1231 var _uploadOptions = null; |
| 1232 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1233 var _body = null; |
| 1234 |
| 1235 if (request != null) { |
| 1236 _body = convert.JSON.encode((request).toJson()); |
| 1237 } |
| 1238 if (tableId == null) { |
| 1239 throw new core.ArgumentError("Parameter tableId is required."); |
| 1240 } |
| 1241 if (replaceViewDefinition != null) { |
| 1242 _queryParams["replaceViewDefinition"] = ["${replaceViewDefinition}"]; |
| 1243 } |
| 1244 |
| 1245 |
| 1246 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId'); |
| 1247 |
| 1248 var _response = _requester.request(_url, |
| 1249 "PUT", |
| 1250 body: _body, |
| 1251 queryParams: _queryParams, |
| 1252 uploadOptions: _uploadOptions, |
| 1253 uploadMedia: _uploadMedia, |
| 1254 downloadOptions: _downloadOptions); |
| 1255 return _response.then((data) => new Table.fromJson(data)); |
| 1256 } |
| 1257 |
| 1258 } |
| 1259 |
| 1260 |
| 1261 /** Not documented yet. */ |
| 1262 class TaskResourceApi { |
| 1263 final common_internal.ApiRequester _requester; |
| 1264 |
| 1265 TaskResourceApi(common_internal.ApiRequester client) : |
| 1266 _requester = client; |
| 1267 |
| 1268 /** |
| 1269 * Deletes the task, unless already started. |
| 1270 * |
| 1271 * Request parameters: |
| 1272 * |
| 1273 * [tableId] - Table from which the task is being deleted. |
| 1274 * |
| 1275 * [taskId] - null |
| 1276 * |
| 1277 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1278 * error. |
| 1279 * |
| 1280 * If the used [http.Client] completes with an error when making a REST call, |
| 1281 * this method will complete with the same error. |
| 1282 */ |
| 1283 async.Future delete(core.String tableId, core.String taskId) { |
| 1284 var _url = null; |
| 1285 var _queryParams = new core.Map(); |
| 1286 var _uploadMedia = null; |
| 1287 var _uploadOptions = null; |
| 1288 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1289 var _body = null; |
| 1290 |
| 1291 if (tableId == null) { |
| 1292 throw new core.ArgumentError("Parameter tableId is required."); |
| 1293 } |
| 1294 if (taskId == null) { |
| 1295 throw new core.ArgumentError("Parameter taskId is required."); |
| 1296 } |
| 1297 |
| 1298 _downloadOptions = null; |
| 1299 |
| 1300 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/tas
ks/' + common_internal.Escaper.ecapeVariable('$taskId'); |
| 1301 |
| 1302 var _response = _requester.request(_url, |
| 1303 "DELETE", |
| 1304 body: _body, |
| 1305 queryParams: _queryParams, |
| 1306 uploadOptions: _uploadOptions, |
| 1307 uploadMedia: _uploadMedia, |
| 1308 downloadOptions: _downloadOptions); |
| 1309 return _response.then((data) => null); |
| 1310 } |
| 1311 |
| 1312 /** |
| 1313 * Retrieves a specific task by its id. |
| 1314 * |
| 1315 * Request parameters: |
| 1316 * |
| 1317 * [tableId] - Table to which the task belongs. |
| 1318 * |
| 1319 * [taskId] - null |
| 1320 * |
| 1321 * Completes with a [Task]. |
| 1322 * |
| 1323 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1324 * error. |
| 1325 * |
| 1326 * If the used [http.Client] completes with an error when making a REST call, |
| 1327 * this method will complete with the same error. |
| 1328 */ |
| 1329 async.Future<Task> get(core.String tableId, core.String taskId) { |
| 1330 var _url = null; |
| 1331 var _queryParams = new core.Map(); |
| 1332 var _uploadMedia = null; |
| 1333 var _uploadOptions = null; |
| 1334 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1335 var _body = null; |
| 1336 |
| 1337 if (tableId == null) { |
| 1338 throw new core.ArgumentError("Parameter tableId is required."); |
| 1339 } |
| 1340 if (taskId == null) { |
| 1341 throw new core.ArgumentError("Parameter taskId is required."); |
| 1342 } |
| 1343 |
| 1344 |
| 1345 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/tas
ks/' + common_internal.Escaper.ecapeVariable('$taskId'); |
| 1346 |
| 1347 var _response = _requester.request(_url, |
| 1348 "GET", |
| 1349 body: _body, |
| 1350 queryParams: _queryParams, |
| 1351 uploadOptions: _uploadOptions, |
| 1352 uploadMedia: _uploadMedia, |
| 1353 downloadOptions: _downloadOptions); |
| 1354 return _response.then((data) => new Task.fromJson(data)); |
| 1355 } |
| 1356 |
| 1357 /** |
| 1358 * Retrieves a list of tasks. |
| 1359 * |
| 1360 * Request parameters: |
| 1361 * |
| 1362 * [tableId] - Table whose tasks are being listed. |
| 1363 * |
| 1364 * [maxResults] - Maximum number of columns to return. Optional. Default is 5. |
| 1365 * |
| 1366 * [pageToken] - null |
| 1367 * |
| 1368 * [startIndex] - null |
| 1369 * |
| 1370 * Completes with a [TaskList]. |
| 1371 * |
| 1372 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1373 * error. |
| 1374 * |
| 1375 * If the used [http.Client] completes with an error when making a REST call, |
| 1376 * this method will complete with the same error. |
| 1377 */ |
| 1378 async.Future<TaskList> list(core.String tableId, {core.int maxResults, core.St
ring pageToken, core.int startIndex}) { |
| 1379 var _url = null; |
| 1380 var _queryParams = new core.Map(); |
| 1381 var _uploadMedia = null; |
| 1382 var _uploadOptions = null; |
| 1383 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1384 var _body = null; |
| 1385 |
| 1386 if (tableId == null) { |
| 1387 throw new core.ArgumentError("Parameter tableId is required."); |
| 1388 } |
| 1389 if (maxResults != null) { |
| 1390 _queryParams["maxResults"] = ["${maxResults}"]; |
| 1391 } |
| 1392 if (pageToken != null) { |
| 1393 _queryParams["pageToken"] = [pageToken]; |
| 1394 } |
| 1395 if (startIndex != null) { |
| 1396 _queryParams["startIndex"] = ["${startIndex}"]; |
| 1397 } |
| 1398 |
| 1399 |
| 1400 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/tas
ks'; |
| 1401 |
| 1402 var _response = _requester.request(_url, |
| 1403 "GET", |
| 1404 body: _body, |
| 1405 queryParams: _queryParams, |
| 1406 uploadOptions: _uploadOptions, |
| 1407 uploadMedia: _uploadMedia, |
| 1408 downloadOptions: _downloadOptions); |
| 1409 return _response.then((data) => new TaskList.fromJson(data)); |
| 1410 } |
| 1411 |
| 1412 } |
| 1413 |
| 1414 |
| 1415 /** Not documented yet. */ |
| 1416 class TemplateResourceApi { |
| 1417 final common_internal.ApiRequester _requester; |
| 1418 |
| 1419 TemplateResourceApi(common_internal.ApiRequester client) : |
| 1420 _requester = client; |
| 1421 |
| 1422 /** |
| 1423 * Deletes a template |
| 1424 * |
| 1425 * Request parameters: |
| 1426 * |
| 1427 * [tableId] - Table from which the template is being deleted |
| 1428 * |
| 1429 * [templateId] - Identifier for the template which is being deleted |
| 1430 * |
| 1431 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1432 * error. |
| 1433 * |
| 1434 * If the used [http.Client] completes with an error when making a REST call, |
| 1435 * this method will complete with the same error. |
| 1436 */ |
| 1437 async.Future delete(core.String tableId, core.int templateId) { |
| 1438 var _url = null; |
| 1439 var _queryParams = new core.Map(); |
| 1440 var _uploadMedia = null; |
| 1441 var _uploadOptions = null; |
| 1442 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1443 var _body = null; |
| 1444 |
| 1445 if (tableId == null) { |
| 1446 throw new core.ArgumentError("Parameter tableId is required."); |
| 1447 } |
| 1448 if (templateId == null) { |
| 1449 throw new core.ArgumentError("Parameter templateId is required."); |
| 1450 } |
| 1451 |
| 1452 _downloadOptions = null; |
| 1453 |
| 1454 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/tem
plates/' + common_internal.Escaper.ecapeVariable('$templateId'); |
| 1455 |
| 1456 var _response = _requester.request(_url, |
| 1457 "DELETE", |
| 1458 body: _body, |
| 1459 queryParams: _queryParams, |
| 1460 uploadOptions: _uploadOptions, |
| 1461 uploadMedia: _uploadMedia, |
| 1462 downloadOptions: _downloadOptions); |
| 1463 return _response.then((data) => null); |
| 1464 } |
| 1465 |
| 1466 /** |
| 1467 * Retrieves a specific template by its id |
| 1468 * |
| 1469 * Request parameters: |
| 1470 * |
| 1471 * [tableId] - Table to which the template belongs |
| 1472 * |
| 1473 * [templateId] - Identifier for the template that is being requested |
| 1474 * |
| 1475 * Completes with a [Template]. |
| 1476 * |
| 1477 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1478 * error. |
| 1479 * |
| 1480 * If the used [http.Client] completes with an error when making a REST call, |
| 1481 * this method will complete with the same error. |
| 1482 */ |
| 1483 async.Future<Template> get(core.String tableId, core.int templateId) { |
| 1484 var _url = null; |
| 1485 var _queryParams = new core.Map(); |
| 1486 var _uploadMedia = null; |
| 1487 var _uploadOptions = null; |
| 1488 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1489 var _body = null; |
| 1490 |
| 1491 if (tableId == null) { |
| 1492 throw new core.ArgumentError("Parameter tableId is required."); |
| 1493 } |
| 1494 if (templateId == null) { |
| 1495 throw new core.ArgumentError("Parameter templateId is required."); |
| 1496 } |
| 1497 |
| 1498 |
| 1499 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/tem
plates/' + common_internal.Escaper.ecapeVariable('$templateId'); |
| 1500 |
| 1501 var _response = _requester.request(_url, |
| 1502 "GET", |
| 1503 body: _body, |
| 1504 queryParams: _queryParams, |
| 1505 uploadOptions: _uploadOptions, |
| 1506 uploadMedia: _uploadMedia, |
| 1507 downloadOptions: _downloadOptions); |
| 1508 return _response.then((data) => new Template.fromJson(data)); |
| 1509 } |
| 1510 |
| 1511 /** |
| 1512 * Creates a new template for the table. |
| 1513 * |
| 1514 * [request] - The metadata request object. |
| 1515 * |
| 1516 * Request parameters: |
| 1517 * |
| 1518 * [tableId] - Table for which a new template is being created |
| 1519 * |
| 1520 * Completes with a [Template]. |
| 1521 * |
| 1522 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1523 * error. |
| 1524 * |
| 1525 * If the used [http.Client] completes with an error when making a REST call, |
| 1526 * this method will complete with the same error. |
| 1527 */ |
| 1528 async.Future<Template> insert(Template request, core.String tableId) { |
| 1529 var _url = null; |
| 1530 var _queryParams = new core.Map(); |
| 1531 var _uploadMedia = null; |
| 1532 var _uploadOptions = null; |
| 1533 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1534 var _body = null; |
| 1535 |
| 1536 if (request != null) { |
| 1537 _body = convert.JSON.encode((request).toJson()); |
| 1538 } |
| 1539 if (tableId == null) { |
| 1540 throw new core.ArgumentError("Parameter tableId is required."); |
| 1541 } |
| 1542 |
| 1543 |
| 1544 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/tem
plates'; |
| 1545 |
| 1546 var _response = _requester.request(_url, |
| 1547 "POST", |
| 1548 body: _body, |
| 1549 queryParams: _queryParams, |
| 1550 uploadOptions: _uploadOptions, |
| 1551 uploadMedia: _uploadMedia, |
| 1552 downloadOptions: _downloadOptions); |
| 1553 return _response.then((data) => new Template.fromJson(data)); |
| 1554 } |
| 1555 |
| 1556 /** |
| 1557 * Retrieves a list of templates. |
| 1558 * |
| 1559 * Request parameters: |
| 1560 * |
| 1561 * [tableId] - Identifier for the table whose templates are being requested |
| 1562 * |
| 1563 * [maxResults] - Maximum number of templates to return. Optional. Default is |
| 1564 * 5. |
| 1565 * |
| 1566 * [pageToken] - Continuation token specifying which results page to return. |
| 1567 * Optional. |
| 1568 * |
| 1569 * Completes with a [TemplateList]. |
| 1570 * |
| 1571 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1572 * error. |
| 1573 * |
| 1574 * If the used [http.Client] completes with an error when making a REST call, |
| 1575 * this method will complete with the same error. |
| 1576 */ |
| 1577 async.Future<TemplateList> list(core.String tableId, {core.int maxResults, cor
e.String pageToken}) { |
| 1578 var _url = null; |
| 1579 var _queryParams = new core.Map(); |
| 1580 var _uploadMedia = null; |
| 1581 var _uploadOptions = null; |
| 1582 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1583 var _body = null; |
| 1584 |
| 1585 if (tableId == null) { |
| 1586 throw new core.ArgumentError("Parameter tableId is required."); |
| 1587 } |
| 1588 if (maxResults != null) { |
| 1589 _queryParams["maxResults"] = ["${maxResults}"]; |
| 1590 } |
| 1591 if (pageToken != null) { |
| 1592 _queryParams["pageToken"] = [pageToken]; |
| 1593 } |
| 1594 |
| 1595 |
| 1596 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/tem
plates'; |
| 1597 |
| 1598 var _response = _requester.request(_url, |
| 1599 "GET", |
| 1600 body: _body, |
| 1601 queryParams: _queryParams, |
| 1602 uploadOptions: _uploadOptions, |
| 1603 uploadMedia: _uploadMedia, |
| 1604 downloadOptions: _downloadOptions); |
| 1605 return _response.then((data) => new TemplateList.fromJson(data)); |
| 1606 } |
| 1607 |
| 1608 /** |
| 1609 * Updates an existing template. This method supports patch semantics. |
| 1610 * |
| 1611 * [request] - The metadata request object. |
| 1612 * |
| 1613 * Request parameters: |
| 1614 * |
| 1615 * [tableId] - Table to which the updated template belongs |
| 1616 * |
| 1617 * [templateId] - Identifier for the template that is being updated |
| 1618 * |
| 1619 * Completes with a [Template]. |
| 1620 * |
| 1621 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1622 * error. |
| 1623 * |
| 1624 * If the used [http.Client] completes with an error when making a REST call, |
| 1625 * this method will complete with the same error. |
| 1626 */ |
| 1627 async.Future<Template> patch(Template request, core.String tableId, core.int t
emplateId) { |
| 1628 var _url = null; |
| 1629 var _queryParams = new core.Map(); |
| 1630 var _uploadMedia = null; |
| 1631 var _uploadOptions = null; |
| 1632 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1633 var _body = null; |
| 1634 |
| 1635 if (request != null) { |
| 1636 _body = convert.JSON.encode((request).toJson()); |
| 1637 } |
| 1638 if (tableId == null) { |
| 1639 throw new core.ArgumentError("Parameter tableId is required."); |
| 1640 } |
| 1641 if (templateId == null) { |
| 1642 throw new core.ArgumentError("Parameter templateId is required."); |
| 1643 } |
| 1644 |
| 1645 |
| 1646 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/tem
plates/' + common_internal.Escaper.ecapeVariable('$templateId'); |
| 1647 |
| 1648 var _response = _requester.request(_url, |
| 1649 "PATCH", |
| 1650 body: _body, |
| 1651 queryParams: _queryParams, |
| 1652 uploadOptions: _uploadOptions, |
| 1653 uploadMedia: _uploadMedia, |
| 1654 downloadOptions: _downloadOptions); |
| 1655 return _response.then((data) => new Template.fromJson(data)); |
| 1656 } |
| 1657 |
| 1658 /** |
| 1659 * Updates an existing template |
| 1660 * |
| 1661 * [request] - The metadata request object. |
| 1662 * |
| 1663 * Request parameters: |
| 1664 * |
| 1665 * [tableId] - Table to which the updated template belongs |
| 1666 * |
| 1667 * [templateId] - Identifier for the template that is being updated |
| 1668 * |
| 1669 * Completes with a [Template]. |
| 1670 * |
| 1671 * Completes with a [common.ApiRequestError] if the API endpoint returned an |
| 1672 * error. |
| 1673 * |
| 1674 * If the used [http.Client] completes with an error when making a REST call, |
| 1675 * this method will complete with the same error. |
| 1676 */ |
| 1677 async.Future<Template> update(Template request, core.String tableId, core.int
templateId) { |
| 1678 var _url = null; |
| 1679 var _queryParams = new core.Map(); |
| 1680 var _uploadMedia = null; |
| 1681 var _uploadOptions = null; |
| 1682 var _downloadOptions = common.DownloadOptions.Metadata; |
| 1683 var _body = null; |
| 1684 |
| 1685 if (request != null) { |
| 1686 _body = convert.JSON.encode((request).toJson()); |
| 1687 } |
| 1688 if (tableId == null) { |
| 1689 throw new core.ArgumentError("Parameter tableId is required."); |
| 1690 } |
| 1691 if (templateId == null) { |
| 1692 throw new core.ArgumentError("Parameter templateId is required."); |
| 1693 } |
| 1694 |
| 1695 |
| 1696 _url = 'tables/' + common_internal.Escaper.ecapeVariable('$tableId') + '/tem
plates/' + common_internal.Escaper.ecapeVariable('$templateId'); |
| 1697 |
| 1698 var _response = _requester.request(_url, |
| 1699 "PUT", |
| 1700 body: _body, |
| 1701 queryParams: _queryParams, |
| 1702 uploadOptions: _uploadOptions, |
| 1703 uploadMedia: _uploadMedia, |
| 1704 downloadOptions: _downloadOptions); |
| 1705 return _response.then((data) => new Template.fromJson(data)); |
| 1706 } |
| 1707 |
| 1708 } |
| 1709 |
| 1710 |
| 1711 |
| 1712 /** |
| 1713 * Specifies the minimum and maximum values, the color, opacity, icon and weight |
| 1714 * of a bucket within a StyleSetting. |
| 1715 */ |
| 1716 class Bucket { |
| 1717 /** Color of line or the interior of a polygon in #RRGGBB format. */ |
| 1718 core.String color; |
| 1719 |
| 1720 /** Icon name used for a point. */ |
| 1721 core.String icon; |
| 1722 |
| 1723 /** |
| 1724 * Maximum value in the selected column for a row to be styled according to |
| 1725 * the bucket color, opacity, icon, or weight. |
| 1726 */ |
| 1727 core.double max; |
| 1728 |
| 1729 /** |
| 1730 * Minimum value in the selected column for a row to be styled according to |
| 1731 * the bucket color, opacity, icon, or weight. |
| 1732 */ |
| 1733 core.double min; |
| 1734 |
| 1735 /** Opacity of the color: 0.0 (transparent) to 1.0 (opaque). */ |
| 1736 core.double opacity; |
| 1737 |
| 1738 /** Width of a line (in pixels). */ |
| 1739 core.int weight; |
| 1740 |
| 1741 |
| 1742 Bucket(); |
| 1743 |
| 1744 Bucket.fromJson(core.Map _json) { |
| 1745 if (_json.containsKey("color")) { |
| 1746 color = _json["color"]; |
| 1747 } |
| 1748 if (_json.containsKey("icon")) { |
| 1749 icon = _json["icon"]; |
| 1750 } |
| 1751 if (_json.containsKey("max")) { |
| 1752 max = _json["max"]; |
| 1753 } |
| 1754 if (_json.containsKey("min")) { |
| 1755 min = _json["min"]; |
| 1756 } |
| 1757 if (_json.containsKey("opacity")) { |
| 1758 opacity = _json["opacity"]; |
| 1759 } |
| 1760 if (_json.containsKey("weight")) { |
| 1761 weight = _json["weight"]; |
| 1762 } |
| 1763 } |
| 1764 |
| 1765 core.Map toJson() { |
| 1766 var _json = new core.Map(); |
| 1767 if (color != null) { |
| 1768 _json["color"] = color; |
| 1769 } |
| 1770 if (icon != null) { |
| 1771 _json["icon"] = icon; |
| 1772 } |
| 1773 if (max != null) { |
| 1774 _json["max"] = max; |
| 1775 } |
| 1776 if (min != null) { |
| 1777 _json["min"] = min; |
| 1778 } |
| 1779 if (opacity != null) { |
| 1780 _json["opacity"] = opacity; |
| 1781 } |
| 1782 if (weight != null) { |
| 1783 _json["weight"] = weight; |
| 1784 } |
| 1785 return _json; |
| 1786 } |
| 1787 } |
| 1788 |
| 1789 |
| 1790 /** |
| 1791 * Optional identifier of the base column. If present, this column is derived |
| 1792 * from the specified base column. |
| 1793 */ |
| 1794 class ColumnBaseColumn { |
| 1795 /** |
| 1796 * The id of the column in the base table from which this column is derived. |
| 1797 */ |
| 1798 core.int columnId; |
| 1799 |
| 1800 /** |
| 1801 * Offset to the entry in the list of base tables in the table definition. |
| 1802 */ |
| 1803 core.int tableIndex; |
| 1804 |
| 1805 |
| 1806 ColumnBaseColumn(); |
| 1807 |
| 1808 ColumnBaseColumn.fromJson(core.Map _json) { |
| 1809 if (_json.containsKey("columnId")) { |
| 1810 columnId = _json["columnId"]; |
| 1811 } |
| 1812 if (_json.containsKey("tableIndex")) { |
| 1813 tableIndex = _json["tableIndex"]; |
| 1814 } |
| 1815 } |
| 1816 |
| 1817 core.Map toJson() { |
| 1818 var _json = new core.Map(); |
| 1819 if (columnId != null) { |
| 1820 _json["columnId"] = columnId; |
| 1821 } |
| 1822 if (tableIndex != null) { |
| 1823 _json["tableIndex"] = tableIndex; |
| 1824 } |
| 1825 return _json; |
| 1826 } |
| 1827 } |
| 1828 |
| 1829 |
| 1830 /** Specifies the id, name and type of a column in a table. */ |
| 1831 class Column { |
| 1832 /** |
| 1833 * Optional identifier of the base column. If present, this column is derived |
| 1834 * from the specified base column. |
| 1835 */ |
| 1836 ColumnBaseColumn baseColumn; |
| 1837 |
| 1838 /** Identifier for the column. */ |
| 1839 core.int columnId; |
| 1840 |
| 1841 /** Optional column description. */ |
| 1842 core.String description; |
| 1843 |
| 1844 /** |
| 1845 * Optional column predicate. Used to map table to graph data model |
| 1846 * (subject,predicate,object) See |
| 1847 * http://www.w3.org/TR/2014/REC-rdf11-concepts-20140225/#data-model |
| 1848 */ |
| 1849 core.String graphPredicate; |
| 1850 |
| 1851 /** Type name: a template for an individual column. */ |
| 1852 core.String kind; |
| 1853 |
| 1854 /** Required name of the column. */ |
| 1855 core.String name; |
| 1856 |
| 1857 /** Required type of the column. */ |
| 1858 core.String type; |
| 1859 |
| 1860 |
| 1861 Column(); |
| 1862 |
| 1863 Column.fromJson(core.Map _json) { |
| 1864 if (_json.containsKey("baseColumn")) { |
| 1865 baseColumn = new ColumnBaseColumn.fromJson(_json["baseColumn"]); |
| 1866 } |
| 1867 if (_json.containsKey("columnId")) { |
| 1868 columnId = _json["columnId"]; |
| 1869 } |
| 1870 if (_json.containsKey("description")) { |
| 1871 description = _json["description"]; |
| 1872 } |
| 1873 if (_json.containsKey("graph_predicate")) { |
| 1874 graphPredicate = _json["graph_predicate"]; |
| 1875 } |
| 1876 if (_json.containsKey("kind")) { |
| 1877 kind = _json["kind"]; |
| 1878 } |
| 1879 if (_json.containsKey("name")) { |
| 1880 name = _json["name"]; |
| 1881 } |
| 1882 if (_json.containsKey("type")) { |
| 1883 type = _json["type"]; |
| 1884 } |
| 1885 } |
| 1886 |
| 1887 core.Map toJson() { |
| 1888 var _json = new core.Map(); |
| 1889 if (baseColumn != null) { |
| 1890 _json["baseColumn"] = (baseColumn).toJson(); |
| 1891 } |
| 1892 if (columnId != null) { |
| 1893 _json["columnId"] = columnId; |
| 1894 } |
| 1895 if (description != null) { |
| 1896 _json["description"] = description; |
| 1897 } |
| 1898 if (graphPredicate != null) { |
| 1899 _json["graph_predicate"] = graphPredicate; |
| 1900 } |
| 1901 if (kind != null) { |
| 1902 _json["kind"] = kind; |
| 1903 } |
| 1904 if (name != null) { |
| 1905 _json["name"] = name; |
| 1906 } |
| 1907 if (type != null) { |
| 1908 _json["type"] = type; |
| 1909 } |
| 1910 return _json; |
| 1911 } |
| 1912 } |
| 1913 |
| 1914 |
| 1915 /** Represents a list of columns in a table. */ |
| 1916 class ColumnList { |
| 1917 /** List of all requested columns. */ |
| 1918 core.List<Column> items; |
| 1919 |
| 1920 /** Type name: a list of all columns. */ |
| 1921 core.String kind; |
| 1922 |
| 1923 /** |
| 1924 * Token used to access the next page of this result. No token is displayed if |
| 1925 * there are no more tokens left. |
| 1926 */ |
| 1927 core.String nextPageToken; |
| 1928 |
| 1929 /** Total number of columns for the table. */ |
| 1930 core.int totalItems; |
| 1931 |
| 1932 |
| 1933 ColumnList(); |
| 1934 |
| 1935 ColumnList.fromJson(core.Map _json) { |
| 1936 if (_json.containsKey("items")) { |
| 1937 items = _json["items"].map((value) => new Column.fromJson(value)).toList()
; |
| 1938 } |
| 1939 if (_json.containsKey("kind")) { |
| 1940 kind = _json["kind"]; |
| 1941 } |
| 1942 if (_json.containsKey("nextPageToken")) { |
| 1943 nextPageToken = _json["nextPageToken"]; |
| 1944 } |
| 1945 if (_json.containsKey("totalItems")) { |
| 1946 totalItems = _json["totalItems"]; |
| 1947 } |
| 1948 } |
| 1949 |
| 1950 core.Map toJson() { |
| 1951 var _json = new core.Map(); |
| 1952 if (items != null) { |
| 1953 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 1954 } |
| 1955 if (kind != null) { |
| 1956 _json["kind"] = kind; |
| 1957 } |
| 1958 if (nextPageToken != null) { |
| 1959 _json["nextPageToken"] = nextPageToken; |
| 1960 } |
| 1961 if (totalItems != null) { |
| 1962 _json["totalItems"] = totalItems; |
| 1963 } |
| 1964 return _json; |
| 1965 } |
| 1966 } |
| 1967 |
| 1968 |
| 1969 /** Represents a Geometry object. */ |
| 1970 class Geometry { |
| 1971 /** |
| 1972 * The list of geometries in this geometry collection. |
| 1973 * |
| 1974 * The values for Object must be JSON objects. It can consist of `num`, |
| 1975 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1976 */ |
| 1977 core.List<core.Object> geometries; |
| 1978 |
| 1979 /** |
| 1980 * Not documented yet. |
| 1981 * |
| 1982 * The values for Object must be JSON objects. It can consist of `num`, |
| 1983 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 1984 */ |
| 1985 core.Object geometry; |
| 1986 |
| 1987 /** Type: A collection of geometries. */ |
| 1988 core.String type; |
| 1989 |
| 1990 |
| 1991 Geometry(); |
| 1992 |
| 1993 Geometry.fromJson(core.Map _json) { |
| 1994 if (_json.containsKey("geometries")) { |
| 1995 geometries = _json["geometries"]; |
| 1996 } |
| 1997 if (_json.containsKey("geometry")) { |
| 1998 geometry = _json["geometry"]; |
| 1999 } |
| 2000 if (_json.containsKey("type")) { |
| 2001 type = _json["type"]; |
| 2002 } |
| 2003 } |
| 2004 |
| 2005 core.Map toJson() { |
| 2006 var _json = new core.Map(); |
| 2007 if (geometries != null) { |
| 2008 _json["geometries"] = geometries; |
| 2009 } |
| 2010 if (geometry != null) { |
| 2011 _json["geometry"] = geometry; |
| 2012 } |
| 2013 if (type != null) { |
| 2014 _json["type"] = type; |
| 2015 } |
| 2016 return _json; |
| 2017 } |
| 2018 } |
| 2019 |
| 2020 |
| 2021 /** Represents an import request. */ |
| 2022 class Import { |
| 2023 /** Type name: a template for an import request. */ |
| 2024 core.String kind; |
| 2025 |
| 2026 /** The number of rows received from the import request. */ |
| 2027 core.String numRowsReceived; |
| 2028 |
| 2029 |
| 2030 Import(); |
| 2031 |
| 2032 Import.fromJson(core.Map _json) { |
| 2033 if (_json.containsKey("kind")) { |
| 2034 kind = _json["kind"]; |
| 2035 } |
| 2036 if (_json.containsKey("numRowsReceived")) { |
| 2037 numRowsReceived = _json["numRowsReceived"]; |
| 2038 } |
| 2039 } |
| 2040 |
| 2041 core.Map toJson() { |
| 2042 var _json = new core.Map(); |
| 2043 if (kind != null) { |
| 2044 _json["kind"] = kind; |
| 2045 } |
| 2046 if (numRowsReceived != null) { |
| 2047 _json["numRowsReceived"] = numRowsReceived; |
| 2048 } |
| 2049 return _json; |
| 2050 } |
| 2051 } |
| 2052 |
| 2053 |
| 2054 /** Represents a line geometry. */ |
| 2055 class Line { |
| 2056 /** The coordinates that define the line. */ |
| 2057 core.List<core.List<core.double>> coordinates; |
| 2058 |
| 2059 /** Type: A line geometry. */ |
| 2060 core.String type; |
| 2061 |
| 2062 |
| 2063 Line(); |
| 2064 |
| 2065 Line.fromJson(core.Map _json) { |
| 2066 if (_json.containsKey("coordinates")) { |
| 2067 coordinates = _json["coordinates"]; |
| 2068 } |
| 2069 if (_json.containsKey("type")) { |
| 2070 type = _json["type"]; |
| 2071 } |
| 2072 } |
| 2073 |
| 2074 core.Map toJson() { |
| 2075 var _json = new core.Map(); |
| 2076 if (coordinates != null) { |
| 2077 _json["coordinates"] = coordinates; |
| 2078 } |
| 2079 if (type != null) { |
| 2080 _json["type"] = type; |
| 2081 } |
| 2082 return _json; |
| 2083 } |
| 2084 } |
| 2085 |
| 2086 |
| 2087 /** Represents a LineStyle within a StyleSetting */ |
| 2088 class LineStyle { |
| 2089 /** Color of the line in #RRGGBB format. */ |
| 2090 core.String strokeColor; |
| 2091 |
| 2092 /** |
| 2093 * Column-value, gradient or buckets styler that is used to determine the line |
| 2094 * color and opacity. |
| 2095 */ |
| 2096 StyleFunction strokeColorStyler; |
| 2097 |
| 2098 /** Opacity of the line : 0.0 (transparent) to 1.0 (opaque). */ |
| 2099 core.double strokeOpacity; |
| 2100 |
| 2101 /** Width of the line in pixels. */ |
| 2102 core.int strokeWeight; |
| 2103 |
| 2104 /** |
| 2105 * Column-value or bucket styler that is used to determine the width of the |
| 2106 * line. |
| 2107 */ |
| 2108 StyleFunction strokeWeightStyler; |
| 2109 |
| 2110 |
| 2111 LineStyle(); |
| 2112 |
| 2113 LineStyle.fromJson(core.Map _json) { |
| 2114 if (_json.containsKey("strokeColor")) { |
| 2115 strokeColor = _json["strokeColor"]; |
| 2116 } |
| 2117 if (_json.containsKey("strokeColorStyler")) { |
| 2118 strokeColorStyler = new StyleFunction.fromJson(_json["strokeColorStyler"])
; |
| 2119 } |
| 2120 if (_json.containsKey("strokeOpacity")) { |
| 2121 strokeOpacity = _json["strokeOpacity"]; |
| 2122 } |
| 2123 if (_json.containsKey("strokeWeight")) { |
| 2124 strokeWeight = _json["strokeWeight"]; |
| 2125 } |
| 2126 if (_json.containsKey("strokeWeightStyler")) { |
| 2127 strokeWeightStyler = new StyleFunction.fromJson(_json["strokeWeightStyler"
]); |
| 2128 } |
| 2129 } |
| 2130 |
| 2131 core.Map toJson() { |
| 2132 var _json = new core.Map(); |
| 2133 if (strokeColor != null) { |
| 2134 _json["strokeColor"] = strokeColor; |
| 2135 } |
| 2136 if (strokeColorStyler != null) { |
| 2137 _json["strokeColorStyler"] = (strokeColorStyler).toJson(); |
| 2138 } |
| 2139 if (strokeOpacity != null) { |
| 2140 _json["strokeOpacity"] = strokeOpacity; |
| 2141 } |
| 2142 if (strokeWeight != null) { |
| 2143 _json["strokeWeight"] = strokeWeight; |
| 2144 } |
| 2145 if (strokeWeightStyler != null) { |
| 2146 _json["strokeWeightStyler"] = (strokeWeightStyler).toJson(); |
| 2147 } |
| 2148 return _json; |
| 2149 } |
| 2150 } |
| 2151 |
| 2152 |
| 2153 /** Represents a point object. */ |
| 2154 class Point { |
| 2155 /** The coordinates that define the point. */ |
| 2156 core.List<core.double> coordinates; |
| 2157 |
| 2158 /** Point: A point geometry. */ |
| 2159 core.String type; |
| 2160 |
| 2161 |
| 2162 Point(); |
| 2163 |
| 2164 Point.fromJson(core.Map _json) { |
| 2165 if (_json.containsKey("coordinates")) { |
| 2166 coordinates = _json["coordinates"]; |
| 2167 } |
| 2168 if (_json.containsKey("type")) { |
| 2169 type = _json["type"]; |
| 2170 } |
| 2171 } |
| 2172 |
| 2173 core.Map toJson() { |
| 2174 var _json = new core.Map(); |
| 2175 if (coordinates != null) { |
| 2176 _json["coordinates"] = coordinates; |
| 2177 } |
| 2178 if (type != null) { |
| 2179 _json["type"] = type; |
| 2180 } |
| 2181 return _json; |
| 2182 } |
| 2183 } |
| 2184 |
| 2185 |
| 2186 /** Represents a PointStyle within a StyleSetting */ |
| 2187 class PointStyle { |
| 2188 /** |
| 2189 * Name of the icon. Use values defined in |
| 2190 * http://www.google.com/fusiontables/DataSource?dsrcid=308519 |
| 2191 */ |
| 2192 core.String iconName; |
| 2193 |
| 2194 /** Column or a bucket value from which the icon name is to be determined. */ |
| 2195 StyleFunction iconStyler; |
| 2196 |
| 2197 |
| 2198 PointStyle(); |
| 2199 |
| 2200 PointStyle.fromJson(core.Map _json) { |
| 2201 if (_json.containsKey("iconName")) { |
| 2202 iconName = _json["iconName"]; |
| 2203 } |
| 2204 if (_json.containsKey("iconStyler")) { |
| 2205 iconStyler = new StyleFunction.fromJson(_json["iconStyler"]); |
| 2206 } |
| 2207 } |
| 2208 |
| 2209 core.Map toJson() { |
| 2210 var _json = new core.Map(); |
| 2211 if (iconName != null) { |
| 2212 _json["iconName"] = iconName; |
| 2213 } |
| 2214 if (iconStyler != null) { |
| 2215 _json["iconStyler"] = (iconStyler).toJson(); |
| 2216 } |
| 2217 return _json; |
| 2218 } |
| 2219 } |
| 2220 |
| 2221 |
| 2222 /** Represents a polygon object. */ |
| 2223 class Polygon { |
| 2224 /** The coordinates that define the polygon. */ |
| 2225 core.List<core.List<core.List<core.double>>> coordinates; |
| 2226 |
| 2227 /** Type: A polygon geometry. */ |
| 2228 core.String type; |
| 2229 |
| 2230 |
| 2231 Polygon(); |
| 2232 |
| 2233 Polygon.fromJson(core.Map _json) { |
| 2234 if (_json.containsKey("coordinates")) { |
| 2235 coordinates = _json["coordinates"]; |
| 2236 } |
| 2237 if (_json.containsKey("type")) { |
| 2238 type = _json["type"]; |
| 2239 } |
| 2240 } |
| 2241 |
| 2242 core.Map toJson() { |
| 2243 var _json = new core.Map(); |
| 2244 if (coordinates != null) { |
| 2245 _json["coordinates"] = coordinates; |
| 2246 } |
| 2247 if (type != null) { |
| 2248 _json["type"] = type; |
| 2249 } |
| 2250 return _json; |
| 2251 } |
| 2252 } |
| 2253 |
| 2254 |
| 2255 /** Represents a PolygonStyle within a StyleSetting */ |
| 2256 class PolygonStyle { |
| 2257 /** Color of the interior of the polygon in #RRGGBB format. */ |
| 2258 core.String fillColor; |
| 2259 |
| 2260 /** |
| 2261 * Column-value, gradient, or bucket styler that is used to determine the |
| 2262 * interior color and opacity of the polygon. |
| 2263 */ |
| 2264 StyleFunction fillColorStyler; |
| 2265 |
| 2266 /** |
| 2267 * Opacity of the interior of the polygon: 0.0 (transparent) to 1.0 (opaque). |
| 2268 */ |
| 2269 core.double fillOpacity; |
| 2270 |
| 2271 /** Color of the polygon border in #RRGGBB format. */ |
| 2272 core.String strokeColor; |
| 2273 |
| 2274 /** |
| 2275 * Column-value, gradient or buckets styler that is used to determine the |
| 2276 * border color and opacity. |
| 2277 */ |
| 2278 StyleFunction strokeColorStyler; |
| 2279 |
| 2280 /** Opacity of the polygon border: 0.0 (transparent) to 1.0 (opaque). */ |
| 2281 core.double strokeOpacity; |
| 2282 |
| 2283 /** Width of the polyon border in pixels. */ |
| 2284 core.int strokeWeight; |
| 2285 |
| 2286 /** |
| 2287 * Column-value or bucket styler that is used to determine the width of the |
| 2288 * polygon border. |
| 2289 */ |
| 2290 StyleFunction strokeWeightStyler; |
| 2291 |
| 2292 |
| 2293 PolygonStyle(); |
| 2294 |
| 2295 PolygonStyle.fromJson(core.Map _json) { |
| 2296 if (_json.containsKey("fillColor")) { |
| 2297 fillColor = _json["fillColor"]; |
| 2298 } |
| 2299 if (_json.containsKey("fillColorStyler")) { |
| 2300 fillColorStyler = new StyleFunction.fromJson(_json["fillColorStyler"]); |
| 2301 } |
| 2302 if (_json.containsKey("fillOpacity")) { |
| 2303 fillOpacity = _json["fillOpacity"]; |
| 2304 } |
| 2305 if (_json.containsKey("strokeColor")) { |
| 2306 strokeColor = _json["strokeColor"]; |
| 2307 } |
| 2308 if (_json.containsKey("strokeColorStyler")) { |
| 2309 strokeColorStyler = new StyleFunction.fromJson(_json["strokeColorStyler"])
; |
| 2310 } |
| 2311 if (_json.containsKey("strokeOpacity")) { |
| 2312 strokeOpacity = _json["strokeOpacity"]; |
| 2313 } |
| 2314 if (_json.containsKey("strokeWeight")) { |
| 2315 strokeWeight = _json["strokeWeight"]; |
| 2316 } |
| 2317 if (_json.containsKey("strokeWeightStyler")) { |
| 2318 strokeWeightStyler = new StyleFunction.fromJson(_json["strokeWeightStyler"
]); |
| 2319 } |
| 2320 } |
| 2321 |
| 2322 core.Map toJson() { |
| 2323 var _json = new core.Map(); |
| 2324 if (fillColor != null) { |
| 2325 _json["fillColor"] = fillColor; |
| 2326 } |
| 2327 if (fillColorStyler != null) { |
| 2328 _json["fillColorStyler"] = (fillColorStyler).toJson(); |
| 2329 } |
| 2330 if (fillOpacity != null) { |
| 2331 _json["fillOpacity"] = fillOpacity; |
| 2332 } |
| 2333 if (strokeColor != null) { |
| 2334 _json["strokeColor"] = strokeColor; |
| 2335 } |
| 2336 if (strokeColorStyler != null) { |
| 2337 _json["strokeColorStyler"] = (strokeColorStyler).toJson(); |
| 2338 } |
| 2339 if (strokeOpacity != null) { |
| 2340 _json["strokeOpacity"] = strokeOpacity; |
| 2341 } |
| 2342 if (strokeWeight != null) { |
| 2343 _json["strokeWeight"] = strokeWeight; |
| 2344 } |
| 2345 if (strokeWeightStyler != null) { |
| 2346 _json["strokeWeightStyler"] = (strokeWeightStyler).toJson(); |
| 2347 } |
| 2348 return _json; |
| 2349 } |
| 2350 } |
| 2351 |
| 2352 |
| 2353 /** Represents a response to an sql statement. */ |
| 2354 class Sqlresponse { |
| 2355 /** Columns in the table. */ |
| 2356 core.List<core.String> columns; |
| 2357 |
| 2358 /** Type name: a template for an individual table. */ |
| 2359 core.String kind; |
| 2360 |
| 2361 /** |
| 2362 * The rows in the table. For each cell we print out whatever cell value |
| 2363 * (e.g., numeric, string) exists. Thus it is important that each cell |
| 2364 * contains only one value. |
| 2365 * |
| 2366 * The values for Object must be JSON objects. It can consist of `num`, |
| 2367 * `String`, `bool` and `null` as well as `Map` and `List` values. |
| 2368 */ |
| 2369 core.List<core.List<core.Object>> rows; |
| 2370 |
| 2371 |
| 2372 Sqlresponse(); |
| 2373 |
| 2374 Sqlresponse.fromJson(core.Map _json) { |
| 2375 if (_json.containsKey("columns")) { |
| 2376 columns = _json["columns"]; |
| 2377 } |
| 2378 if (_json.containsKey("kind")) { |
| 2379 kind = _json["kind"]; |
| 2380 } |
| 2381 if (_json.containsKey("rows")) { |
| 2382 rows = _json["rows"]; |
| 2383 } |
| 2384 } |
| 2385 |
| 2386 core.Map toJson() { |
| 2387 var _json = new core.Map(); |
| 2388 if (columns != null) { |
| 2389 _json["columns"] = columns; |
| 2390 } |
| 2391 if (kind != null) { |
| 2392 _json["kind"] = kind; |
| 2393 } |
| 2394 if (rows != null) { |
| 2395 _json["rows"] = rows; |
| 2396 } |
| 2397 return _json; |
| 2398 } |
| 2399 } |
| 2400 |
| 2401 |
| 2402 /** Not documented yet. */ |
| 2403 class StyleFunctionGradientColors { |
| 2404 /** Color in #RRGGBB format. */ |
| 2405 core.String color; |
| 2406 |
| 2407 /** Opacity of the color: 0.0 (transparent) to 1.0 (opaque). */ |
| 2408 core.double opacity; |
| 2409 |
| 2410 |
| 2411 StyleFunctionGradientColors(); |
| 2412 |
| 2413 StyleFunctionGradientColors.fromJson(core.Map _json) { |
| 2414 if (_json.containsKey("color")) { |
| 2415 color = _json["color"]; |
| 2416 } |
| 2417 if (_json.containsKey("opacity")) { |
| 2418 opacity = _json["opacity"]; |
| 2419 } |
| 2420 } |
| 2421 |
| 2422 core.Map toJson() { |
| 2423 var _json = new core.Map(); |
| 2424 if (color != null) { |
| 2425 _json["color"] = color; |
| 2426 } |
| 2427 if (opacity != null) { |
| 2428 _json["opacity"] = opacity; |
| 2429 } |
| 2430 return _json; |
| 2431 } |
| 2432 } |
| 2433 |
| 2434 |
| 2435 /** |
| 2436 * Gradient function that interpolates a range of colors based on column value. |
| 2437 */ |
| 2438 class StyleFunctionGradient { |
| 2439 /** Array with two or more colors. */ |
| 2440 core.List<StyleFunctionGradientColors> colors; |
| 2441 |
| 2442 /** |
| 2443 * Higher-end of the interpolation range: rows with this value will be |
| 2444 * assigned to colors[n-1]. |
| 2445 */ |
| 2446 core.double max; |
| 2447 |
| 2448 /** |
| 2449 * Lower-end of the interpolation range: rows with this value will be assigned |
| 2450 * to colors[0]. |
| 2451 */ |
| 2452 core.double min; |
| 2453 |
| 2454 |
| 2455 StyleFunctionGradient(); |
| 2456 |
| 2457 StyleFunctionGradient.fromJson(core.Map _json) { |
| 2458 if (_json.containsKey("colors")) { |
| 2459 colors = _json["colors"].map((value) => new StyleFunctionGradientColors.fr
omJson(value)).toList(); |
| 2460 } |
| 2461 if (_json.containsKey("max")) { |
| 2462 max = _json["max"]; |
| 2463 } |
| 2464 if (_json.containsKey("min")) { |
| 2465 min = _json["min"]; |
| 2466 } |
| 2467 } |
| 2468 |
| 2469 core.Map toJson() { |
| 2470 var _json = new core.Map(); |
| 2471 if (colors != null) { |
| 2472 _json["colors"] = colors.map((value) => (value).toJson()).toList(); |
| 2473 } |
| 2474 if (max != null) { |
| 2475 _json["max"] = max; |
| 2476 } |
| 2477 if (min != null) { |
| 2478 _json["min"] = min; |
| 2479 } |
| 2480 return _json; |
| 2481 } |
| 2482 } |
| 2483 |
| 2484 |
| 2485 /** Represents a StyleFunction within a StyleSetting */ |
| 2486 class StyleFunction { |
| 2487 /** |
| 2488 * Bucket function that assigns a style based on the range a column value |
| 2489 * falls into. |
| 2490 */ |
| 2491 core.List<Bucket> buckets; |
| 2492 |
| 2493 /** Name of the column whose value is used in the style. */ |
| 2494 core.String columnName; |
| 2495 |
| 2496 /** |
| 2497 * Gradient function that interpolates a range of colors based on column |
| 2498 * value. |
| 2499 */ |
| 2500 StyleFunctionGradient gradient; |
| 2501 |
| 2502 /** |
| 2503 * Stylers can be one of three kinds: "fusiontables#fromColumn" if the column |
| 2504 * value is to be used as is, i.e., the column values can have colors in |
| 2505 * #RRGGBBAA format or integer line widths or icon names; |
| 2506 * "fusiontables#gradient" if the styling of the row is to be based on |
| 2507 * applying the gradient function on the column value; or |
| 2508 * "fusiontables#buckets" if the styling is to based on the bucket into which |
| 2509 * the the column value falls. |
| 2510 */ |
| 2511 core.String kind; |
| 2512 |
| 2513 |
| 2514 StyleFunction(); |
| 2515 |
| 2516 StyleFunction.fromJson(core.Map _json) { |
| 2517 if (_json.containsKey("buckets")) { |
| 2518 buckets = _json["buckets"].map((value) => new Bucket.fromJson(value)).toLi
st(); |
| 2519 } |
| 2520 if (_json.containsKey("columnName")) { |
| 2521 columnName = _json["columnName"]; |
| 2522 } |
| 2523 if (_json.containsKey("gradient")) { |
| 2524 gradient = new StyleFunctionGradient.fromJson(_json["gradient"]); |
| 2525 } |
| 2526 if (_json.containsKey("kind")) { |
| 2527 kind = _json["kind"]; |
| 2528 } |
| 2529 } |
| 2530 |
| 2531 core.Map toJson() { |
| 2532 var _json = new core.Map(); |
| 2533 if (buckets != null) { |
| 2534 _json["buckets"] = buckets.map((value) => (value).toJson()).toList(); |
| 2535 } |
| 2536 if (columnName != null) { |
| 2537 _json["columnName"] = columnName; |
| 2538 } |
| 2539 if (gradient != null) { |
| 2540 _json["gradient"] = (gradient).toJson(); |
| 2541 } |
| 2542 if (kind != null) { |
| 2543 _json["kind"] = kind; |
| 2544 } |
| 2545 return _json; |
| 2546 } |
| 2547 } |
| 2548 |
| 2549 |
| 2550 /** |
| 2551 * Represents a complete StyleSettings object. The primary key is a combination |
| 2552 * of the tableId and a styleId. |
| 2553 */ |
| 2554 class StyleSetting { |
| 2555 /** |
| 2556 * Type name: an individual style setting. A StyleSetting contains the style |
| 2557 * defintions for points, lines, and polygons in a table. Since a table can |
| 2558 * have any one or all of them, a style definition can have point, line and |
| 2559 * polygon style definitions. |
| 2560 */ |
| 2561 core.String kind; |
| 2562 |
| 2563 /** Style definition for points in the table. */ |
| 2564 PointStyle markerOptions; |
| 2565 |
| 2566 /** Optional name for the style setting. */ |
| 2567 core.String name; |
| 2568 |
| 2569 /** Style definition for polygons in the table. */ |
| 2570 PolygonStyle polygonOptions; |
| 2571 |
| 2572 /** Style definition for lines in the table. */ |
| 2573 LineStyle polylineOptions; |
| 2574 |
| 2575 /** Identifier for the style setting (unique only within tables). */ |
| 2576 core.int styleId; |
| 2577 |
| 2578 /** Identifier for the table. */ |
| 2579 core.String tableId; |
| 2580 |
| 2581 |
| 2582 StyleSetting(); |
| 2583 |
| 2584 StyleSetting.fromJson(core.Map _json) { |
| 2585 if (_json.containsKey("kind")) { |
| 2586 kind = _json["kind"]; |
| 2587 } |
| 2588 if (_json.containsKey("markerOptions")) { |
| 2589 markerOptions = new PointStyle.fromJson(_json["markerOptions"]); |
| 2590 } |
| 2591 if (_json.containsKey("name")) { |
| 2592 name = _json["name"]; |
| 2593 } |
| 2594 if (_json.containsKey("polygonOptions")) { |
| 2595 polygonOptions = new PolygonStyle.fromJson(_json["polygonOptions"]); |
| 2596 } |
| 2597 if (_json.containsKey("polylineOptions")) { |
| 2598 polylineOptions = new LineStyle.fromJson(_json["polylineOptions"]); |
| 2599 } |
| 2600 if (_json.containsKey("styleId")) { |
| 2601 styleId = _json["styleId"]; |
| 2602 } |
| 2603 if (_json.containsKey("tableId")) { |
| 2604 tableId = _json["tableId"]; |
| 2605 } |
| 2606 } |
| 2607 |
| 2608 core.Map toJson() { |
| 2609 var _json = new core.Map(); |
| 2610 if (kind != null) { |
| 2611 _json["kind"] = kind; |
| 2612 } |
| 2613 if (markerOptions != null) { |
| 2614 _json["markerOptions"] = (markerOptions).toJson(); |
| 2615 } |
| 2616 if (name != null) { |
| 2617 _json["name"] = name; |
| 2618 } |
| 2619 if (polygonOptions != null) { |
| 2620 _json["polygonOptions"] = (polygonOptions).toJson(); |
| 2621 } |
| 2622 if (polylineOptions != null) { |
| 2623 _json["polylineOptions"] = (polylineOptions).toJson(); |
| 2624 } |
| 2625 if (styleId != null) { |
| 2626 _json["styleId"] = styleId; |
| 2627 } |
| 2628 if (tableId != null) { |
| 2629 _json["tableId"] = tableId; |
| 2630 } |
| 2631 return _json; |
| 2632 } |
| 2633 } |
| 2634 |
| 2635 |
| 2636 /** Represents a list of styles for a given table. */ |
| 2637 class StyleSettingList { |
| 2638 /** All requested style settings. */ |
| 2639 core.List<StyleSetting> items; |
| 2640 |
| 2641 /** Type name: in this case, a list of style settings. */ |
| 2642 core.String kind; |
| 2643 |
| 2644 /** |
| 2645 * Token used to access the next page of this result. No token is displayed if |
| 2646 * there are no more styles left. |
| 2647 */ |
| 2648 core.String nextPageToken; |
| 2649 |
| 2650 /** Total number of styles for the table. */ |
| 2651 core.int totalItems; |
| 2652 |
| 2653 |
| 2654 StyleSettingList(); |
| 2655 |
| 2656 StyleSettingList.fromJson(core.Map _json) { |
| 2657 if (_json.containsKey("items")) { |
| 2658 items = _json["items"].map((value) => new StyleSetting.fromJson(value)).to
List(); |
| 2659 } |
| 2660 if (_json.containsKey("kind")) { |
| 2661 kind = _json["kind"]; |
| 2662 } |
| 2663 if (_json.containsKey("nextPageToken")) { |
| 2664 nextPageToken = _json["nextPageToken"]; |
| 2665 } |
| 2666 if (_json.containsKey("totalItems")) { |
| 2667 totalItems = _json["totalItems"]; |
| 2668 } |
| 2669 } |
| 2670 |
| 2671 core.Map toJson() { |
| 2672 var _json = new core.Map(); |
| 2673 if (items != null) { |
| 2674 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 2675 } |
| 2676 if (kind != null) { |
| 2677 _json["kind"] = kind; |
| 2678 } |
| 2679 if (nextPageToken != null) { |
| 2680 _json["nextPageToken"] = nextPageToken; |
| 2681 } |
| 2682 if (totalItems != null) { |
| 2683 _json["totalItems"] = totalItems; |
| 2684 } |
| 2685 return _json; |
| 2686 } |
| 2687 } |
| 2688 |
| 2689 |
| 2690 /** |
| 2691 * Represents a table. Specifies the name, whether it is exportable, |
| 2692 * description, attribution, and attribution link. |
| 2693 */ |
| 2694 class Table { |
| 2695 /** Optional attribution assigned to the table. */ |
| 2696 core.String attribution; |
| 2697 |
| 2698 /** Optional link for attribution. */ |
| 2699 core.String attributionLink; |
| 2700 |
| 2701 /** |
| 2702 * Optional base table identifier if this table is a view or merged table. |
| 2703 */ |
| 2704 core.List<core.String> baseTableIds; |
| 2705 |
| 2706 /** Columns in the table. */ |
| 2707 core.List<Column> columns; |
| 2708 |
| 2709 /** Optional description assigned to the table. */ |
| 2710 core.String description; |
| 2711 |
| 2712 /** Variable for whether table is exportable. */ |
| 2713 core.bool isExportable; |
| 2714 |
| 2715 /** Type name: a template for an individual table. */ |
| 2716 core.String kind; |
| 2717 |
| 2718 /** Name assigned to a table. */ |
| 2719 core.String name; |
| 2720 |
| 2721 /** Optional sql that encodes the table definition for derived tables. */ |
| 2722 core.String sql; |
| 2723 |
| 2724 /** Encrypted unique alphanumeric identifier for the table. */ |
| 2725 core.String tableId; |
| 2726 |
| 2727 |
| 2728 Table(); |
| 2729 |
| 2730 Table.fromJson(core.Map _json) { |
| 2731 if (_json.containsKey("attribution")) { |
| 2732 attribution = _json["attribution"]; |
| 2733 } |
| 2734 if (_json.containsKey("attributionLink")) { |
| 2735 attributionLink = _json["attributionLink"]; |
| 2736 } |
| 2737 if (_json.containsKey("baseTableIds")) { |
| 2738 baseTableIds = _json["baseTableIds"]; |
| 2739 } |
| 2740 if (_json.containsKey("columns")) { |
| 2741 columns = _json["columns"].map((value) => new Column.fromJson(value)).toLi
st(); |
| 2742 } |
| 2743 if (_json.containsKey("description")) { |
| 2744 description = _json["description"]; |
| 2745 } |
| 2746 if (_json.containsKey("isExportable")) { |
| 2747 isExportable = _json["isExportable"]; |
| 2748 } |
| 2749 if (_json.containsKey("kind")) { |
| 2750 kind = _json["kind"]; |
| 2751 } |
| 2752 if (_json.containsKey("name")) { |
| 2753 name = _json["name"]; |
| 2754 } |
| 2755 if (_json.containsKey("sql")) { |
| 2756 sql = _json["sql"]; |
| 2757 } |
| 2758 if (_json.containsKey("tableId")) { |
| 2759 tableId = _json["tableId"]; |
| 2760 } |
| 2761 } |
| 2762 |
| 2763 core.Map toJson() { |
| 2764 var _json = new core.Map(); |
| 2765 if (attribution != null) { |
| 2766 _json["attribution"] = attribution; |
| 2767 } |
| 2768 if (attributionLink != null) { |
| 2769 _json["attributionLink"] = attributionLink; |
| 2770 } |
| 2771 if (baseTableIds != null) { |
| 2772 _json["baseTableIds"] = baseTableIds; |
| 2773 } |
| 2774 if (columns != null) { |
| 2775 _json["columns"] = columns.map((value) => (value).toJson()).toList(); |
| 2776 } |
| 2777 if (description != null) { |
| 2778 _json["description"] = description; |
| 2779 } |
| 2780 if (isExportable != null) { |
| 2781 _json["isExportable"] = isExportable; |
| 2782 } |
| 2783 if (kind != null) { |
| 2784 _json["kind"] = kind; |
| 2785 } |
| 2786 if (name != null) { |
| 2787 _json["name"] = name; |
| 2788 } |
| 2789 if (sql != null) { |
| 2790 _json["sql"] = sql; |
| 2791 } |
| 2792 if (tableId != null) { |
| 2793 _json["tableId"] = tableId; |
| 2794 } |
| 2795 return _json; |
| 2796 } |
| 2797 } |
| 2798 |
| 2799 |
| 2800 /** Represents a list of tables. */ |
| 2801 class TableList { |
| 2802 /** List of all requested tables. */ |
| 2803 core.List<Table> items; |
| 2804 |
| 2805 /** Type name: a list of all tables. */ |
| 2806 core.String kind; |
| 2807 |
| 2808 /** |
| 2809 * Token used to access the next page of this result. No token is displayed if |
| 2810 * there are no more tokens left. |
| 2811 */ |
| 2812 core.String nextPageToken; |
| 2813 |
| 2814 |
| 2815 TableList(); |
| 2816 |
| 2817 TableList.fromJson(core.Map _json) { |
| 2818 if (_json.containsKey("items")) { |
| 2819 items = _json["items"].map((value) => new Table.fromJson(value)).toList(); |
| 2820 } |
| 2821 if (_json.containsKey("kind")) { |
| 2822 kind = _json["kind"]; |
| 2823 } |
| 2824 if (_json.containsKey("nextPageToken")) { |
| 2825 nextPageToken = _json["nextPageToken"]; |
| 2826 } |
| 2827 } |
| 2828 |
| 2829 core.Map toJson() { |
| 2830 var _json = new core.Map(); |
| 2831 if (items != null) { |
| 2832 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 2833 } |
| 2834 if (kind != null) { |
| 2835 _json["kind"] = kind; |
| 2836 } |
| 2837 if (nextPageToken != null) { |
| 2838 _json["nextPageToken"] = nextPageToken; |
| 2839 } |
| 2840 return _json; |
| 2841 } |
| 2842 } |
| 2843 |
| 2844 |
| 2845 /** Specifies the id, name and type of a task in a table. */ |
| 2846 class Task { |
| 2847 /** Type name: a template for an individual task. */ |
| 2848 core.String kind; |
| 2849 |
| 2850 /** An indication of task progress. */ |
| 2851 core.String progress; |
| 2852 |
| 2853 /** False while the table is busy with some other task. */ |
| 2854 core.bool started; |
| 2855 |
| 2856 /** Identifier for the task. */ |
| 2857 core.String taskId; |
| 2858 |
| 2859 /** Not documented yet. */ |
| 2860 core.String type; |
| 2861 |
| 2862 |
| 2863 Task(); |
| 2864 |
| 2865 Task.fromJson(core.Map _json) { |
| 2866 if (_json.containsKey("kind")) { |
| 2867 kind = _json["kind"]; |
| 2868 } |
| 2869 if (_json.containsKey("progress")) { |
| 2870 progress = _json["progress"]; |
| 2871 } |
| 2872 if (_json.containsKey("started")) { |
| 2873 started = _json["started"]; |
| 2874 } |
| 2875 if (_json.containsKey("taskId")) { |
| 2876 taskId = _json["taskId"]; |
| 2877 } |
| 2878 if (_json.containsKey("type")) { |
| 2879 type = _json["type"]; |
| 2880 } |
| 2881 } |
| 2882 |
| 2883 core.Map toJson() { |
| 2884 var _json = new core.Map(); |
| 2885 if (kind != null) { |
| 2886 _json["kind"] = kind; |
| 2887 } |
| 2888 if (progress != null) { |
| 2889 _json["progress"] = progress; |
| 2890 } |
| 2891 if (started != null) { |
| 2892 _json["started"] = started; |
| 2893 } |
| 2894 if (taskId != null) { |
| 2895 _json["taskId"] = taskId; |
| 2896 } |
| 2897 if (type != null) { |
| 2898 _json["type"] = type; |
| 2899 } |
| 2900 return _json; |
| 2901 } |
| 2902 } |
| 2903 |
| 2904 |
| 2905 /** Represents a list of tasks in a table. */ |
| 2906 class TaskList { |
| 2907 /** List of all requested tasks. */ |
| 2908 core.List<Task> items; |
| 2909 |
| 2910 /** Type name: a list of all tasks. */ |
| 2911 core.String kind; |
| 2912 |
| 2913 /** |
| 2914 * Token used to access the next page of this result. No token is displayed if |
| 2915 * there are no more tokens left. |
| 2916 */ |
| 2917 core.String nextPageToken; |
| 2918 |
| 2919 /** Total number of tasks for the table. */ |
| 2920 core.int totalItems; |
| 2921 |
| 2922 |
| 2923 TaskList(); |
| 2924 |
| 2925 TaskList.fromJson(core.Map _json) { |
| 2926 if (_json.containsKey("items")) { |
| 2927 items = _json["items"].map((value) => new Task.fromJson(value)).toList(); |
| 2928 } |
| 2929 if (_json.containsKey("kind")) { |
| 2930 kind = _json["kind"]; |
| 2931 } |
| 2932 if (_json.containsKey("nextPageToken")) { |
| 2933 nextPageToken = _json["nextPageToken"]; |
| 2934 } |
| 2935 if (_json.containsKey("totalItems")) { |
| 2936 totalItems = _json["totalItems"]; |
| 2937 } |
| 2938 } |
| 2939 |
| 2940 core.Map toJson() { |
| 2941 var _json = new core.Map(); |
| 2942 if (items != null) { |
| 2943 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 2944 } |
| 2945 if (kind != null) { |
| 2946 _json["kind"] = kind; |
| 2947 } |
| 2948 if (nextPageToken != null) { |
| 2949 _json["nextPageToken"] = nextPageToken; |
| 2950 } |
| 2951 if (totalItems != null) { |
| 2952 _json["totalItems"] = totalItems; |
| 2953 } |
| 2954 return _json; |
| 2955 } |
| 2956 } |
| 2957 |
| 2958 |
| 2959 /** Represents the contents of InfoWindow templates. */ |
| 2960 class Template { |
| 2961 /** |
| 2962 * List of columns from which the template is to be automatically constructed. |
| 2963 * Only one of body or automaticColumns can be specified. |
| 2964 */ |
| 2965 core.List<core.String> automaticColumnNames; |
| 2966 |
| 2967 /** |
| 2968 * Body of the template. It contains HTML with {column_name} to insert values |
| 2969 * from a particular column. The body is sanitized to remove certain tags, |
| 2970 * e.g., script. Only one of body or automaticColumns can be specified. |
| 2971 */ |
| 2972 core.String body; |
| 2973 |
| 2974 /** |
| 2975 * Type name: a template for the info window contents. The template can either |
| 2976 * include an HTML body or a list of columns from which the template is |
| 2977 * computed automatically. |
| 2978 */ |
| 2979 core.String kind; |
| 2980 |
| 2981 /** Optional name assigned to a template. */ |
| 2982 core.String name; |
| 2983 |
| 2984 /** Identifier for the table for which the template is defined. */ |
| 2985 core.String tableId; |
| 2986 |
| 2987 /** |
| 2988 * Identifier for the template, unique within the context of a particular |
| 2989 * table. |
| 2990 */ |
| 2991 core.int templateId; |
| 2992 |
| 2993 |
| 2994 Template(); |
| 2995 |
| 2996 Template.fromJson(core.Map _json) { |
| 2997 if (_json.containsKey("automaticColumnNames")) { |
| 2998 automaticColumnNames = _json["automaticColumnNames"]; |
| 2999 } |
| 3000 if (_json.containsKey("body")) { |
| 3001 body = _json["body"]; |
| 3002 } |
| 3003 if (_json.containsKey("kind")) { |
| 3004 kind = _json["kind"]; |
| 3005 } |
| 3006 if (_json.containsKey("name")) { |
| 3007 name = _json["name"]; |
| 3008 } |
| 3009 if (_json.containsKey("tableId")) { |
| 3010 tableId = _json["tableId"]; |
| 3011 } |
| 3012 if (_json.containsKey("templateId")) { |
| 3013 templateId = _json["templateId"]; |
| 3014 } |
| 3015 } |
| 3016 |
| 3017 core.Map toJson() { |
| 3018 var _json = new core.Map(); |
| 3019 if (automaticColumnNames != null) { |
| 3020 _json["automaticColumnNames"] = automaticColumnNames; |
| 3021 } |
| 3022 if (body != null) { |
| 3023 _json["body"] = body; |
| 3024 } |
| 3025 if (kind != null) { |
| 3026 _json["kind"] = kind; |
| 3027 } |
| 3028 if (name != null) { |
| 3029 _json["name"] = name; |
| 3030 } |
| 3031 if (tableId != null) { |
| 3032 _json["tableId"] = tableId; |
| 3033 } |
| 3034 if (templateId != null) { |
| 3035 _json["templateId"] = templateId; |
| 3036 } |
| 3037 return _json; |
| 3038 } |
| 3039 } |
| 3040 |
| 3041 |
| 3042 /** Represents a list of templates for a given table. */ |
| 3043 class TemplateList { |
| 3044 /** List of all requested templates. */ |
| 3045 core.List<Template> items; |
| 3046 |
| 3047 /** Type name: a list of all templates. */ |
| 3048 core.String kind; |
| 3049 |
| 3050 /** |
| 3051 * Token used to access the next page of this result. No token is displayed if |
| 3052 * there are no more tokens left. |
| 3053 */ |
| 3054 core.String nextPageToken; |
| 3055 |
| 3056 /** Total number of templates for the table. */ |
| 3057 core.int totalItems; |
| 3058 |
| 3059 |
| 3060 TemplateList(); |
| 3061 |
| 3062 TemplateList.fromJson(core.Map _json) { |
| 3063 if (_json.containsKey("items")) { |
| 3064 items = _json["items"].map((value) => new Template.fromJson(value)).toList
(); |
| 3065 } |
| 3066 if (_json.containsKey("kind")) { |
| 3067 kind = _json["kind"]; |
| 3068 } |
| 3069 if (_json.containsKey("nextPageToken")) { |
| 3070 nextPageToken = _json["nextPageToken"]; |
| 3071 } |
| 3072 if (_json.containsKey("totalItems")) { |
| 3073 totalItems = _json["totalItems"]; |
| 3074 } |
| 3075 } |
| 3076 |
| 3077 core.Map toJson() { |
| 3078 var _json = new core.Map(); |
| 3079 if (items != null) { |
| 3080 _json["items"] = items.map((value) => (value).toJson()).toList(); |
| 3081 } |
| 3082 if (kind != null) { |
| 3083 _json["kind"] = kind; |
| 3084 } |
| 3085 if (nextPageToken != null) { |
| 3086 _json["nextPageToken"] = nextPageToken; |
| 3087 } |
| 3088 if (totalItems != null) { |
| 3089 _json["totalItems"] = totalItems; |
| 3090 } |
| 3091 return _json; |
| 3092 } |
| 3093 } |
| 3094 |
| 3095 |
OLD | NEW |