OLD | NEW |
(Empty) | |
| 1 library googleapis.bigquery.v2.test; |
| 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:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; |
| 11 import 'package:googleapis/common/common.dart' as common; |
| 12 import 'package:googleapis/src/common_internal.dart' as common_internal; |
| 13 import '../common/common_internal_test.dart' as common_test; |
| 14 |
| 15 import 'package:googleapis/bigquery/v2.dart' as api; |
| 16 |
| 17 |
| 18 |
| 19 core.int buildCounterDatasetAccess = 0; |
| 20 buildDatasetAccess() { |
| 21 var o = new api.DatasetAccess(); |
| 22 buildCounterDatasetAccess++; |
| 23 if (buildCounterDatasetAccess < 3) { |
| 24 o.domain = "foo"; |
| 25 o.groupByEmail = "foo"; |
| 26 o.role = "foo"; |
| 27 o.specialGroup = "foo"; |
| 28 o.userByEmail = "foo"; |
| 29 o.view = buildTableReference(); |
| 30 } |
| 31 buildCounterDatasetAccess--; |
| 32 return o; |
| 33 } |
| 34 |
| 35 checkDatasetAccess(api.DatasetAccess o) { |
| 36 buildCounterDatasetAccess++; |
| 37 if (buildCounterDatasetAccess < 3) { |
| 38 unittest.expect(o.domain, unittest.equals('foo')); |
| 39 unittest.expect(o.groupByEmail, unittest.equals('foo')); |
| 40 unittest.expect(o.role, unittest.equals('foo')); |
| 41 unittest.expect(o.specialGroup, unittest.equals('foo')); |
| 42 unittest.expect(o.userByEmail, unittest.equals('foo')); |
| 43 checkTableReference(o.view); |
| 44 } |
| 45 buildCounterDatasetAccess--; |
| 46 } |
| 47 |
| 48 buildUnnamed1013() { |
| 49 var o = new core.List<api.DatasetAccess>(); |
| 50 o.add(buildDatasetAccess()); |
| 51 o.add(buildDatasetAccess()); |
| 52 return o; |
| 53 } |
| 54 |
| 55 checkUnnamed1013(core.List<api.DatasetAccess> o) { |
| 56 unittest.expect(o, unittest.hasLength(2)); |
| 57 checkDatasetAccess(o[0]); |
| 58 checkDatasetAccess(o[1]); |
| 59 } |
| 60 |
| 61 core.int buildCounterDataset = 0; |
| 62 buildDataset() { |
| 63 var o = new api.Dataset(); |
| 64 buildCounterDataset++; |
| 65 if (buildCounterDataset < 3) { |
| 66 o.access = buildUnnamed1013(); |
| 67 o.creationTime = "foo"; |
| 68 o.datasetReference = buildDatasetReference(); |
| 69 o.description = "foo"; |
| 70 o.etag = "foo"; |
| 71 o.friendlyName = "foo"; |
| 72 o.id = "foo"; |
| 73 o.kind = "foo"; |
| 74 o.lastModifiedTime = "foo"; |
| 75 o.selfLink = "foo"; |
| 76 } |
| 77 buildCounterDataset--; |
| 78 return o; |
| 79 } |
| 80 |
| 81 checkDataset(api.Dataset o) { |
| 82 buildCounterDataset++; |
| 83 if (buildCounterDataset < 3) { |
| 84 checkUnnamed1013(o.access); |
| 85 unittest.expect(o.creationTime, unittest.equals('foo')); |
| 86 checkDatasetReference(o.datasetReference); |
| 87 unittest.expect(o.description, unittest.equals('foo')); |
| 88 unittest.expect(o.etag, unittest.equals('foo')); |
| 89 unittest.expect(o.friendlyName, unittest.equals('foo')); |
| 90 unittest.expect(o.id, unittest.equals('foo')); |
| 91 unittest.expect(o.kind, unittest.equals('foo')); |
| 92 unittest.expect(o.lastModifiedTime, unittest.equals('foo')); |
| 93 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 94 } |
| 95 buildCounterDataset--; |
| 96 } |
| 97 |
| 98 core.int buildCounterDatasetListDatasets = 0; |
| 99 buildDatasetListDatasets() { |
| 100 var o = new api.DatasetListDatasets(); |
| 101 buildCounterDatasetListDatasets++; |
| 102 if (buildCounterDatasetListDatasets < 3) { |
| 103 o.datasetReference = buildDatasetReference(); |
| 104 o.friendlyName = "foo"; |
| 105 o.id = "foo"; |
| 106 o.kind = "foo"; |
| 107 } |
| 108 buildCounterDatasetListDatasets--; |
| 109 return o; |
| 110 } |
| 111 |
| 112 checkDatasetListDatasets(api.DatasetListDatasets o) { |
| 113 buildCounterDatasetListDatasets++; |
| 114 if (buildCounterDatasetListDatasets < 3) { |
| 115 checkDatasetReference(o.datasetReference); |
| 116 unittest.expect(o.friendlyName, unittest.equals('foo')); |
| 117 unittest.expect(o.id, unittest.equals('foo')); |
| 118 unittest.expect(o.kind, unittest.equals('foo')); |
| 119 } |
| 120 buildCounterDatasetListDatasets--; |
| 121 } |
| 122 |
| 123 buildUnnamed1014() { |
| 124 var o = new core.List<api.DatasetListDatasets>(); |
| 125 o.add(buildDatasetListDatasets()); |
| 126 o.add(buildDatasetListDatasets()); |
| 127 return o; |
| 128 } |
| 129 |
| 130 checkUnnamed1014(core.List<api.DatasetListDatasets> o) { |
| 131 unittest.expect(o, unittest.hasLength(2)); |
| 132 checkDatasetListDatasets(o[0]); |
| 133 checkDatasetListDatasets(o[1]); |
| 134 } |
| 135 |
| 136 core.int buildCounterDatasetList = 0; |
| 137 buildDatasetList() { |
| 138 var o = new api.DatasetList(); |
| 139 buildCounterDatasetList++; |
| 140 if (buildCounterDatasetList < 3) { |
| 141 o.datasets = buildUnnamed1014(); |
| 142 o.etag = "foo"; |
| 143 o.kind = "foo"; |
| 144 o.nextPageToken = "foo"; |
| 145 } |
| 146 buildCounterDatasetList--; |
| 147 return o; |
| 148 } |
| 149 |
| 150 checkDatasetList(api.DatasetList o) { |
| 151 buildCounterDatasetList++; |
| 152 if (buildCounterDatasetList < 3) { |
| 153 checkUnnamed1014(o.datasets); |
| 154 unittest.expect(o.etag, unittest.equals('foo')); |
| 155 unittest.expect(o.kind, unittest.equals('foo')); |
| 156 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 157 } |
| 158 buildCounterDatasetList--; |
| 159 } |
| 160 |
| 161 core.int buildCounterDatasetReference = 0; |
| 162 buildDatasetReference() { |
| 163 var o = new api.DatasetReference(); |
| 164 buildCounterDatasetReference++; |
| 165 if (buildCounterDatasetReference < 3) { |
| 166 o.datasetId = "foo"; |
| 167 o.projectId = "foo"; |
| 168 } |
| 169 buildCounterDatasetReference--; |
| 170 return o; |
| 171 } |
| 172 |
| 173 checkDatasetReference(api.DatasetReference o) { |
| 174 buildCounterDatasetReference++; |
| 175 if (buildCounterDatasetReference < 3) { |
| 176 unittest.expect(o.datasetId, unittest.equals('foo')); |
| 177 unittest.expect(o.projectId, unittest.equals('foo')); |
| 178 } |
| 179 buildCounterDatasetReference--; |
| 180 } |
| 181 |
| 182 core.int buildCounterErrorProto = 0; |
| 183 buildErrorProto() { |
| 184 var o = new api.ErrorProto(); |
| 185 buildCounterErrorProto++; |
| 186 if (buildCounterErrorProto < 3) { |
| 187 o.debugInfo = "foo"; |
| 188 o.location = "foo"; |
| 189 o.message = "foo"; |
| 190 o.reason = "foo"; |
| 191 } |
| 192 buildCounterErrorProto--; |
| 193 return o; |
| 194 } |
| 195 |
| 196 checkErrorProto(api.ErrorProto o) { |
| 197 buildCounterErrorProto++; |
| 198 if (buildCounterErrorProto < 3) { |
| 199 unittest.expect(o.debugInfo, unittest.equals('foo')); |
| 200 unittest.expect(o.location, unittest.equals('foo')); |
| 201 unittest.expect(o.message, unittest.equals('foo')); |
| 202 unittest.expect(o.reason, unittest.equals('foo')); |
| 203 } |
| 204 buildCounterErrorProto--; |
| 205 } |
| 206 |
| 207 buildUnnamed1015() { |
| 208 var o = new core.List<api.TableRow>(); |
| 209 o.add(buildTableRow()); |
| 210 o.add(buildTableRow()); |
| 211 return o; |
| 212 } |
| 213 |
| 214 checkUnnamed1015(core.List<api.TableRow> o) { |
| 215 unittest.expect(o, unittest.hasLength(2)); |
| 216 checkTableRow(o[0]); |
| 217 checkTableRow(o[1]); |
| 218 } |
| 219 |
| 220 core.int buildCounterGetQueryResultsResponse = 0; |
| 221 buildGetQueryResultsResponse() { |
| 222 var o = new api.GetQueryResultsResponse(); |
| 223 buildCounterGetQueryResultsResponse++; |
| 224 if (buildCounterGetQueryResultsResponse < 3) { |
| 225 o.cacheHit = true; |
| 226 o.etag = "foo"; |
| 227 o.jobComplete = true; |
| 228 o.jobReference = buildJobReference(); |
| 229 o.kind = "foo"; |
| 230 o.pageToken = "foo"; |
| 231 o.rows = buildUnnamed1015(); |
| 232 o.schema = buildTableSchema(); |
| 233 o.totalRows = "foo"; |
| 234 } |
| 235 buildCounterGetQueryResultsResponse--; |
| 236 return o; |
| 237 } |
| 238 |
| 239 checkGetQueryResultsResponse(api.GetQueryResultsResponse o) { |
| 240 buildCounterGetQueryResultsResponse++; |
| 241 if (buildCounterGetQueryResultsResponse < 3) { |
| 242 unittest.expect(o.cacheHit, unittest.isTrue); |
| 243 unittest.expect(o.etag, unittest.equals('foo')); |
| 244 unittest.expect(o.jobComplete, unittest.isTrue); |
| 245 checkJobReference(o.jobReference); |
| 246 unittest.expect(o.kind, unittest.equals('foo')); |
| 247 unittest.expect(o.pageToken, unittest.equals('foo')); |
| 248 checkUnnamed1015(o.rows); |
| 249 checkTableSchema(o.schema); |
| 250 unittest.expect(o.totalRows, unittest.equals('foo')); |
| 251 } |
| 252 buildCounterGetQueryResultsResponse--; |
| 253 } |
| 254 |
| 255 core.int buildCounterJob = 0; |
| 256 buildJob() { |
| 257 var o = new api.Job(); |
| 258 buildCounterJob++; |
| 259 if (buildCounterJob < 3) { |
| 260 o.configuration = buildJobConfiguration(); |
| 261 o.etag = "foo"; |
| 262 o.id = "foo"; |
| 263 o.jobReference = buildJobReference(); |
| 264 o.kind = "foo"; |
| 265 o.selfLink = "foo"; |
| 266 o.statistics = buildJobStatistics(); |
| 267 o.status = buildJobStatus(); |
| 268 } |
| 269 buildCounterJob--; |
| 270 return o; |
| 271 } |
| 272 |
| 273 checkJob(api.Job o) { |
| 274 buildCounterJob++; |
| 275 if (buildCounterJob < 3) { |
| 276 checkJobConfiguration(o.configuration); |
| 277 unittest.expect(o.etag, unittest.equals('foo')); |
| 278 unittest.expect(o.id, unittest.equals('foo')); |
| 279 checkJobReference(o.jobReference); |
| 280 unittest.expect(o.kind, unittest.equals('foo')); |
| 281 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 282 checkJobStatistics(o.statistics); |
| 283 checkJobStatus(o.status); |
| 284 } |
| 285 buildCounterJob--; |
| 286 } |
| 287 |
| 288 core.int buildCounterJobConfiguration = 0; |
| 289 buildJobConfiguration() { |
| 290 var o = new api.JobConfiguration(); |
| 291 buildCounterJobConfiguration++; |
| 292 if (buildCounterJobConfiguration < 3) { |
| 293 o.copy = buildJobConfigurationTableCopy(); |
| 294 o.dryRun = true; |
| 295 o.extract = buildJobConfigurationExtract(); |
| 296 o.link = buildJobConfigurationLink(); |
| 297 o.load = buildJobConfigurationLoad(); |
| 298 o.query = buildJobConfigurationQuery(); |
| 299 } |
| 300 buildCounterJobConfiguration--; |
| 301 return o; |
| 302 } |
| 303 |
| 304 checkJobConfiguration(api.JobConfiguration o) { |
| 305 buildCounterJobConfiguration++; |
| 306 if (buildCounterJobConfiguration < 3) { |
| 307 checkJobConfigurationTableCopy(o.copy); |
| 308 unittest.expect(o.dryRun, unittest.isTrue); |
| 309 checkJobConfigurationExtract(o.extract); |
| 310 checkJobConfigurationLink(o.link); |
| 311 checkJobConfigurationLoad(o.load); |
| 312 checkJobConfigurationQuery(o.query); |
| 313 } |
| 314 buildCounterJobConfiguration--; |
| 315 } |
| 316 |
| 317 buildUnnamed1016() { |
| 318 var o = new core.List<core.String>(); |
| 319 o.add("foo"); |
| 320 o.add("foo"); |
| 321 return o; |
| 322 } |
| 323 |
| 324 checkUnnamed1016(core.List<core.String> o) { |
| 325 unittest.expect(o, unittest.hasLength(2)); |
| 326 unittest.expect(o[0], unittest.equals('foo')); |
| 327 unittest.expect(o[1], unittest.equals('foo')); |
| 328 } |
| 329 |
| 330 core.int buildCounterJobConfigurationExtract = 0; |
| 331 buildJobConfigurationExtract() { |
| 332 var o = new api.JobConfigurationExtract(); |
| 333 buildCounterJobConfigurationExtract++; |
| 334 if (buildCounterJobConfigurationExtract < 3) { |
| 335 o.compression = "foo"; |
| 336 o.destinationFormat = "foo"; |
| 337 o.destinationUri = "foo"; |
| 338 o.destinationUris = buildUnnamed1016(); |
| 339 o.fieldDelimiter = "foo"; |
| 340 o.printHeader = true; |
| 341 o.sourceTable = buildTableReference(); |
| 342 } |
| 343 buildCounterJobConfigurationExtract--; |
| 344 return o; |
| 345 } |
| 346 |
| 347 checkJobConfigurationExtract(api.JobConfigurationExtract o) { |
| 348 buildCounterJobConfigurationExtract++; |
| 349 if (buildCounterJobConfigurationExtract < 3) { |
| 350 unittest.expect(o.compression, unittest.equals('foo')); |
| 351 unittest.expect(o.destinationFormat, unittest.equals('foo')); |
| 352 unittest.expect(o.destinationUri, unittest.equals('foo')); |
| 353 checkUnnamed1016(o.destinationUris); |
| 354 unittest.expect(o.fieldDelimiter, unittest.equals('foo')); |
| 355 unittest.expect(o.printHeader, unittest.isTrue); |
| 356 checkTableReference(o.sourceTable); |
| 357 } |
| 358 buildCounterJobConfigurationExtract--; |
| 359 } |
| 360 |
| 361 buildUnnamed1017() { |
| 362 var o = new core.List<core.String>(); |
| 363 o.add("foo"); |
| 364 o.add("foo"); |
| 365 return o; |
| 366 } |
| 367 |
| 368 checkUnnamed1017(core.List<core.String> o) { |
| 369 unittest.expect(o, unittest.hasLength(2)); |
| 370 unittest.expect(o[0], unittest.equals('foo')); |
| 371 unittest.expect(o[1], unittest.equals('foo')); |
| 372 } |
| 373 |
| 374 core.int buildCounterJobConfigurationLink = 0; |
| 375 buildJobConfigurationLink() { |
| 376 var o = new api.JobConfigurationLink(); |
| 377 buildCounterJobConfigurationLink++; |
| 378 if (buildCounterJobConfigurationLink < 3) { |
| 379 o.createDisposition = "foo"; |
| 380 o.destinationTable = buildTableReference(); |
| 381 o.sourceUri = buildUnnamed1017(); |
| 382 o.writeDisposition = "foo"; |
| 383 } |
| 384 buildCounterJobConfigurationLink--; |
| 385 return o; |
| 386 } |
| 387 |
| 388 checkJobConfigurationLink(api.JobConfigurationLink o) { |
| 389 buildCounterJobConfigurationLink++; |
| 390 if (buildCounterJobConfigurationLink < 3) { |
| 391 unittest.expect(o.createDisposition, unittest.equals('foo')); |
| 392 checkTableReference(o.destinationTable); |
| 393 checkUnnamed1017(o.sourceUri); |
| 394 unittest.expect(o.writeDisposition, unittest.equals('foo')); |
| 395 } |
| 396 buildCounterJobConfigurationLink--; |
| 397 } |
| 398 |
| 399 buildUnnamed1018() { |
| 400 var o = new core.List<core.String>(); |
| 401 o.add("foo"); |
| 402 o.add("foo"); |
| 403 return o; |
| 404 } |
| 405 |
| 406 checkUnnamed1018(core.List<core.String> o) { |
| 407 unittest.expect(o, unittest.hasLength(2)); |
| 408 unittest.expect(o[0], unittest.equals('foo')); |
| 409 unittest.expect(o[1], unittest.equals('foo')); |
| 410 } |
| 411 |
| 412 core.int buildCounterJobConfigurationLoad = 0; |
| 413 buildJobConfigurationLoad() { |
| 414 var o = new api.JobConfigurationLoad(); |
| 415 buildCounterJobConfigurationLoad++; |
| 416 if (buildCounterJobConfigurationLoad < 3) { |
| 417 o.allowJaggedRows = true; |
| 418 o.allowQuotedNewlines = true; |
| 419 o.createDisposition = "foo"; |
| 420 o.destinationTable = buildTableReference(); |
| 421 o.encoding = "foo"; |
| 422 o.fieldDelimiter = "foo"; |
| 423 o.ignoreUnknownValues = true; |
| 424 o.maxBadRecords = 42; |
| 425 o.quote = "foo"; |
| 426 o.schema = buildTableSchema(); |
| 427 o.schemaInline = "foo"; |
| 428 o.schemaInlineFormat = "foo"; |
| 429 o.skipLeadingRows = 42; |
| 430 o.sourceFormat = "foo"; |
| 431 o.sourceUris = buildUnnamed1018(); |
| 432 o.writeDisposition = "foo"; |
| 433 } |
| 434 buildCounterJobConfigurationLoad--; |
| 435 return o; |
| 436 } |
| 437 |
| 438 checkJobConfigurationLoad(api.JobConfigurationLoad o) { |
| 439 buildCounterJobConfigurationLoad++; |
| 440 if (buildCounterJobConfigurationLoad < 3) { |
| 441 unittest.expect(o.allowJaggedRows, unittest.isTrue); |
| 442 unittest.expect(o.allowQuotedNewlines, unittest.isTrue); |
| 443 unittest.expect(o.createDisposition, unittest.equals('foo')); |
| 444 checkTableReference(o.destinationTable); |
| 445 unittest.expect(o.encoding, unittest.equals('foo')); |
| 446 unittest.expect(o.fieldDelimiter, unittest.equals('foo')); |
| 447 unittest.expect(o.ignoreUnknownValues, unittest.isTrue); |
| 448 unittest.expect(o.maxBadRecords, unittest.equals(42)); |
| 449 unittest.expect(o.quote, unittest.equals('foo')); |
| 450 checkTableSchema(o.schema); |
| 451 unittest.expect(o.schemaInline, unittest.equals('foo')); |
| 452 unittest.expect(o.schemaInlineFormat, unittest.equals('foo')); |
| 453 unittest.expect(o.skipLeadingRows, unittest.equals(42)); |
| 454 unittest.expect(o.sourceFormat, unittest.equals('foo')); |
| 455 checkUnnamed1018(o.sourceUris); |
| 456 unittest.expect(o.writeDisposition, unittest.equals('foo')); |
| 457 } |
| 458 buildCounterJobConfigurationLoad--; |
| 459 } |
| 460 |
| 461 core.int buildCounterJobConfigurationQuery = 0; |
| 462 buildJobConfigurationQuery() { |
| 463 var o = new api.JobConfigurationQuery(); |
| 464 buildCounterJobConfigurationQuery++; |
| 465 if (buildCounterJobConfigurationQuery < 3) { |
| 466 o.allowLargeResults = true; |
| 467 o.createDisposition = "foo"; |
| 468 o.defaultDataset = buildDatasetReference(); |
| 469 o.destinationTable = buildTableReference(); |
| 470 o.flattenResults = true; |
| 471 o.preserveNulls = true; |
| 472 o.priority = "foo"; |
| 473 o.query = "foo"; |
| 474 o.useQueryCache = true; |
| 475 o.writeDisposition = "foo"; |
| 476 } |
| 477 buildCounterJobConfigurationQuery--; |
| 478 return o; |
| 479 } |
| 480 |
| 481 checkJobConfigurationQuery(api.JobConfigurationQuery o) { |
| 482 buildCounterJobConfigurationQuery++; |
| 483 if (buildCounterJobConfigurationQuery < 3) { |
| 484 unittest.expect(o.allowLargeResults, unittest.isTrue); |
| 485 unittest.expect(o.createDisposition, unittest.equals('foo')); |
| 486 checkDatasetReference(o.defaultDataset); |
| 487 checkTableReference(o.destinationTable); |
| 488 unittest.expect(o.flattenResults, unittest.isTrue); |
| 489 unittest.expect(o.preserveNulls, unittest.isTrue); |
| 490 unittest.expect(o.priority, unittest.equals('foo')); |
| 491 unittest.expect(o.query, unittest.equals('foo')); |
| 492 unittest.expect(o.useQueryCache, unittest.isTrue); |
| 493 unittest.expect(o.writeDisposition, unittest.equals('foo')); |
| 494 } |
| 495 buildCounterJobConfigurationQuery--; |
| 496 } |
| 497 |
| 498 buildUnnamed1019() { |
| 499 var o = new core.List<api.TableReference>(); |
| 500 o.add(buildTableReference()); |
| 501 o.add(buildTableReference()); |
| 502 return o; |
| 503 } |
| 504 |
| 505 checkUnnamed1019(core.List<api.TableReference> o) { |
| 506 unittest.expect(o, unittest.hasLength(2)); |
| 507 checkTableReference(o[0]); |
| 508 checkTableReference(o[1]); |
| 509 } |
| 510 |
| 511 core.int buildCounterJobConfigurationTableCopy = 0; |
| 512 buildJobConfigurationTableCopy() { |
| 513 var o = new api.JobConfigurationTableCopy(); |
| 514 buildCounterJobConfigurationTableCopy++; |
| 515 if (buildCounterJobConfigurationTableCopy < 3) { |
| 516 o.createDisposition = "foo"; |
| 517 o.destinationTable = buildTableReference(); |
| 518 o.sourceTable = buildTableReference(); |
| 519 o.sourceTables = buildUnnamed1019(); |
| 520 o.writeDisposition = "foo"; |
| 521 } |
| 522 buildCounterJobConfigurationTableCopy--; |
| 523 return o; |
| 524 } |
| 525 |
| 526 checkJobConfigurationTableCopy(api.JobConfigurationTableCopy o) { |
| 527 buildCounterJobConfigurationTableCopy++; |
| 528 if (buildCounterJobConfigurationTableCopy < 3) { |
| 529 unittest.expect(o.createDisposition, unittest.equals('foo')); |
| 530 checkTableReference(o.destinationTable); |
| 531 checkTableReference(o.sourceTable); |
| 532 checkUnnamed1019(o.sourceTables); |
| 533 unittest.expect(o.writeDisposition, unittest.equals('foo')); |
| 534 } |
| 535 buildCounterJobConfigurationTableCopy--; |
| 536 } |
| 537 |
| 538 core.int buildCounterJobListJobs = 0; |
| 539 buildJobListJobs() { |
| 540 var o = new api.JobListJobs(); |
| 541 buildCounterJobListJobs++; |
| 542 if (buildCounterJobListJobs < 3) { |
| 543 o.configuration = buildJobConfiguration(); |
| 544 o.errorResult = buildErrorProto(); |
| 545 o.id = "foo"; |
| 546 o.jobReference = buildJobReference(); |
| 547 o.kind = "foo"; |
| 548 o.state = "foo"; |
| 549 o.statistics = buildJobStatistics(); |
| 550 o.status = buildJobStatus(); |
| 551 o.userEmail = "foo"; |
| 552 } |
| 553 buildCounterJobListJobs--; |
| 554 return o; |
| 555 } |
| 556 |
| 557 checkJobListJobs(api.JobListJobs o) { |
| 558 buildCounterJobListJobs++; |
| 559 if (buildCounterJobListJobs < 3) { |
| 560 checkJobConfiguration(o.configuration); |
| 561 checkErrorProto(o.errorResult); |
| 562 unittest.expect(o.id, unittest.equals('foo')); |
| 563 checkJobReference(o.jobReference); |
| 564 unittest.expect(o.kind, unittest.equals('foo')); |
| 565 unittest.expect(o.state, unittest.equals('foo')); |
| 566 checkJobStatistics(o.statistics); |
| 567 checkJobStatus(o.status); |
| 568 unittest.expect(o.userEmail, unittest.equals('foo')); |
| 569 } |
| 570 buildCounterJobListJobs--; |
| 571 } |
| 572 |
| 573 buildUnnamed1020() { |
| 574 var o = new core.List<api.JobListJobs>(); |
| 575 o.add(buildJobListJobs()); |
| 576 o.add(buildJobListJobs()); |
| 577 return o; |
| 578 } |
| 579 |
| 580 checkUnnamed1020(core.List<api.JobListJobs> o) { |
| 581 unittest.expect(o, unittest.hasLength(2)); |
| 582 checkJobListJobs(o[0]); |
| 583 checkJobListJobs(o[1]); |
| 584 } |
| 585 |
| 586 core.int buildCounterJobList = 0; |
| 587 buildJobList() { |
| 588 var o = new api.JobList(); |
| 589 buildCounterJobList++; |
| 590 if (buildCounterJobList < 3) { |
| 591 o.etag = "foo"; |
| 592 o.jobs = buildUnnamed1020(); |
| 593 o.kind = "foo"; |
| 594 o.nextPageToken = "foo"; |
| 595 o.totalItems = 42; |
| 596 } |
| 597 buildCounterJobList--; |
| 598 return o; |
| 599 } |
| 600 |
| 601 checkJobList(api.JobList o) { |
| 602 buildCounterJobList++; |
| 603 if (buildCounterJobList < 3) { |
| 604 unittest.expect(o.etag, unittest.equals('foo')); |
| 605 checkUnnamed1020(o.jobs); |
| 606 unittest.expect(o.kind, unittest.equals('foo')); |
| 607 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 608 unittest.expect(o.totalItems, unittest.equals(42)); |
| 609 } |
| 610 buildCounterJobList--; |
| 611 } |
| 612 |
| 613 core.int buildCounterJobReference = 0; |
| 614 buildJobReference() { |
| 615 var o = new api.JobReference(); |
| 616 buildCounterJobReference++; |
| 617 if (buildCounterJobReference < 3) { |
| 618 o.jobId = "foo"; |
| 619 o.projectId = "foo"; |
| 620 } |
| 621 buildCounterJobReference--; |
| 622 return o; |
| 623 } |
| 624 |
| 625 checkJobReference(api.JobReference o) { |
| 626 buildCounterJobReference++; |
| 627 if (buildCounterJobReference < 3) { |
| 628 unittest.expect(o.jobId, unittest.equals('foo')); |
| 629 unittest.expect(o.projectId, unittest.equals('foo')); |
| 630 } |
| 631 buildCounterJobReference--; |
| 632 } |
| 633 |
| 634 core.int buildCounterJobStatistics = 0; |
| 635 buildJobStatistics() { |
| 636 var o = new api.JobStatistics(); |
| 637 buildCounterJobStatistics++; |
| 638 if (buildCounterJobStatistics < 3) { |
| 639 o.creationTime = "foo"; |
| 640 o.endTime = "foo"; |
| 641 o.load = buildJobStatistics3(); |
| 642 o.query = buildJobStatistics2(); |
| 643 o.startTime = "foo"; |
| 644 o.totalBytesProcessed = "foo"; |
| 645 } |
| 646 buildCounterJobStatistics--; |
| 647 return o; |
| 648 } |
| 649 |
| 650 checkJobStatistics(api.JobStatistics o) { |
| 651 buildCounterJobStatistics++; |
| 652 if (buildCounterJobStatistics < 3) { |
| 653 unittest.expect(o.creationTime, unittest.equals('foo')); |
| 654 unittest.expect(o.endTime, unittest.equals('foo')); |
| 655 checkJobStatistics3(o.load); |
| 656 checkJobStatistics2(o.query); |
| 657 unittest.expect(o.startTime, unittest.equals('foo')); |
| 658 unittest.expect(o.totalBytesProcessed, unittest.equals('foo')); |
| 659 } |
| 660 buildCounterJobStatistics--; |
| 661 } |
| 662 |
| 663 core.int buildCounterJobStatistics2 = 0; |
| 664 buildJobStatistics2() { |
| 665 var o = new api.JobStatistics2(); |
| 666 buildCounterJobStatistics2++; |
| 667 if (buildCounterJobStatistics2 < 3) { |
| 668 o.cacheHit = true; |
| 669 o.totalBytesProcessed = "foo"; |
| 670 } |
| 671 buildCounterJobStatistics2--; |
| 672 return o; |
| 673 } |
| 674 |
| 675 checkJobStatistics2(api.JobStatistics2 o) { |
| 676 buildCounterJobStatistics2++; |
| 677 if (buildCounterJobStatistics2 < 3) { |
| 678 unittest.expect(o.cacheHit, unittest.isTrue); |
| 679 unittest.expect(o.totalBytesProcessed, unittest.equals('foo')); |
| 680 } |
| 681 buildCounterJobStatistics2--; |
| 682 } |
| 683 |
| 684 core.int buildCounterJobStatistics3 = 0; |
| 685 buildJobStatistics3() { |
| 686 var o = new api.JobStatistics3(); |
| 687 buildCounterJobStatistics3++; |
| 688 if (buildCounterJobStatistics3 < 3) { |
| 689 o.inputFileBytes = "foo"; |
| 690 o.inputFiles = "foo"; |
| 691 o.outputBytes = "foo"; |
| 692 o.outputRows = "foo"; |
| 693 } |
| 694 buildCounterJobStatistics3--; |
| 695 return o; |
| 696 } |
| 697 |
| 698 checkJobStatistics3(api.JobStatistics3 o) { |
| 699 buildCounterJobStatistics3++; |
| 700 if (buildCounterJobStatistics3 < 3) { |
| 701 unittest.expect(o.inputFileBytes, unittest.equals('foo')); |
| 702 unittest.expect(o.inputFiles, unittest.equals('foo')); |
| 703 unittest.expect(o.outputBytes, unittest.equals('foo')); |
| 704 unittest.expect(o.outputRows, unittest.equals('foo')); |
| 705 } |
| 706 buildCounterJobStatistics3--; |
| 707 } |
| 708 |
| 709 buildUnnamed1021() { |
| 710 var o = new core.List<api.ErrorProto>(); |
| 711 o.add(buildErrorProto()); |
| 712 o.add(buildErrorProto()); |
| 713 return o; |
| 714 } |
| 715 |
| 716 checkUnnamed1021(core.List<api.ErrorProto> o) { |
| 717 unittest.expect(o, unittest.hasLength(2)); |
| 718 checkErrorProto(o[0]); |
| 719 checkErrorProto(o[1]); |
| 720 } |
| 721 |
| 722 core.int buildCounterJobStatus = 0; |
| 723 buildJobStatus() { |
| 724 var o = new api.JobStatus(); |
| 725 buildCounterJobStatus++; |
| 726 if (buildCounterJobStatus < 3) { |
| 727 o.errorResult = buildErrorProto(); |
| 728 o.errors = buildUnnamed1021(); |
| 729 o.state = "foo"; |
| 730 } |
| 731 buildCounterJobStatus--; |
| 732 return o; |
| 733 } |
| 734 |
| 735 checkJobStatus(api.JobStatus o) { |
| 736 buildCounterJobStatus++; |
| 737 if (buildCounterJobStatus < 3) { |
| 738 checkErrorProto(o.errorResult); |
| 739 checkUnnamed1021(o.errors); |
| 740 unittest.expect(o.state, unittest.equals('foo')); |
| 741 } |
| 742 buildCounterJobStatus--; |
| 743 } |
| 744 |
| 745 buildJsonObject() { |
| 746 var o = new api.JsonObject(); |
| 747 o["a"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 748 o["b"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 749 return o; |
| 750 } |
| 751 |
| 752 checkJsonObject(api.JsonObject o) { |
| 753 unittest.expect(o, unittest.hasLength(2)); |
| 754 var casted1 = (o["a"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); |
| 755 var casted2 = (o["b"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); |
| 756 } |
| 757 |
| 758 core.int buildCounterProjectListProjects = 0; |
| 759 buildProjectListProjects() { |
| 760 var o = new api.ProjectListProjects(); |
| 761 buildCounterProjectListProjects++; |
| 762 if (buildCounterProjectListProjects < 3) { |
| 763 o.friendlyName = "foo"; |
| 764 o.id = "foo"; |
| 765 o.kind = "foo"; |
| 766 o.numericId = "foo"; |
| 767 o.projectReference = buildProjectReference(); |
| 768 } |
| 769 buildCounterProjectListProjects--; |
| 770 return o; |
| 771 } |
| 772 |
| 773 checkProjectListProjects(api.ProjectListProjects o) { |
| 774 buildCounterProjectListProjects++; |
| 775 if (buildCounterProjectListProjects < 3) { |
| 776 unittest.expect(o.friendlyName, unittest.equals('foo')); |
| 777 unittest.expect(o.id, unittest.equals('foo')); |
| 778 unittest.expect(o.kind, unittest.equals('foo')); |
| 779 unittest.expect(o.numericId, unittest.equals('foo')); |
| 780 checkProjectReference(o.projectReference); |
| 781 } |
| 782 buildCounterProjectListProjects--; |
| 783 } |
| 784 |
| 785 buildUnnamed1022() { |
| 786 var o = new core.List<api.ProjectListProjects>(); |
| 787 o.add(buildProjectListProjects()); |
| 788 o.add(buildProjectListProjects()); |
| 789 return o; |
| 790 } |
| 791 |
| 792 checkUnnamed1022(core.List<api.ProjectListProjects> o) { |
| 793 unittest.expect(o, unittest.hasLength(2)); |
| 794 checkProjectListProjects(o[0]); |
| 795 checkProjectListProjects(o[1]); |
| 796 } |
| 797 |
| 798 core.int buildCounterProjectList = 0; |
| 799 buildProjectList() { |
| 800 var o = new api.ProjectList(); |
| 801 buildCounterProjectList++; |
| 802 if (buildCounterProjectList < 3) { |
| 803 o.etag = "foo"; |
| 804 o.kind = "foo"; |
| 805 o.nextPageToken = "foo"; |
| 806 o.projects = buildUnnamed1022(); |
| 807 o.totalItems = 42; |
| 808 } |
| 809 buildCounterProjectList--; |
| 810 return o; |
| 811 } |
| 812 |
| 813 checkProjectList(api.ProjectList o) { |
| 814 buildCounterProjectList++; |
| 815 if (buildCounterProjectList < 3) { |
| 816 unittest.expect(o.etag, unittest.equals('foo')); |
| 817 unittest.expect(o.kind, unittest.equals('foo')); |
| 818 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 819 checkUnnamed1022(o.projects); |
| 820 unittest.expect(o.totalItems, unittest.equals(42)); |
| 821 } |
| 822 buildCounterProjectList--; |
| 823 } |
| 824 |
| 825 core.int buildCounterProjectReference = 0; |
| 826 buildProjectReference() { |
| 827 var o = new api.ProjectReference(); |
| 828 buildCounterProjectReference++; |
| 829 if (buildCounterProjectReference < 3) { |
| 830 o.projectId = "foo"; |
| 831 } |
| 832 buildCounterProjectReference--; |
| 833 return o; |
| 834 } |
| 835 |
| 836 checkProjectReference(api.ProjectReference o) { |
| 837 buildCounterProjectReference++; |
| 838 if (buildCounterProjectReference < 3) { |
| 839 unittest.expect(o.projectId, unittest.equals('foo')); |
| 840 } |
| 841 buildCounterProjectReference--; |
| 842 } |
| 843 |
| 844 core.int buildCounterQueryRequest = 0; |
| 845 buildQueryRequest() { |
| 846 var o = new api.QueryRequest(); |
| 847 buildCounterQueryRequest++; |
| 848 if (buildCounterQueryRequest < 3) { |
| 849 o.defaultDataset = buildDatasetReference(); |
| 850 o.dryRun = true; |
| 851 o.kind = "foo"; |
| 852 o.maxResults = 42; |
| 853 o.preserveNulls = true; |
| 854 o.query = "foo"; |
| 855 o.timeoutMs = 42; |
| 856 o.useQueryCache = true; |
| 857 } |
| 858 buildCounterQueryRequest--; |
| 859 return o; |
| 860 } |
| 861 |
| 862 checkQueryRequest(api.QueryRequest o) { |
| 863 buildCounterQueryRequest++; |
| 864 if (buildCounterQueryRequest < 3) { |
| 865 checkDatasetReference(o.defaultDataset); |
| 866 unittest.expect(o.dryRun, unittest.isTrue); |
| 867 unittest.expect(o.kind, unittest.equals('foo')); |
| 868 unittest.expect(o.maxResults, unittest.equals(42)); |
| 869 unittest.expect(o.preserveNulls, unittest.isTrue); |
| 870 unittest.expect(o.query, unittest.equals('foo')); |
| 871 unittest.expect(o.timeoutMs, unittest.equals(42)); |
| 872 unittest.expect(o.useQueryCache, unittest.isTrue); |
| 873 } |
| 874 buildCounterQueryRequest--; |
| 875 } |
| 876 |
| 877 buildUnnamed1023() { |
| 878 var o = new core.List<api.TableRow>(); |
| 879 o.add(buildTableRow()); |
| 880 o.add(buildTableRow()); |
| 881 return o; |
| 882 } |
| 883 |
| 884 checkUnnamed1023(core.List<api.TableRow> o) { |
| 885 unittest.expect(o, unittest.hasLength(2)); |
| 886 checkTableRow(o[0]); |
| 887 checkTableRow(o[1]); |
| 888 } |
| 889 |
| 890 core.int buildCounterQueryResponse = 0; |
| 891 buildQueryResponse() { |
| 892 var o = new api.QueryResponse(); |
| 893 buildCounterQueryResponse++; |
| 894 if (buildCounterQueryResponse < 3) { |
| 895 o.cacheHit = true; |
| 896 o.jobComplete = true; |
| 897 o.jobReference = buildJobReference(); |
| 898 o.kind = "foo"; |
| 899 o.pageToken = "foo"; |
| 900 o.rows = buildUnnamed1023(); |
| 901 o.schema = buildTableSchema(); |
| 902 o.totalBytesProcessed = "foo"; |
| 903 o.totalRows = "foo"; |
| 904 } |
| 905 buildCounterQueryResponse--; |
| 906 return o; |
| 907 } |
| 908 |
| 909 checkQueryResponse(api.QueryResponse o) { |
| 910 buildCounterQueryResponse++; |
| 911 if (buildCounterQueryResponse < 3) { |
| 912 unittest.expect(o.cacheHit, unittest.isTrue); |
| 913 unittest.expect(o.jobComplete, unittest.isTrue); |
| 914 checkJobReference(o.jobReference); |
| 915 unittest.expect(o.kind, unittest.equals('foo')); |
| 916 unittest.expect(o.pageToken, unittest.equals('foo')); |
| 917 checkUnnamed1023(o.rows); |
| 918 checkTableSchema(o.schema); |
| 919 unittest.expect(o.totalBytesProcessed, unittest.equals('foo')); |
| 920 unittest.expect(o.totalRows, unittest.equals('foo')); |
| 921 } |
| 922 buildCounterQueryResponse--; |
| 923 } |
| 924 |
| 925 core.int buildCounterTable = 0; |
| 926 buildTable() { |
| 927 var o = new api.Table(); |
| 928 buildCounterTable++; |
| 929 if (buildCounterTable < 3) { |
| 930 o.creationTime = "foo"; |
| 931 o.description = "foo"; |
| 932 o.etag = "foo"; |
| 933 o.expirationTime = "foo"; |
| 934 o.friendlyName = "foo"; |
| 935 o.id = "foo"; |
| 936 o.kind = "foo"; |
| 937 o.lastModifiedTime = "foo"; |
| 938 o.numBytes = "foo"; |
| 939 o.numRows = "foo"; |
| 940 o.schema = buildTableSchema(); |
| 941 o.selfLink = "foo"; |
| 942 o.tableReference = buildTableReference(); |
| 943 o.type = "foo"; |
| 944 o.view = buildViewDefinition(); |
| 945 } |
| 946 buildCounterTable--; |
| 947 return o; |
| 948 } |
| 949 |
| 950 checkTable(api.Table o) { |
| 951 buildCounterTable++; |
| 952 if (buildCounterTable < 3) { |
| 953 unittest.expect(o.creationTime, unittest.equals('foo')); |
| 954 unittest.expect(o.description, unittest.equals('foo')); |
| 955 unittest.expect(o.etag, unittest.equals('foo')); |
| 956 unittest.expect(o.expirationTime, unittest.equals('foo')); |
| 957 unittest.expect(o.friendlyName, unittest.equals('foo')); |
| 958 unittest.expect(o.id, unittest.equals('foo')); |
| 959 unittest.expect(o.kind, unittest.equals('foo')); |
| 960 unittest.expect(o.lastModifiedTime, unittest.equals('foo')); |
| 961 unittest.expect(o.numBytes, unittest.equals('foo')); |
| 962 unittest.expect(o.numRows, unittest.equals('foo')); |
| 963 checkTableSchema(o.schema); |
| 964 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 965 checkTableReference(o.tableReference); |
| 966 unittest.expect(o.type, unittest.equals('foo')); |
| 967 checkViewDefinition(o.view); |
| 968 } |
| 969 buildCounterTable--; |
| 970 } |
| 971 |
| 972 core.int buildCounterTableCell = 0; |
| 973 buildTableCell() { |
| 974 var o = new api.TableCell(); |
| 975 buildCounterTableCell++; |
| 976 if (buildCounterTableCell < 3) { |
| 977 o.v = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 978 } |
| 979 buildCounterTableCell--; |
| 980 return o; |
| 981 } |
| 982 |
| 983 checkTableCell(api.TableCell o) { |
| 984 buildCounterTableCell++; |
| 985 if (buildCounterTableCell < 3) { |
| 986 var casted3 = (o.v) as core.Map; unittest.expect(casted3, unittest.hasLength
(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.exp
ect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); |
| 987 } |
| 988 buildCounterTableCell--; |
| 989 } |
| 990 |
| 991 core.int buildCounterTableDataInsertAllRequestRows = 0; |
| 992 buildTableDataInsertAllRequestRows() { |
| 993 var o = new api.TableDataInsertAllRequestRows(); |
| 994 buildCounterTableDataInsertAllRequestRows++; |
| 995 if (buildCounterTableDataInsertAllRequestRows < 3) { |
| 996 o.insertId = "foo"; |
| 997 o.json = buildJsonObject(); |
| 998 } |
| 999 buildCounterTableDataInsertAllRequestRows--; |
| 1000 return o; |
| 1001 } |
| 1002 |
| 1003 checkTableDataInsertAllRequestRows(api.TableDataInsertAllRequestRows o) { |
| 1004 buildCounterTableDataInsertAllRequestRows++; |
| 1005 if (buildCounterTableDataInsertAllRequestRows < 3) { |
| 1006 unittest.expect(o.insertId, unittest.equals('foo')); |
| 1007 checkJsonObject(o.json); |
| 1008 } |
| 1009 buildCounterTableDataInsertAllRequestRows--; |
| 1010 } |
| 1011 |
| 1012 buildUnnamed1024() { |
| 1013 var o = new core.List<api.TableDataInsertAllRequestRows>(); |
| 1014 o.add(buildTableDataInsertAllRequestRows()); |
| 1015 o.add(buildTableDataInsertAllRequestRows()); |
| 1016 return o; |
| 1017 } |
| 1018 |
| 1019 checkUnnamed1024(core.List<api.TableDataInsertAllRequestRows> o) { |
| 1020 unittest.expect(o, unittest.hasLength(2)); |
| 1021 checkTableDataInsertAllRequestRows(o[0]); |
| 1022 checkTableDataInsertAllRequestRows(o[1]); |
| 1023 } |
| 1024 |
| 1025 core.int buildCounterTableDataInsertAllRequest = 0; |
| 1026 buildTableDataInsertAllRequest() { |
| 1027 var o = new api.TableDataInsertAllRequest(); |
| 1028 buildCounterTableDataInsertAllRequest++; |
| 1029 if (buildCounterTableDataInsertAllRequest < 3) { |
| 1030 o.kind = "foo"; |
| 1031 o.rows = buildUnnamed1024(); |
| 1032 } |
| 1033 buildCounterTableDataInsertAllRequest--; |
| 1034 return o; |
| 1035 } |
| 1036 |
| 1037 checkTableDataInsertAllRequest(api.TableDataInsertAllRequest o) { |
| 1038 buildCounterTableDataInsertAllRequest++; |
| 1039 if (buildCounterTableDataInsertAllRequest < 3) { |
| 1040 unittest.expect(o.kind, unittest.equals('foo')); |
| 1041 checkUnnamed1024(o.rows); |
| 1042 } |
| 1043 buildCounterTableDataInsertAllRequest--; |
| 1044 } |
| 1045 |
| 1046 buildUnnamed1025() { |
| 1047 var o = new core.List<api.ErrorProto>(); |
| 1048 o.add(buildErrorProto()); |
| 1049 o.add(buildErrorProto()); |
| 1050 return o; |
| 1051 } |
| 1052 |
| 1053 checkUnnamed1025(core.List<api.ErrorProto> o) { |
| 1054 unittest.expect(o, unittest.hasLength(2)); |
| 1055 checkErrorProto(o[0]); |
| 1056 checkErrorProto(o[1]); |
| 1057 } |
| 1058 |
| 1059 core.int buildCounterTableDataInsertAllResponseInsertErrors = 0; |
| 1060 buildTableDataInsertAllResponseInsertErrors() { |
| 1061 var o = new api.TableDataInsertAllResponseInsertErrors(); |
| 1062 buildCounterTableDataInsertAllResponseInsertErrors++; |
| 1063 if (buildCounterTableDataInsertAllResponseInsertErrors < 3) { |
| 1064 o.errors = buildUnnamed1025(); |
| 1065 o.index = 42; |
| 1066 } |
| 1067 buildCounterTableDataInsertAllResponseInsertErrors--; |
| 1068 return o; |
| 1069 } |
| 1070 |
| 1071 checkTableDataInsertAllResponseInsertErrors(api.TableDataInsertAllResponseInsert
Errors o) { |
| 1072 buildCounterTableDataInsertAllResponseInsertErrors++; |
| 1073 if (buildCounterTableDataInsertAllResponseInsertErrors < 3) { |
| 1074 checkUnnamed1025(o.errors); |
| 1075 unittest.expect(o.index, unittest.equals(42)); |
| 1076 } |
| 1077 buildCounterTableDataInsertAllResponseInsertErrors--; |
| 1078 } |
| 1079 |
| 1080 buildUnnamed1026() { |
| 1081 var o = new core.List<api.TableDataInsertAllResponseInsertErrors>(); |
| 1082 o.add(buildTableDataInsertAllResponseInsertErrors()); |
| 1083 o.add(buildTableDataInsertAllResponseInsertErrors()); |
| 1084 return o; |
| 1085 } |
| 1086 |
| 1087 checkUnnamed1026(core.List<api.TableDataInsertAllResponseInsertErrors> o) { |
| 1088 unittest.expect(o, unittest.hasLength(2)); |
| 1089 checkTableDataInsertAllResponseInsertErrors(o[0]); |
| 1090 checkTableDataInsertAllResponseInsertErrors(o[1]); |
| 1091 } |
| 1092 |
| 1093 core.int buildCounterTableDataInsertAllResponse = 0; |
| 1094 buildTableDataInsertAllResponse() { |
| 1095 var o = new api.TableDataInsertAllResponse(); |
| 1096 buildCounterTableDataInsertAllResponse++; |
| 1097 if (buildCounterTableDataInsertAllResponse < 3) { |
| 1098 o.insertErrors = buildUnnamed1026(); |
| 1099 o.kind = "foo"; |
| 1100 } |
| 1101 buildCounterTableDataInsertAllResponse--; |
| 1102 return o; |
| 1103 } |
| 1104 |
| 1105 checkTableDataInsertAllResponse(api.TableDataInsertAllResponse o) { |
| 1106 buildCounterTableDataInsertAllResponse++; |
| 1107 if (buildCounterTableDataInsertAllResponse < 3) { |
| 1108 checkUnnamed1026(o.insertErrors); |
| 1109 unittest.expect(o.kind, unittest.equals('foo')); |
| 1110 } |
| 1111 buildCounterTableDataInsertAllResponse--; |
| 1112 } |
| 1113 |
| 1114 buildUnnamed1027() { |
| 1115 var o = new core.List<api.TableRow>(); |
| 1116 o.add(buildTableRow()); |
| 1117 o.add(buildTableRow()); |
| 1118 return o; |
| 1119 } |
| 1120 |
| 1121 checkUnnamed1027(core.List<api.TableRow> o) { |
| 1122 unittest.expect(o, unittest.hasLength(2)); |
| 1123 checkTableRow(o[0]); |
| 1124 checkTableRow(o[1]); |
| 1125 } |
| 1126 |
| 1127 core.int buildCounterTableDataList = 0; |
| 1128 buildTableDataList() { |
| 1129 var o = new api.TableDataList(); |
| 1130 buildCounterTableDataList++; |
| 1131 if (buildCounterTableDataList < 3) { |
| 1132 o.etag = "foo"; |
| 1133 o.kind = "foo"; |
| 1134 o.pageToken = "foo"; |
| 1135 o.rows = buildUnnamed1027(); |
| 1136 o.totalRows = "foo"; |
| 1137 } |
| 1138 buildCounterTableDataList--; |
| 1139 return o; |
| 1140 } |
| 1141 |
| 1142 checkTableDataList(api.TableDataList o) { |
| 1143 buildCounterTableDataList++; |
| 1144 if (buildCounterTableDataList < 3) { |
| 1145 unittest.expect(o.etag, unittest.equals('foo')); |
| 1146 unittest.expect(o.kind, unittest.equals('foo')); |
| 1147 unittest.expect(o.pageToken, unittest.equals('foo')); |
| 1148 checkUnnamed1027(o.rows); |
| 1149 unittest.expect(o.totalRows, unittest.equals('foo')); |
| 1150 } |
| 1151 buildCounterTableDataList--; |
| 1152 } |
| 1153 |
| 1154 buildUnnamed1028() { |
| 1155 var o = new core.List<api.TableFieldSchema>(); |
| 1156 o.add(buildTableFieldSchema()); |
| 1157 o.add(buildTableFieldSchema()); |
| 1158 return o; |
| 1159 } |
| 1160 |
| 1161 checkUnnamed1028(core.List<api.TableFieldSchema> o) { |
| 1162 unittest.expect(o, unittest.hasLength(2)); |
| 1163 checkTableFieldSchema(o[0]); |
| 1164 checkTableFieldSchema(o[1]); |
| 1165 } |
| 1166 |
| 1167 core.int buildCounterTableFieldSchema = 0; |
| 1168 buildTableFieldSchema() { |
| 1169 var o = new api.TableFieldSchema(); |
| 1170 buildCounterTableFieldSchema++; |
| 1171 if (buildCounterTableFieldSchema < 3) { |
| 1172 o.description = "foo"; |
| 1173 o.fields = buildUnnamed1028(); |
| 1174 o.mode = "foo"; |
| 1175 o.name = "foo"; |
| 1176 o.type = "foo"; |
| 1177 } |
| 1178 buildCounterTableFieldSchema--; |
| 1179 return o; |
| 1180 } |
| 1181 |
| 1182 checkTableFieldSchema(api.TableFieldSchema o) { |
| 1183 buildCounterTableFieldSchema++; |
| 1184 if (buildCounterTableFieldSchema < 3) { |
| 1185 unittest.expect(o.description, unittest.equals('foo')); |
| 1186 checkUnnamed1028(o.fields); |
| 1187 unittest.expect(o.mode, unittest.equals('foo')); |
| 1188 unittest.expect(o.name, unittest.equals('foo')); |
| 1189 unittest.expect(o.type, unittest.equals('foo')); |
| 1190 } |
| 1191 buildCounterTableFieldSchema--; |
| 1192 } |
| 1193 |
| 1194 core.int buildCounterTableListTables = 0; |
| 1195 buildTableListTables() { |
| 1196 var o = new api.TableListTables(); |
| 1197 buildCounterTableListTables++; |
| 1198 if (buildCounterTableListTables < 3) { |
| 1199 o.friendlyName = "foo"; |
| 1200 o.id = "foo"; |
| 1201 o.kind = "foo"; |
| 1202 o.tableReference = buildTableReference(); |
| 1203 o.type = "foo"; |
| 1204 } |
| 1205 buildCounterTableListTables--; |
| 1206 return o; |
| 1207 } |
| 1208 |
| 1209 checkTableListTables(api.TableListTables o) { |
| 1210 buildCounterTableListTables++; |
| 1211 if (buildCounterTableListTables < 3) { |
| 1212 unittest.expect(o.friendlyName, unittest.equals('foo')); |
| 1213 unittest.expect(o.id, unittest.equals('foo')); |
| 1214 unittest.expect(o.kind, unittest.equals('foo')); |
| 1215 checkTableReference(o.tableReference); |
| 1216 unittest.expect(o.type, unittest.equals('foo')); |
| 1217 } |
| 1218 buildCounterTableListTables--; |
| 1219 } |
| 1220 |
| 1221 buildUnnamed1029() { |
| 1222 var o = new core.List<api.TableListTables>(); |
| 1223 o.add(buildTableListTables()); |
| 1224 o.add(buildTableListTables()); |
| 1225 return o; |
| 1226 } |
| 1227 |
| 1228 checkUnnamed1029(core.List<api.TableListTables> o) { |
| 1229 unittest.expect(o, unittest.hasLength(2)); |
| 1230 checkTableListTables(o[0]); |
| 1231 checkTableListTables(o[1]); |
| 1232 } |
| 1233 |
| 1234 core.int buildCounterTableList = 0; |
| 1235 buildTableList() { |
| 1236 var o = new api.TableList(); |
| 1237 buildCounterTableList++; |
| 1238 if (buildCounterTableList < 3) { |
| 1239 o.etag = "foo"; |
| 1240 o.kind = "foo"; |
| 1241 o.nextPageToken = "foo"; |
| 1242 o.tables = buildUnnamed1029(); |
| 1243 o.totalItems = 42; |
| 1244 } |
| 1245 buildCounterTableList--; |
| 1246 return o; |
| 1247 } |
| 1248 |
| 1249 checkTableList(api.TableList o) { |
| 1250 buildCounterTableList++; |
| 1251 if (buildCounterTableList < 3) { |
| 1252 unittest.expect(o.etag, unittest.equals('foo')); |
| 1253 unittest.expect(o.kind, unittest.equals('foo')); |
| 1254 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 1255 checkUnnamed1029(o.tables); |
| 1256 unittest.expect(o.totalItems, unittest.equals(42)); |
| 1257 } |
| 1258 buildCounterTableList--; |
| 1259 } |
| 1260 |
| 1261 core.int buildCounterTableReference = 0; |
| 1262 buildTableReference() { |
| 1263 var o = new api.TableReference(); |
| 1264 buildCounterTableReference++; |
| 1265 if (buildCounterTableReference < 3) { |
| 1266 o.datasetId = "foo"; |
| 1267 o.projectId = "foo"; |
| 1268 o.tableId = "foo"; |
| 1269 } |
| 1270 buildCounterTableReference--; |
| 1271 return o; |
| 1272 } |
| 1273 |
| 1274 checkTableReference(api.TableReference o) { |
| 1275 buildCounterTableReference++; |
| 1276 if (buildCounterTableReference < 3) { |
| 1277 unittest.expect(o.datasetId, unittest.equals('foo')); |
| 1278 unittest.expect(o.projectId, unittest.equals('foo')); |
| 1279 unittest.expect(o.tableId, unittest.equals('foo')); |
| 1280 } |
| 1281 buildCounterTableReference--; |
| 1282 } |
| 1283 |
| 1284 buildUnnamed1030() { |
| 1285 var o = new core.List<api.TableCell>(); |
| 1286 o.add(buildTableCell()); |
| 1287 o.add(buildTableCell()); |
| 1288 return o; |
| 1289 } |
| 1290 |
| 1291 checkUnnamed1030(core.List<api.TableCell> o) { |
| 1292 unittest.expect(o, unittest.hasLength(2)); |
| 1293 checkTableCell(o[0]); |
| 1294 checkTableCell(o[1]); |
| 1295 } |
| 1296 |
| 1297 core.int buildCounterTableRow = 0; |
| 1298 buildTableRow() { |
| 1299 var o = new api.TableRow(); |
| 1300 buildCounterTableRow++; |
| 1301 if (buildCounterTableRow < 3) { |
| 1302 o.f = buildUnnamed1030(); |
| 1303 } |
| 1304 buildCounterTableRow--; |
| 1305 return o; |
| 1306 } |
| 1307 |
| 1308 checkTableRow(api.TableRow o) { |
| 1309 buildCounterTableRow++; |
| 1310 if (buildCounterTableRow < 3) { |
| 1311 checkUnnamed1030(o.f); |
| 1312 } |
| 1313 buildCounterTableRow--; |
| 1314 } |
| 1315 |
| 1316 buildUnnamed1031() { |
| 1317 var o = new core.List<api.TableFieldSchema>(); |
| 1318 o.add(buildTableFieldSchema()); |
| 1319 o.add(buildTableFieldSchema()); |
| 1320 return o; |
| 1321 } |
| 1322 |
| 1323 checkUnnamed1031(core.List<api.TableFieldSchema> o) { |
| 1324 unittest.expect(o, unittest.hasLength(2)); |
| 1325 checkTableFieldSchema(o[0]); |
| 1326 checkTableFieldSchema(o[1]); |
| 1327 } |
| 1328 |
| 1329 core.int buildCounterTableSchema = 0; |
| 1330 buildTableSchema() { |
| 1331 var o = new api.TableSchema(); |
| 1332 buildCounterTableSchema++; |
| 1333 if (buildCounterTableSchema < 3) { |
| 1334 o.fields = buildUnnamed1031(); |
| 1335 } |
| 1336 buildCounterTableSchema--; |
| 1337 return o; |
| 1338 } |
| 1339 |
| 1340 checkTableSchema(api.TableSchema o) { |
| 1341 buildCounterTableSchema++; |
| 1342 if (buildCounterTableSchema < 3) { |
| 1343 checkUnnamed1031(o.fields); |
| 1344 } |
| 1345 buildCounterTableSchema--; |
| 1346 } |
| 1347 |
| 1348 core.int buildCounterViewDefinition = 0; |
| 1349 buildViewDefinition() { |
| 1350 var o = new api.ViewDefinition(); |
| 1351 buildCounterViewDefinition++; |
| 1352 if (buildCounterViewDefinition < 3) { |
| 1353 o.query = "foo"; |
| 1354 } |
| 1355 buildCounterViewDefinition--; |
| 1356 return o; |
| 1357 } |
| 1358 |
| 1359 checkViewDefinition(api.ViewDefinition o) { |
| 1360 buildCounterViewDefinition++; |
| 1361 if (buildCounterViewDefinition < 3) { |
| 1362 unittest.expect(o.query, unittest.equals('foo')); |
| 1363 } |
| 1364 buildCounterViewDefinition--; |
| 1365 } |
| 1366 |
| 1367 buildUnnamed1032() { |
| 1368 var o = new core.List<core.String>(); |
| 1369 o.add("foo"); |
| 1370 o.add("foo"); |
| 1371 return o; |
| 1372 } |
| 1373 |
| 1374 checkUnnamed1032(core.List<core.String> o) { |
| 1375 unittest.expect(o, unittest.hasLength(2)); |
| 1376 unittest.expect(o[0], unittest.equals('foo')); |
| 1377 unittest.expect(o[1], unittest.equals('foo')); |
| 1378 } |
| 1379 |
| 1380 |
| 1381 main() { |
| 1382 unittest.group("obj-schema-DatasetAccess", () { |
| 1383 unittest.test("to-json--from-json", () { |
| 1384 var o = buildDatasetAccess(); |
| 1385 var od = new api.DatasetAccess.fromJson(o.toJson()); |
| 1386 checkDatasetAccess(od); |
| 1387 }); |
| 1388 }); |
| 1389 |
| 1390 |
| 1391 unittest.group("obj-schema-Dataset", () { |
| 1392 unittest.test("to-json--from-json", () { |
| 1393 var o = buildDataset(); |
| 1394 var od = new api.Dataset.fromJson(o.toJson()); |
| 1395 checkDataset(od); |
| 1396 }); |
| 1397 }); |
| 1398 |
| 1399 |
| 1400 unittest.group("obj-schema-DatasetListDatasets", () { |
| 1401 unittest.test("to-json--from-json", () { |
| 1402 var o = buildDatasetListDatasets(); |
| 1403 var od = new api.DatasetListDatasets.fromJson(o.toJson()); |
| 1404 checkDatasetListDatasets(od); |
| 1405 }); |
| 1406 }); |
| 1407 |
| 1408 |
| 1409 unittest.group("obj-schema-DatasetList", () { |
| 1410 unittest.test("to-json--from-json", () { |
| 1411 var o = buildDatasetList(); |
| 1412 var od = new api.DatasetList.fromJson(o.toJson()); |
| 1413 checkDatasetList(od); |
| 1414 }); |
| 1415 }); |
| 1416 |
| 1417 |
| 1418 unittest.group("obj-schema-DatasetReference", () { |
| 1419 unittest.test("to-json--from-json", () { |
| 1420 var o = buildDatasetReference(); |
| 1421 var od = new api.DatasetReference.fromJson(o.toJson()); |
| 1422 checkDatasetReference(od); |
| 1423 }); |
| 1424 }); |
| 1425 |
| 1426 |
| 1427 unittest.group("obj-schema-ErrorProto", () { |
| 1428 unittest.test("to-json--from-json", () { |
| 1429 var o = buildErrorProto(); |
| 1430 var od = new api.ErrorProto.fromJson(o.toJson()); |
| 1431 checkErrorProto(od); |
| 1432 }); |
| 1433 }); |
| 1434 |
| 1435 |
| 1436 unittest.group("obj-schema-GetQueryResultsResponse", () { |
| 1437 unittest.test("to-json--from-json", () { |
| 1438 var o = buildGetQueryResultsResponse(); |
| 1439 var od = new api.GetQueryResultsResponse.fromJson(o.toJson()); |
| 1440 checkGetQueryResultsResponse(od); |
| 1441 }); |
| 1442 }); |
| 1443 |
| 1444 |
| 1445 unittest.group("obj-schema-Job", () { |
| 1446 unittest.test("to-json--from-json", () { |
| 1447 var o = buildJob(); |
| 1448 var od = new api.Job.fromJson(o.toJson()); |
| 1449 checkJob(od); |
| 1450 }); |
| 1451 }); |
| 1452 |
| 1453 |
| 1454 unittest.group("obj-schema-JobConfiguration", () { |
| 1455 unittest.test("to-json--from-json", () { |
| 1456 var o = buildJobConfiguration(); |
| 1457 var od = new api.JobConfiguration.fromJson(o.toJson()); |
| 1458 checkJobConfiguration(od); |
| 1459 }); |
| 1460 }); |
| 1461 |
| 1462 |
| 1463 unittest.group("obj-schema-JobConfigurationExtract", () { |
| 1464 unittest.test("to-json--from-json", () { |
| 1465 var o = buildJobConfigurationExtract(); |
| 1466 var od = new api.JobConfigurationExtract.fromJson(o.toJson()); |
| 1467 checkJobConfigurationExtract(od); |
| 1468 }); |
| 1469 }); |
| 1470 |
| 1471 |
| 1472 unittest.group("obj-schema-JobConfigurationLink", () { |
| 1473 unittest.test("to-json--from-json", () { |
| 1474 var o = buildJobConfigurationLink(); |
| 1475 var od = new api.JobConfigurationLink.fromJson(o.toJson()); |
| 1476 checkJobConfigurationLink(od); |
| 1477 }); |
| 1478 }); |
| 1479 |
| 1480 |
| 1481 unittest.group("obj-schema-JobConfigurationLoad", () { |
| 1482 unittest.test("to-json--from-json", () { |
| 1483 var o = buildJobConfigurationLoad(); |
| 1484 var od = new api.JobConfigurationLoad.fromJson(o.toJson()); |
| 1485 checkJobConfigurationLoad(od); |
| 1486 }); |
| 1487 }); |
| 1488 |
| 1489 |
| 1490 unittest.group("obj-schema-JobConfigurationQuery", () { |
| 1491 unittest.test("to-json--from-json", () { |
| 1492 var o = buildJobConfigurationQuery(); |
| 1493 var od = new api.JobConfigurationQuery.fromJson(o.toJson()); |
| 1494 checkJobConfigurationQuery(od); |
| 1495 }); |
| 1496 }); |
| 1497 |
| 1498 |
| 1499 unittest.group("obj-schema-JobConfigurationTableCopy", () { |
| 1500 unittest.test("to-json--from-json", () { |
| 1501 var o = buildJobConfigurationTableCopy(); |
| 1502 var od = new api.JobConfigurationTableCopy.fromJson(o.toJson()); |
| 1503 checkJobConfigurationTableCopy(od); |
| 1504 }); |
| 1505 }); |
| 1506 |
| 1507 |
| 1508 unittest.group("obj-schema-JobListJobs", () { |
| 1509 unittest.test("to-json--from-json", () { |
| 1510 var o = buildJobListJobs(); |
| 1511 var od = new api.JobListJobs.fromJson(o.toJson()); |
| 1512 checkJobListJobs(od); |
| 1513 }); |
| 1514 }); |
| 1515 |
| 1516 |
| 1517 unittest.group("obj-schema-JobList", () { |
| 1518 unittest.test("to-json--from-json", () { |
| 1519 var o = buildJobList(); |
| 1520 var od = new api.JobList.fromJson(o.toJson()); |
| 1521 checkJobList(od); |
| 1522 }); |
| 1523 }); |
| 1524 |
| 1525 |
| 1526 unittest.group("obj-schema-JobReference", () { |
| 1527 unittest.test("to-json--from-json", () { |
| 1528 var o = buildJobReference(); |
| 1529 var od = new api.JobReference.fromJson(o.toJson()); |
| 1530 checkJobReference(od); |
| 1531 }); |
| 1532 }); |
| 1533 |
| 1534 |
| 1535 unittest.group("obj-schema-JobStatistics", () { |
| 1536 unittest.test("to-json--from-json", () { |
| 1537 var o = buildJobStatistics(); |
| 1538 var od = new api.JobStatistics.fromJson(o.toJson()); |
| 1539 checkJobStatistics(od); |
| 1540 }); |
| 1541 }); |
| 1542 |
| 1543 |
| 1544 unittest.group("obj-schema-JobStatistics2", () { |
| 1545 unittest.test("to-json--from-json", () { |
| 1546 var o = buildJobStatistics2(); |
| 1547 var od = new api.JobStatistics2.fromJson(o.toJson()); |
| 1548 checkJobStatistics2(od); |
| 1549 }); |
| 1550 }); |
| 1551 |
| 1552 |
| 1553 unittest.group("obj-schema-JobStatistics3", () { |
| 1554 unittest.test("to-json--from-json", () { |
| 1555 var o = buildJobStatistics3(); |
| 1556 var od = new api.JobStatistics3.fromJson(o.toJson()); |
| 1557 checkJobStatistics3(od); |
| 1558 }); |
| 1559 }); |
| 1560 |
| 1561 |
| 1562 unittest.group("obj-schema-JobStatus", () { |
| 1563 unittest.test("to-json--from-json", () { |
| 1564 var o = buildJobStatus(); |
| 1565 var od = new api.JobStatus.fromJson(o.toJson()); |
| 1566 checkJobStatus(od); |
| 1567 }); |
| 1568 }); |
| 1569 |
| 1570 |
| 1571 unittest.group("obj-schema-JsonObject", () { |
| 1572 unittest.test("to-json--from-json", () { |
| 1573 var o = buildJsonObject(); |
| 1574 var od = new api.JsonObject.fromJson(o.toJson()); |
| 1575 checkJsonObject(od); |
| 1576 }); |
| 1577 }); |
| 1578 |
| 1579 |
| 1580 unittest.group("obj-schema-ProjectListProjects", () { |
| 1581 unittest.test("to-json--from-json", () { |
| 1582 var o = buildProjectListProjects(); |
| 1583 var od = new api.ProjectListProjects.fromJson(o.toJson()); |
| 1584 checkProjectListProjects(od); |
| 1585 }); |
| 1586 }); |
| 1587 |
| 1588 |
| 1589 unittest.group("obj-schema-ProjectList", () { |
| 1590 unittest.test("to-json--from-json", () { |
| 1591 var o = buildProjectList(); |
| 1592 var od = new api.ProjectList.fromJson(o.toJson()); |
| 1593 checkProjectList(od); |
| 1594 }); |
| 1595 }); |
| 1596 |
| 1597 |
| 1598 unittest.group("obj-schema-ProjectReference", () { |
| 1599 unittest.test("to-json--from-json", () { |
| 1600 var o = buildProjectReference(); |
| 1601 var od = new api.ProjectReference.fromJson(o.toJson()); |
| 1602 checkProjectReference(od); |
| 1603 }); |
| 1604 }); |
| 1605 |
| 1606 |
| 1607 unittest.group("obj-schema-QueryRequest", () { |
| 1608 unittest.test("to-json--from-json", () { |
| 1609 var o = buildQueryRequest(); |
| 1610 var od = new api.QueryRequest.fromJson(o.toJson()); |
| 1611 checkQueryRequest(od); |
| 1612 }); |
| 1613 }); |
| 1614 |
| 1615 |
| 1616 unittest.group("obj-schema-QueryResponse", () { |
| 1617 unittest.test("to-json--from-json", () { |
| 1618 var o = buildQueryResponse(); |
| 1619 var od = new api.QueryResponse.fromJson(o.toJson()); |
| 1620 checkQueryResponse(od); |
| 1621 }); |
| 1622 }); |
| 1623 |
| 1624 |
| 1625 unittest.group("obj-schema-Table", () { |
| 1626 unittest.test("to-json--from-json", () { |
| 1627 var o = buildTable(); |
| 1628 var od = new api.Table.fromJson(o.toJson()); |
| 1629 checkTable(od); |
| 1630 }); |
| 1631 }); |
| 1632 |
| 1633 |
| 1634 unittest.group("obj-schema-TableCell", () { |
| 1635 unittest.test("to-json--from-json", () { |
| 1636 var o = buildTableCell(); |
| 1637 var od = new api.TableCell.fromJson(o.toJson()); |
| 1638 checkTableCell(od); |
| 1639 }); |
| 1640 }); |
| 1641 |
| 1642 |
| 1643 unittest.group("obj-schema-TableDataInsertAllRequestRows", () { |
| 1644 unittest.test("to-json--from-json", () { |
| 1645 var o = buildTableDataInsertAllRequestRows(); |
| 1646 var od = new api.TableDataInsertAllRequestRows.fromJson(o.toJson()); |
| 1647 checkTableDataInsertAllRequestRows(od); |
| 1648 }); |
| 1649 }); |
| 1650 |
| 1651 |
| 1652 unittest.group("obj-schema-TableDataInsertAllRequest", () { |
| 1653 unittest.test("to-json--from-json", () { |
| 1654 var o = buildTableDataInsertAllRequest(); |
| 1655 var od = new api.TableDataInsertAllRequest.fromJson(o.toJson()); |
| 1656 checkTableDataInsertAllRequest(od); |
| 1657 }); |
| 1658 }); |
| 1659 |
| 1660 |
| 1661 unittest.group("obj-schema-TableDataInsertAllResponseInsertErrors", () { |
| 1662 unittest.test("to-json--from-json", () { |
| 1663 var o = buildTableDataInsertAllResponseInsertErrors(); |
| 1664 var od = new api.TableDataInsertAllResponseInsertErrors.fromJson(o.toJson(
)); |
| 1665 checkTableDataInsertAllResponseInsertErrors(od); |
| 1666 }); |
| 1667 }); |
| 1668 |
| 1669 |
| 1670 unittest.group("obj-schema-TableDataInsertAllResponse", () { |
| 1671 unittest.test("to-json--from-json", () { |
| 1672 var o = buildTableDataInsertAllResponse(); |
| 1673 var od = new api.TableDataInsertAllResponse.fromJson(o.toJson()); |
| 1674 checkTableDataInsertAllResponse(od); |
| 1675 }); |
| 1676 }); |
| 1677 |
| 1678 |
| 1679 unittest.group("obj-schema-TableDataList", () { |
| 1680 unittest.test("to-json--from-json", () { |
| 1681 var o = buildTableDataList(); |
| 1682 var od = new api.TableDataList.fromJson(o.toJson()); |
| 1683 checkTableDataList(od); |
| 1684 }); |
| 1685 }); |
| 1686 |
| 1687 |
| 1688 unittest.group("obj-schema-TableFieldSchema", () { |
| 1689 unittest.test("to-json--from-json", () { |
| 1690 var o = buildTableFieldSchema(); |
| 1691 var od = new api.TableFieldSchema.fromJson(o.toJson()); |
| 1692 checkTableFieldSchema(od); |
| 1693 }); |
| 1694 }); |
| 1695 |
| 1696 |
| 1697 unittest.group("obj-schema-TableListTables", () { |
| 1698 unittest.test("to-json--from-json", () { |
| 1699 var o = buildTableListTables(); |
| 1700 var od = new api.TableListTables.fromJson(o.toJson()); |
| 1701 checkTableListTables(od); |
| 1702 }); |
| 1703 }); |
| 1704 |
| 1705 |
| 1706 unittest.group("obj-schema-TableList", () { |
| 1707 unittest.test("to-json--from-json", () { |
| 1708 var o = buildTableList(); |
| 1709 var od = new api.TableList.fromJson(o.toJson()); |
| 1710 checkTableList(od); |
| 1711 }); |
| 1712 }); |
| 1713 |
| 1714 |
| 1715 unittest.group("obj-schema-TableReference", () { |
| 1716 unittest.test("to-json--from-json", () { |
| 1717 var o = buildTableReference(); |
| 1718 var od = new api.TableReference.fromJson(o.toJson()); |
| 1719 checkTableReference(od); |
| 1720 }); |
| 1721 }); |
| 1722 |
| 1723 |
| 1724 unittest.group("obj-schema-TableRow", () { |
| 1725 unittest.test("to-json--from-json", () { |
| 1726 var o = buildTableRow(); |
| 1727 var od = new api.TableRow.fromJson(o.toJson()); |
| 1728 checkTableRow(od); |
| 1729 }); |
| 1730 }); |
| 1731 |
| 1732 |
| 1733 unittest.group("obj-schema-TableSchema", () { |
| 1734 unittest.test("to-json--from-json", () { |
| 1735 var o = buildTableSchema(); |
| 1736 var od = new api.TableSchema.fromJson(o.toJson()); |
| 1737 checkTableSchema(od); |
| 1738 }); |
| 1739 }); |
| 1740 |
| 1741 |
| 1742 unittest.group("obj-schema-ViewDefinition", () { |
| 1743 unittest.test("to-json--from-json", () { |
| 1744 var o = buildViewDefinition(); |
| 1745 var od = new api.ViewDefinition.fromJson(o.toJson()); |
| 1746 checkViewDefinition(od); |
| 1747 }); |
| 1748 }); |
| 1749 |
| 1750 |
| 1751 unittest.group("resource-DatasetsResourceApi", () { |
| 1752 unittest.test("method--delete", () { |
| 1753 |
| 1754 var mock = new common_test.HttpServerMock(); |
| 1755 api.DatasetsResourceApi res = new api.BigqueryApi(mock).datasets; |
| 1756 var arg_projectId = "foo"; |
| 1757 var arg_datasetId = "foo"; |
| 1758 var arg_deleteContents = true; |
| 1759 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1760 var path = (req.url).path; |
| 1761 var pathOffset = 0; |
| 1762 var index; |
| 1763 var subPart; |
| 1764 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 1765 pathOffset += 13; |
| 1766 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 1767 pathOffset += 9; |
| 1768 index = path.indexOf("/datasets/", pathOffset); |
| 1769 unittest.expect(index >= 0, unittest.isTrue); |
| 1770 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1771 pathOffset = index; |
| 1772 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 1773 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datasets/")); |
| 1774 pathOffset += 10; |
| 1775 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1776 pathOffset = path.length; |
| 1777 unittest.expect(subPart, unittest.equals("$arg_datasetId")); |
| 1778 |
| 1779 var query = (req.url).query; |
| 1780 var queryOffset = 0; |
| 1781 var queryMap = {}; |
| 1782 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1783 parseBool(n) { |
| 1784 if (n == "true") return true; |
| 1785 if (n == "false") return false; |
| 1786 if (n == null) return null; |
| 1787 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1788 } |
| 1789 if (query.length > 0) { |
| 1790 for (var part in query.split("&")) { |
| 1791 var keyvalue = part.split("="); |
| 1792 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1793 } |
| 1794 } |
| 1795 unittest.expect(queryMap["deleteContents"].first, unittest.equals("$arg_
deleteContents")); |
| 1796 |
| 1797 |
| 1798 var h = { |
| 1799 "content-type" : "application/json; charset=utf-8", |
| 1800 }; |
| 1801 var resp = ""; |
| 1802 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 1803 }), true); |
| 1804 res.delete(arg_projectId, arg_datasetId, deleteContents: arg_deleteContent
s).then(unittest.expectAsync((_) {})); |
| 1805 }); |
| 1806 |
| 1807 unittest.test("method--get", () { |
| 1808 |
| 1809 var mock = new common_test.HttpServerMock(); |
| 1810 api.DatasetsResourceApi res = new api.BigqueryApi(mock).datasets; |
| 1811 var arg_projectId = "foo"; |
| 1812 var arg_datasetId = "foo"; |
| 1813 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1814 var path = (req.url).path; |
| 1815 var pathOffset = 0; |
| 1816 var index; |
| 1817 var subPart; |
| 1818 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 1819 pathOffset += 13; |
| 1820 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 1821 pathOffset += 9; |
| 1822 index = path.indexOf("/datasets/", pathOffset); |
| 1823 unittest.expect(index >= 0, unittest.isTrue); |
| 1824 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1825 pathOffset = index; |
| 1826 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 1827 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datasets/")); |
| 1828 pathOffset += 10; |
| 1829 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1830 pathOffset = path.length; |
| 1831 unittest.expect(subPart, unittest.equals("$arg_datasetId")); |
| 1832 |
| 1833 var query = (req.url).query; |
| 1834 var queryOffset = 0; |
| 1835 var queryMap = {}; |
| 1836 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1837 parseBool(n) { |
| 1838 if (n == "true") return true; |
| 1839 if (n == "false") return false; |
| 1840 if (n == null) return null; |
| 1841 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1842 } |
| 1843 if (query.length > 0) { |
| 1844 for (var part in query.split("&")) { |
| 1845 var keyvalue = part.split("="); |
| 1846 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1847 } |
| 1848 } |
| 1849 |
| 1850 |
| 1851 var h = { |
| 1852 "content-type" : "application/json; charset=utf-8", |
| 1853 }; |
| 1854 var resp = convert.JSON.encode(buildDataset()); |
| 1855 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 1856 }), true); |
| 1857 res.get(arg_projectId, arg_datasetId).then(unittest.expectAsync(((api.Data
set response) { |
| 1858 checkDataset(response); |
| 1859 }))); |
| 1860 }); |
| 1861 |
| 1862 unittest.test("method--insert", () { |
| 1863 |
| 1864 var mock = new common_test.HttpServerMock(); |
| 1865 api.DatasetsResourceApi res = new api.BigqueryApi(mock).datasets; |
| 1866 var arg_request = buildDataset(); |
| 1867 var arg_projectId = "foo"; |
| 1868 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1869 var obj = new api.Dataset.fromJson(json); |
| 1870 checkDataset(obj); |
| 1871 |
| 1872 var path = (req.url).path; |
| 1873 var pathOffset = 0; |
| 1874 var index; |
| 1875 var subPart; |
| 1876 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 1877 pathOffset += 13; |
| 1878 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 1879 pathOffset += 9; |
| 1880 index = path.indexOf("/datasets", pathOffset); |
| 1881 unittest.expect(index >= 0, unittest.isTrue); |
| 1882 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1883 pathOffset = index; |
| 1884 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 1885 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/datasets")); |
| 1886 pathOffset += 9; |
| 1887 |
| 1888 var query = (req.url).query; |
| 1889 var queryOffset = 0; |
| 1890 var queryMap = {}; |
| 1891 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1892 parseBool(n) { |
| 1893 if (n == "true") return true; |
| 1894 if (n == "false") return false; |
| 1895 if (n == null) return null; |
| 1896 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1897 } |
| 1898 if (query.length > 0) { |
| 1899 for (var part in query.split("&")) { |
| 1900 var keyvalue = part.split("="); |
| 1901 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1902 } |
| 1903 } |
| 1904 |
| 1905 |
| 1906 var h = { |
| 1907 "content-type" : "application/json; charset=utf-8", |
| 1908 }; |
| 1909 var resp = convert.JSON.encode(buildDataset()); |
| 1910 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 1911 }), true); |
| 1912 res.insert(arg_request, arg_projectId).then(unittest.expectAsync(((api.Dat
aset response) { |
| 1913 checkDataset(response); |
| 1914 }))); |
| 1915 }); |
| 1916 |
| 1917 unittest.test("method--list", () { |
| 1918 |
| 1919 var mock = new common_test.HttpServerMock(); |
| 1920 api.DatasetsResourceApi res = new api.BigqueryApi(mock).datasets; |
| 1921 var arg_projectId = "foo"; |
| 1922 var arg_all = true; |
| 1923 var arg_maxResults = 42; |
| 1924 var arg_pageToken = "foo"; |
| 1925 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1926 var path = (req.url).path; |
| 1927 var pathOffset = 0; |
| 1928 var index; |
| 1929 var subPart; |
| 1930 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 1931 pathOffset += 13; |
| 1932 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 1933 pathOffset += 9; |
| 1934 index = path.indexOf("/datasets", pathOffset); |
| 1935 unittest.expect(index >= 0, unittest.isTrue); |
| 1936 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1937 pathOffset = index; |
| 1938 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 1939 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/datasets")); |
| 1940 pathOffset += 9; |
| 1941 |
| 1942 var query = (req.url).query; |
| 1943 var queryOffset = 0; |
| 1944 var queryMap = {}; |
| 1945 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1946 parseBool(n) { |
| 1947 if (n == "true") return true; |
| 1948 if (n == "false") return false; |
| 1949 if (n == null) return null; |
| 1950 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1951 } |
| 1952 if (query.length > 0) { |
| 1953 for (var part in query.split("&")) { |
| 1954 var keyvalue = part.split("="); |
| 1955 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1956 } |
| 1957 } |
| 1958 unittest.expect(queryMap["all"].first, unittest.equals("$arg_all")); |
| 1959 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 1960 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1961 |
| 1962 |
| 1963 var h = { |
| 1964 "content-type" : "application/json; charset=utf-8", |
| 1965 }; |
| 1966 var resp = convert.JSON.encode(buildDatasetList()); |
| 1967 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 1968 }), true); |
| 1969 res.list(arg_projectId, all: arg_all, maxResults: arg_maxResults, pageToke
n: arg_pageToken).then(unittest.expectAsync(((api.DatasetList response) { |
| 1970 checkDatasetList(response); |
| 1971 }))); |
| 1972 }); |
| 1973 |
| 1974 unittest.test("method--patch", () { |
| 1975 |
| 1976 var mock = new common_test.HttpServerMock(); |
| 1977 api.DatasetsResourceApi res = new api.BigqueryApi(mock).datasets; |
| 1978 var arg_request = buildDataset(); |
| 1979 var arg_projectId = "foo"; |
| 1980 var arg_datasetId = "foo"; |
| 1981 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1982 var obj = new api.Dataset.fromJson(json); |
| 1983 checkDataset(obj); |
| 1984 |
| 1985 var path = (req.url).path; |
| 1986 var pathOffset = 0; |
| 1987 var index; |
| 1988 var subPart; |
| 1989 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 1990 pathOffset += 13; |
| 1991 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 1992 pathOffset += 9; |
| 1993 index = path.indexOf("/datasets/", pathOffset); |
| 1994 unittest.expect(index >= 0, unittest.isTrue); |
| 1995 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1996 pathOffset = index; |
| 1997 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 1998 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datasets/")); |
| 1999 pathOffset += 10; |
| 2000 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2001 pathOffset = path.length; |
| 2002 unittest.expect(subPart, unittest.equals("$arg_datasetId")); |
| 2003 |
| 2004 var query = (req.url).query; |
| 2005 var queryOffset = 0; |
| 2006 var queryMap = {}; |
| 2007 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2008 parseBool(n) { |
| 2009 if (n == "true") return true; |
| 2010 if (n == "false") return false; |
| 2011 if (n == null) return null; |
| 2012 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2013 } |
| 2014 if (query.length > 0) { |
| 2015 for (var part in query.split("&")) { |
| 2016 var keyvalue = part.split("="); |
| 2017 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2018 } |
| 2019 } |
| 2020 |
| 2021 |
| 2022 var h = { |
| 2023 "content-type" : "application/json; charset=utf-8", |
| 2024 }; |
| 2025 var resp = convert.JSON.encode(buildDataset()); |
| 2026 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2027 }), true); |
| 2028 res.patch(arg_request, arg_projectId, arg_datasetId).then(unittest.expectA
sync(((api.Dataset response) { |
| 2029 checkDataset(response); |
| 2030 }))); |
| 2031 }); |
| 2032 |
| 2033 unittest.test("method--update", () { |
| 2034 |
| 2035 var mock = new common_test.HttpServerMock(); |
| 2036 api.DatasetsResourceApi res = new api.BigqueryApi(mock).datasets; |
| 2037 var arg_request = buildDataset(); |
| 2038 var arg_projectId = "foo"; |
| 2039 var arg_datasetId = "foo"; |
| 2040 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2041 var obj = new api.Dataset.fromJson(json); |
| 2042 checkDataset(obj); |
| 2043 |
| 2044 var path = (req.url).path; |
| 2045 var pathOffset = 0; |
| 2046 var index; |
| 2047 var subPart; |
| 2048 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2049 pathOffset += 13; |
| 2050 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2051 pathOffset += 9; |
| 2052 index = path.indexOf("/datasets/", pathOffset); |
| 2053 unittest.expect(index >= 0, unittest.isTrue); |
| 2054 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2055 pathOffset = index; |
| 2056 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2057 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datasets/")); |
| 2058 pathOffset += 10; |
| 2059 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2060 pathOffset = path.length; |
| 2061 unittest.expect(subPart, unittest.equals("$arg_datasetId")); |
| 2062 |
| 2063 var query = (req.url).query; |
| 2064 var queryOffset = 0; |
| 2065 var queryMap = {}; |
| 2066 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2067 parseBool(n) { |
| 2068 if (n == "true") return true; |
| 2069 if (n == "false") return false; |
| 2070 if (n == null) return null; |
| 2071 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2072 } |
| 2073 if (query.length > 0) { |
| 2074 for (var part in query.split("&")) { |
| 2075 var keyvalue = part.split("="); |
| 2076 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2077 } |
| 2078 } |
| 2079 |
| 2080 |
| 2081 var h = { |
| 2082 "content-type" : "application/json; charset=utf-8", |
| 2083 }; |
| 2084 var resp = convert.JSON.encode(buildDataset()); |
| 2085 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2086 }), true); |
| 2087 res.update(arg_request, arg_projectId, arg_datasetId).then(unittest.expect
Async(((api.Dataset response) { |
| 2088 checkDataset(response); |
| 2089 }))); |
| 2090 }); |
| 2091 |
| 2092 }); |
| 2093 |
| 2094 |
| 2095 unittest.group("resource-JobsResourceApi", () { |
| 2096 unittest.test("method--get", () { |
| 2097 |
| 2098 var mock = new common_test.HttpServerMock(); |
| 2099 api.JobsResourceApi res = new api.BigqueryApi(mock).jobs; |
| 2100 var arg_projectId = "foo"; |
| 2101 var arg_jobId = "foo"; |
| 2102 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2103 var path = (req.url).path; |
| 2104 var pathOffset = 0; |
| 2105 var index; |
| 2106 var subPart; |
| 2107 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2108 pathOffset += 13; |
| 2109 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2110 pathOffset += 9; |
| 2111 index = path.indexOf("/jobs/", pathOffset); |
| 2112 unittest.expect(index >= 0, unittest.isTrue); |
| 2113 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2114 pathOffset = index; |
| 2115 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2116 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/jobs/")); |
| 2117 pathOffset += 6; |
| 2118 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2119 pathOffset = path.length; |
| 2120 unittest.expect(subPart, unittest.equals("$arg_jobId")); |
| 2121 |
| 2122 var query = (req.url).query; |
| 2123 var queryOffset = 0; |
| 2124 var queryMap = {}; |
| 2125 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2126 parseBool(n) { |
| 2127 if (n == "true") return true; |
| 2128 if (n == "false") return false; |
| 2129 if (n == null) return null; |
| 2130 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2131 } |
| 2132 if (query.length > 0) { |
| 2133 for (var part in query.split("&")) { |
| 2134 var keyvalue = part.split("="); |
| 2135 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2136 } |
| 2137 } |
| 2138 |
| 2139 |
| 2140 var h = { |
| 2141 "content-type" : "application/json; charset=utf-8", |
| 2142 }; |
| 2143 var resp = convert.JSON.encode(buildJob()); |
| 2144 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2145 }), true); |
| 2146 res.get(arg_projectId, arg_jobId).then(unittest.expectAsync(((api.Job resp
onse) { |
| 2147 checkJob(response); |
| 2148 }))); |
| 2149 }); |
| 2150 |
| 2151 unittest.test("method--getQueryResults", () { |
| 2152 |
| 2153 var mock = new common_test.HttpServerMock(); |
| 2154 api.JobsResourceApi res = new api.BigqueryApi(mock).jobs; |
| 2155 var arg_projectId = "foo"; |
| 2156 var arg_jobId = "foo"; |
| 2157 var arg_maxResults = 42; |
| 2158 var arg_pageToken = "foo"; |
| 2159 var arg_startIndex = "foo"; |
| 2160 var arg_timeoutMs = 42; |
| 2161 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2162 var path = (req.url).path; |
| 2163 var pathOffset = 0; |
| 2164 var index; |
| 2165 var subPart; |
| 2166 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2167 pathOffset += 13; |
| 2168 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2169 pathOffset += 9; |
| 2170 index = path.indexOf("/queries/", pathOffset); |
| 2171 unittest.expect(index >= 0, unittest.isTrue); |
| 2172 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2173 pathOffset = index; |
| 2174 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2175 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/queries/")); |
| 2176 pathOffset += 9; |
| 2177 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2178 pathOffset = path.length; |
| 2179 unittest.expect(subPart, unittest.equals("$arg_jobId")); |
| 2180 |
| 2181 var query = (req.url).query; |
| 2182 var queryOffset = 0; |
| 2183 var queryMap = {}; |
| 2184 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2185 parseBool(n) { |
| 2186 if (n == "true") return true; |
| 2187 if (n == "false") return false; |
| 2188 if (n == null) return null; |
| 2189 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2190 } |
| 2191 if (query.length > 0) { |
| 2192 for (var part in query.split("&")) { |
| 2193 var keyvalue = part.split("="); |
| 2194 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2195 } |
| 2196 } |
| 2197 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 2198 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2199 unittest.expect(queryMap["startIndex"].first, unittest.equals(arg_startI
ndex)); |
| 2200 unittest.expect(core.int.parse(queryMap["timeoutMs"].first), unittest.eq
uals(arg_timeoutMs)); |
| 2201 |
| 2202 |
| 2203 var h = { |
| 2204 "content-type" : "application/json; charset=utf-8", |
| 2205 }; |
| 2206 var resp = convert.JSON.encode(buildGetQueryResultsResponse()); |
| 2207 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2208 }), true); |
| 2209 res.getQueryResults(arg_projectId, arg_jobId, maxResults: arg_maxResults,
pageToken: arg_pageToken, startIndex: arg_startIndex, timeoutMs: arg_timeoutMs).
then(unittest.expectAsync(((api.GetQueryResultsResponse response) { |
| 2210 checkGetQueryResultsResponse(response); |
| 2211 }))); |
| 2212 }); |
| 2213 |
| 2214 unittest.test("method--insert", () { |
| 2215 // TODO: Implement tests for media upload; |
| 2216 // TODO: Implement tests for media download; |
| 2217 |
| 2218 var mock = new common_test.HttpServerMock(); |
| 2219 api.JobsResourceApi res = new api.BigqueryApi(mock).jobs; |
| 2220 var arg_request = buildJob(); |
| 2221 var arg_projectId = "foo"; |
| 2222 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2223 var obj = new api.Job.fromJson(json); |
| 2224 checkJob(obj); |
| 2225 |
| 2226 var path = (req.url).path; |
| 2227 var pathOffset = 0; |
| 2228 var index; |
| 2229 var subPart; |
| 2230 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2231 pathOffset += 13; |
| 2232 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2233 pathOffset += 9; |
| 2234 index = path.indexOf("/jobs", pathOffset); |
| 2235 unittest.expect(index >= 0, unittest.isTrue); |
| 2236 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2237 pathOffset = index; |
| 2238 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2239 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("/jobs")); |
| 2240 pathOffset += 5; |
| 2241 |
| 2242 var query = (req.url).query; |
| 2243 var queryOffset = 0; |
| 2244 var queryMap = {}; |
| 2245 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2246 parseBool(n) { |
| 2247 if (n == "true") return true; |
| 2248 if (n == "false") return false; |
| 2249 if (n == null) return null; |
| 2250 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2251 } |
| 2252 if (query.length > 0) { |
| 2253 for (var part in query.split("&")) { |
| 2254 var keyvalue = part.split("="); |
| 2255 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2256 } |
| 2257 } |
| 2258 |
| 2259 |
| 2260 var h = { |
| 2261 "content-type" : "application/json; charset=utf-8", |
| 2262 }; |
| 2263 var resp = convert.JSON.encode(buildJob()); |
| 2264 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2265 }), true); |
| 2266 res.insert(arg_request, arg_projectId).then(unittest.expectAsync(((api.Job
response) { |
| 2267 checkJob(response); |
| 2268 }))); |
| 2269 }); |
| 2270 |
| 2271 unittest.test("method--list", () { |
| 2272 |
| 2273 var mock = new common_test.HttpServerMock(); |
| 2274 api.JobsResourceApi res = new api.BigqueryApi(mock).jobs; |
| 2275 var arg_projectId = "foo"; |
| 2276 var arg_allUsers = true; |
| 2277 var arg_maxResults = 42; |
| 2278 var arg_pageToken = "foo"; |
| 2279 var arg_projection = "foo"; |
| 2280 var arg_stateFilter = buildUnnamed1032(); |
| 2281 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2282 var path = (req.url).path; |
| 2283 var pathOffset = 0; |
| 2284 var index; |
| 2285 var subPart; |
| 2286 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2287 pathOffset += 13; |
| 2288 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2289 pathOffset += 9; |
| 2290 index = path.indexOf("/jobs", pathOffset); |
| 2291 unittest.expect(index >= 0, unittest.isTrue); |
| 2292 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2293 pathOffset = index; |
| 2294 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2295 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("/jobs")); |
| 2296 pathOffset += 5; |
| 2297 |
| 2298 var query = (req.url).query; |
| 2299 var queryOffset = 0; |
| 2300 var queryMap = {}; |
| 2301 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2302 parseBool(n) { |
| 2303 if (n == "true") return true; |
| 2304 if (n == "false") return false; |
| 2305 if (n == null) return null; |
| 2306 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2307 } |
| 2308 if (query.length > 0) { |
| 2309 for (var part in query.split("&")) { |
| 2310 var keyvalue = part.split("="); |
| 2311 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2312 } |
| 2313 } |
| 2314 unittest.expect(queryMap["allUsers"].first, unittest.equals("$arg_allUse
rs")); |
| 2315 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 2316 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2317 unittest.expect(queryMap["projection"].first, unittest.equals(arg_projec
tion)); |
| 2318 unittest.expect(queryMap["stateFilter"], unittest.equals(arg_stateFilter
)); |
| 2319 |
| 2320 |
| 2321 var h = { |
| 2322 "content-type" : "application/json; charset=utf-8", |
| 2323 }; |
| 2324 var resp = convert.JSON.encode(buildJobList()); |
| 2325 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2326 }), true); |
| 2327 res.list(arg_projectId, allUsers: arg_allUsers, maxResults: arg_maxResults
, pageToken: arg_pageToken, projection: arg_projection, stateFilter: arg_stateFi
lter).then(unittest.expectAsync(((api.JobList response) { |
| 2328 checkJobList(response); |
| 2329 }))); |
| 2330 }); |
| 2331 |
| 2332 unittest.test("method--query", () { |
| 2333 |
| 2334 var mock = new common_test.HttpServerMock(); |
| 2335 api.JobsResourceApi res = new api.BigqueryApi(mock).jobs; |
| 2336 var arg_request = buildQueryRequest(); |
| 2337 var arg_projectId = "foo"; |
| 2338 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2339 var obj = new api.QueryRequest.fromJson(json); |
| 2340 checkQueryRequest(obj); |
| 2341 |
| 2342 var path = (req.url).path; |
| 2343 var pathOffset = 0; |
| 2344 var index; |
| 2345 var subPart; |
| 2346 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2347 pathOffset += 13; |
| 2348 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2349 pathOffset += 9; |
| 2350 index = path.indexOf("/queries", pathOffset); |
| 2351 unittest.expect(index >= 0, unittest.isTrue); |
| 2352 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2353 pathOffset = index; |
| 2354 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2355 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/queries")); |
| 2356 pathOffset += 8; |
| 2357 |
| 2358 var query = (req.url).query; |
| 2359 var queryOffset = 0; |
| 2360 var queryMap = {}; |
| 2361 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2362 parseBool(n) { |
| 2363 if (n == "true") return true; |
| 2364 if (n == "false") return false; |
| 2365 if (n == null) return null; |
| 2366 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2367 } |
| 2368 if (query.length > 0) { |
| 2369 for (var part in query.split("&")) { |
| 2370 var keyvalue = part.split("="); |
| 2371 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2372 } |
| 2373 } |
| 2374 |
| 2375 |
| 2376 var h = { |
| 2377 "content-type" : "application/json; charset=utf-8", |
| 2378 }; |
| 2379 var resp = convert.JSON.encode(buildQueryResponse()); |
| 2380 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2381 }), true); |
| 2382 res.query(arg_request, arg_projectId).then(unittest.expectAsync(((api.Quer
yResponse response) { |
| 2383 checkQueryResponse(response); |
| 2384 }))); |
| 2385 }); |
| 2386 |
| 2387 }); |
| 2388 |
| 2389 |
| 2390 unittest.group("resource-ProjectsResourceApi", () { |
| 2391 unittest.test("method--list", () { |
| 2392 |
| 2393 var mock = new common_test.HttpServerMock(); |
| 2394 api.ProjectsResourceApi res = new api.BigqueryApi(mock).projects; |
| 2395 var arg_maxResults = 42; |
| 2396 var arg_pageToken = "foo"; |
| 2397 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2398 var path = (req.url).path; |
| 2399 var pathOffset = 0; |
| 2400 var index; |
| 2401 var subPart; |
| 2402 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2403 pathOffset += 13; |
| 2404 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("projects")); |
| 2405 pathOffset += 8; |
| 2406 |
| 2407 var query = (req.url).query; |
| 2408 var queryOffset = 0; |
| 2409 var queryMap = {}; |
| 2410 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2411 parseBool(n) { |
| 2412 if (n == "true") return true; |
| 2413 if (n == "false") return false; |
| 2414 if (n == null) return null; |
| 2415 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2416 } |
| 2417 if (query.length > 0) { |
| 2418 for (var part in query.split("&")) { |
| 2419 var keyvalue = part.split("="); |
| 2420 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2421 } |
| 2422 } |
| 2423 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 2424 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2425 |
| 2426 |
| 2427 var h = { |
| 2428 "content-type" : "application/json; charset=utf-8", |
| 2429 }; |
| 2430 var resp = convert.JSON.encode(buildProjectList()); |
| 2431 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2432 }), true); |
| 2433 res.list(maxResults: arg_maxResults, pageToken: arg_pageToken).then(unitte
st.expectAsync(((api.ProjectList response) { |
| 2434 checkProjectList(response); |
| 2435 }))); |
| 2436 }); |
| 2437 |
| 2438 }); |
| 2439 |
| 2440 |
| 2441 unittest.group("resource-TabledataResourceApi", () { |
| 2442 unittest.test("method--insertAll", () { |
| 2443 |
| 2444 var mock = new common_test.HttpServerMock(); |
| 2445 api.TabledataResourceApi res = new api.BigqueryApi(mock).tabledata; |
| 2446 var arg_request = buildTableDataInsertAllRequest(); |
| 2447 var arg_projectId = "foo"; |
| 2448 var arg_datasetId = "foo"; |
| 2449 var arg_tableId = "foo"; |
| 2450 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2451 var obj = new api.TableDataInsertAllRequest.fromJson(json); |
| 2452 checkTableDataInsertAllRequest(obj); |
| 2453 |
| 2454 var path = (req.url).path; |
| 2455 var pathOffset = 0; |
| 2456 var index; |
| 2457 var subPart; |
| 2458 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2459 pathOffset += 13; |
| 2460 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2461 pathOffset += 9; |
| 2462 index = path.indexOf("/datasets/", pathOffset); |
| 2463 unittest.expect(index >= 0, unittest.isTrue); |
| 2464 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2465 pathOffset = index; |
| 2466 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2467 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datasets/")); |
| 2468 pathOffset += 10; |
| 2469 index = path.indexOf("/tables/", pathOffset); |
| 2470 unittest.expect(index >= 0, unittest.isTrue); |
| 2471 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2472 pathOffset = index; |
| 2473 unittest.expect(subPart, unittest.equals("$arg_datasetId")); |
| 2474 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/tables/")); |
| 2475 pathOffset += 8; |
| 2476 index = path.indexOf("/insertAll", pathOffset); |
| 2477 unittest.expect(index >= 0, unittest.isTrue); |
| 2478 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2479 pathOffset = index; |
| 2480 unittest.expect(subPart, unittest.equals("$arg_tableId")); |
| 2481 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/insertAll")); |
| 2482 pathOffset += 10; |
| 2483 |
| 2484 var query = (req.url).query; |
| 2485 var queryOffset = 0; |
| 2486 var queryMap = {}; |
| 2487 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2488 parseBool(n) { |
| 2489 if (n == "true") return true; |
| 2490 if (n == "false") return false; |
| 2491 if (n == null) return null; |
| 2492 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2493 } |
| 2494 if (query.length > 0) { |
| 2495 for (var part in query.split("&")) { |
| 2496 var keyvalue = part.split("="); |
| 2497 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2498 } |
| 2499 } |
| 2500 |
| 2501 |
| 2502 var h = { |
| 2503 "content-type" : "application/json; charset=utf-8", |
| 2504 }; |
| 2505 var resp = convert.JSON.encode(buildTableDataInsertAllResponse()); |
| 2506 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2507 }), true); |
| 2508 res.insertAll(arg_request, arg_projectId, arg_datasetId, arg_tableId).then
(unittest.expectAsync(((api.TableDataInsertAllResponse response) { |
| 2509 checkTableDataInsertAllResponse(response); |
| 2510 }))); |
| 2511 }); |
| 2512 |
| 2513 unittest.test("method--list", () { |
| 2514 |
| 2515 var mock = new common_test.HttpServerMock(); |
| 2516 api.TabledataResourceApi res = new api.BigqueryApi(mock).tabledata; |
| 2517 var arg_projectId = "foo"; |
| 2518 var arg_datasetId = "foo"; |
| 2519 var arg_tableId = "foo"; |
| 2520 var arg_maxResults = 42; |
| 2521 var arg_pageToken = "foo"; |
| 2522 var arg_startIndex = "foo"; |
| 2523 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2524 var path = (req.url).path; |
| 2525 var pathOffset = 0; |
| 2526 var index; |
| 2527 var subPart; |
| 2528 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2529 pathOffset += 13; |
| 2530 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2531 pathOffset += 9; |
| 2532 index = path.indexOf("/datasets/", pathOffset); |
| 2533 unittest.expect(index >= 0, unittest.isTrue); |
| 2534 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2535 pathOffset = index; |
| 2536 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2537 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datasets/")); |
| 2538 pathOffset += 10; |
| 2539 index = path.indexOf("/tables/", pathOffset); |
| 2540 unittest.expect(index >= 0, unittest.isTrue); |
| 2541 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2542 pathOffset = index; |
| 2543 unittest.expect(subPart, unittest.equals("$arg_datasetId")); |
| 2544 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/tables/")); |
| 2545 pathOffset += 8; |
| 2546 index = path.indexOf("/data", pathOffset); |
| 2547 unittest.expect(index >= 0, unittest.isTrue); |
| 2548 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2549 pathOffset = index; |
| 2550 unittest.expect(subPart, unittest.equals("$arg_tableId")); |
| 2551 unittest.expect(path.substring(pathOffset, pathOffset + 5), unittest.equ
als("/data")); |
| 2552 pathOffset += 5; |
| 2553 |
| 2554 var query = (req.url).query; |
| 2555 var queryOffset = 0; |
| 2556 var queryMap = {}; |
| 2557 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2558 parseBool(n) { |
| 2559 if (n == "true") return true; |
| 2560 if (n == "false") return false; |
| 2561 if (n == null) return null; |
| 2562 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2563 } |
| 2564 if (query.length > 0) { |
| 2565 for (var part in query.split("&")) { |
| 2566 var keyvalue = part.split("="); |
| 2567 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2568 } |
| 2569 } |
| 2570 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 2571 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2572 unittest.expect(queryMap["startIndex"].first, unittest.equals(arg_startI
ndex)); |
| 2573 |
| 2574 |
| 2575 var h = { |
| 2576 "content-type" : "application/json; charset=utf-8", |
| 2577 }; |
| 2578 var resp = convert.JSON.encode(buildTableDataList()); |
| 2579 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2580 }), true); |
| 2581 res.list(arg_projectId, arg_datasetId, arg_tableId, maxResults: arg_maxRes
ults, pageToken: arg_pageToken, startIndex: arg_startIndex).then(unittest.expect
Async(((api.TableDataList response) { |
| 2582 checkTableDataList(response); |
| 2583 }))); |
| 2584 }); |
| 2585 |
| 2586 }); |
| 2587 |
| 2588 |
| 2589 unittest.group("resource-TablesResourceApi", () { |
| 2590 unittest.test("method--delete", () { |
| 2591 |
| 2592 var mock = new common_test.HttpServerMock(); |
| 2593 api.TablesResourceApi res = new api.BigqueryApi(mock).tables; |
| 2594 var arg_projectId = "foo"; |
| 2595 var arg_datasetId = "foo"; |
| 2596 var arg_tableId = "foo"; |
| 2597 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2598 var path = (req.url).path; |
| 2599 var pathOffset = 0; |
| 2600 var index; |
| 2601 var subPart; |
| 2602 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2603 pathOffset += 13; |
| 2604 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2605 pathOffset += 9; |
| 2606 index = path.indexOf("/datasets/", pathOffset); |
| 2607 unittest.expect(index >= 0, unittest.isTrue); |
| 2608 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2609 pathOffset = index; |
| 2610 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2611 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datasets/")); |
| 2612 pathOffset += 10; |
| 2613 index = path.indexOf("/tables/", pathOffset); |
| 2614 unittest.expect(index >= 0, unittest.isTrue); |
| 2615 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2616 pathOffset = index; |
| 2617 unittest.expect(subPart, unittest.equals("$arg_datasetId")); |
| 2618 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/tables/")); |
| 2619 pathOffset += 8; |
| 2620 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2621 pathOffset = path.length; |
| 2622 unittest.expect(subPart, unittest.equals("$arg_tableId")); |
| 2623 |
| 2624 var query = (req.url).query; |
| 2625 var queryOffset = 0; |
| 2626 var queryMap = {}; |
| 2627 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2628 parseBool(n) { |
| 2629 if (n == "true") return true; |
| 2630 if (n == "false") return false; |
| 2631 if (n == null) return null; |
| 2632 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2633 } |
| 2634 if (query.length > 0) { |
| 2635 for (var part in query.split("&")) { |
| 2636 var keyvalue = part.split("="); |
| 2637 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2638 } |
| 2639 } |
| 2640 |
| 2641 |
| 2642 var h = { |
| 2643 "content-type" : "application/json; charset=utf-8", |
| 2644 }; |
| 2645 var resp = ""; |
| 2646 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2647 }), true); |
| 2648 res.delete(arg_projectId, arg_datasetId, arg_tableId).then(unittest.expect
Async((_) {})); |
| 2649 }); |
| 2650 |
| 2651 unittest.test("method--get", () { |
| 2652 |
| 2653 var mock = new common_test.HttpServerMock(); |
| 2654 api.TablesResourceApi res = new api.BigqueryApi(mock).tables; |
| 2655 var arg_projectId = "foo"; |
| 2656 var arg_datasetId = "foo"; |
| 2657 var arg_tableId = "foo"; |
| 2658 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2659 var path = (req.url).path; |
| 2660 var pathOffset = 0; |
| 2661 var index; |
| 2662 var subPart; |
| 2663 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2664 pathOffset += 13; |
| 2665 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2666 pathOffset += 9; |
| 2667 index = path.indexOf("/datasets/", pathOffset); |
| 2668 unittest.expect(index >= 0, unittest.isTrue); |
| 2669 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2670 pathOffset = index; |
| 2671 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2672 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datasets/")); |
| 2673 pathOffset += 10; |
| 2674 index = path.indexOf("/tables/", pathOffset); |
| 2675 unittest.expect(index >= 0, unittest.isTrue); |
| 2676 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2677 pathOffset = index; |
| 2678 unittest.expect(subPart, unittest.equals("$arg_datasetId")); |
| 2679 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/tables/")); |
| 2680 pathOffset += 8; |
| 2681 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2682 pathOffset = path.length; |
| 2683 unittest.expect(subPart, unittest.equals("$arg_tableId")); |
| 2684 |
| 2685 var query = (req.url).query; |
| 2686 var queryOffset = 0; |
| 2687 var queryMap = {}; |
| 2688 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2689 parseBool(n) { |
| 2690 if (n == "true") return true; |
| 2691 if (n == "false") return false; |
| 2692 if (n == null) return null; |
| 2693 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2694 } |
| 2695 if (query.length > 0) { |
| 2696 for (var part in query.split("&")) { |
| 2697 var keyvalue = part.split("="); |
| 2698 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2699 } |
| 2700 } |
| 2701 |
| 2702 |
| 2703 var h = { |
| 2704 "content-type" : "application/json; charset=utf-8", |
| 2705 }; |
| 2706 var resp = convert.JSON.encode(buildTable()); |
| 2707 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2708 }), true); |
| 2709 res.get(arg_projectId, arg_datasetId, arg_tableId).then(unittest.expectAsy
nc(((api.Table response) { |
| 2710 checkTable(response); |
| 2711 }))); |
| 2712 }); |
| 2713 |
| 2714 unittest.test("method--insert", () { |
| 2715 |
| 2716 var mock = new common_test.HttpServerMock(); |
| 2717 api.TablesResourceApi res = new api.BigqueryApi(mock).tables; |
| 2718 var arg_request = buildTable(); |
| 2719 var arg_projectId = "foo"; |
| 2720 var arg_datasetId = "foo"; |
| 2721 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2722 var obj = new api.Table.fromJson(json); |
| 2723 checkTable(obj); |
| 2724 |
| 2725 var path = (req.url).path; |
| 2726 var pathOffset = 0; |
| 2727 var index; |
| 2728 var subPart; |
| 2729 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2730 pathOffset += 13; |
| 2731 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2732 pathOffset += 9; |
| 2733 index = path.indexOf("/datasets/", pathOffset); |
| 2734 unittest.expect(index >= 0, unittest.isTrue); |
| 2735 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2736 pathOffset = index; |
| 2737 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2738 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datasets/")); |
| 2739 pathOffset += 10; |
| 2740 index = path.indexOf("/tables", pathOffset); |
| 2741 unittest.expect(index >= 0, unittest.isTrue); |
| 2742 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2743 pathOffset = index; |
| 2744 unittest.expect(subPart, unittest.equals("$arg_datasetId")); |
| 2745 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/tables")); |
| 2746 pathOffset += 7; |
| 2747 |
| 2748 var query = (req.url).query; |
| 2749 var queryOffset = 0; |
| 2750 var queryMap = {}; |
| 2751 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2752 parseBool(n) { |
| 2753 if (n == "true") return true; |
| 2754 if (n == "false") return false; |
| 2755 if (n == null) return null; |
| 2756 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2757 } |
| 2758 if (query.length > 0) { |
| 2759 for (var part in query.split("&")) { |
| 2760 var keyvalue = part.split("="); |
| 2761 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2762 } |
| 2763 } |
| 2764 |
| 2765 |
| 2766 var h = { |
| 2767 "content-type" : "application/json; charset=utf-8", |
| 2768 }; |
| 2769 var resp = convert.JSON.encode(buildTable()); |
| 2770 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2771 }), true); |
| 2772 res.insert(arg_request, arg_projectId, arg_datasetId).then(unittest.expect
Async(((api.Table response) { |
| 2773 checkTable(response); |
| 2774 }))); |
| 2775 }); |
| 2776 |
| 2777 unittest.test("method--list", () { |
| 2778 |
| 2779 var mock = new common_test.HttpServerMock(); |
| 2780 api.TablesResourceApi res = new api.BigqueryApi(mock).tables; |
| 2781 var arg_projectId = "foo"; |
| 2782 var arg_datasetId = "foo"; |
| 2783 var arg_maxResults = 42; |
| 2784 var arg_pageToken = "foo"; |
| 2785 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2786 var path = (req.url).path; |
| 2787 var pathOffset = 0; |
| 2788 var index; |
| 2789 var subPart; |
| 2790 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2791 pathOffset += 13; |
| 2792 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2793 pathOffset += 9; |
| 2794 index = path.indexOf("/datasets/", pathOffset); |
| 2795 unittest.expect(index >= 0, unittest.isTrue); |
| 2796 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2797 pathOffset = index; |
| 2798 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2799 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datasets/")); |
| 2800 pathOffset += 10; |
| 2801 index = path.indexOf("/tables", pathOffset); |
| 2802 unittest.expect(index >= 0, unittest.isTrue); |
| 2803 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2804 pathOffset = index; |
| 2805 unittest.expect(subPart, unittest.equals("$arg_datasetId")); |
| 2806 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/tables")); |
| 2807 pathOffset += 7; |
| 2808 |
| 2809 var query = (req.url).query; |
| 2810 var queryOffset = 0; |
| 2811 var queryMap = {}; |
| 2812 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2813 parseBool(n) { |
| 2814 if (n == "true") return true; |
| 2815 if (n == "false") return false; |
| 2816 if (n == null) return null; |
| 2817 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2818 } |
| 2819 if (query.length > 0) { |
| 2820 for (var part in query.split("&")) { |
| 2821 var keyvalue = part.split("="); |
| 2822 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2823 } |
| 2824 } |
| 2825 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 2826 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2827 |
| 2828 |
| 2829 var h = { |
| 2830 "content-type" : "application/json; charset=utf-8", |
| 2831 }; |
| 2832 var resp = convert.JSON.encode(buildTableList()); |
| 2833 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2834 }), true); |
| 2835 res.list(arg_projectId, arg_datasetId, maxResults: arg_maxResults, pageTok
en: arg_pageToken).then(unittest.expectAsync(((api.TableList response) { |
| 2836 checkTableList(response); |
| 2837 }))); |
| 2838 }); |
| 2839 |
| 2840 unittest.test("method--patch", () { |
| 2841 |
| 2842 var mock = new common_test.HttpServerMock(); |
| 2843 api.TablesResourceApi res = new api.BigqueryApi(mock).tables; |
| 2844 var arg_request = buildTable(); |
| 2845 var arg_projectId = "foo"; |
| 2846 var arg_datasetId = "foo"; |
| 2847 var arg_tableId = "foo"; |
| 2848 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2849 var obj = new api.Table.fromJson(json); |
| 2850 checkTable(obj); |
| 2851 |
| 2852 var path = (req.url).path; |
| 2853 var pathOffset = 0; |
| 2854 var index; |
| 2855 var subPart; |
| 2856 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2857 pathOffset += 13; |
| 2858 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2859 pathOffset += 9; |
| 2860 index = path.indexOf("/datasets/", pathOffset); |
| 2861 unittest.expect(index >= 0, unittest.isTrue); |
| 2862 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2863 pathOffset = index; |
| 2864 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2865 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datasets/")); |
| 2866 pathOffset += 10; |
| 2867 index = path.indexOf("/tables/", pathOffset); |
| 2868 unittest.expect(index >= 0, unittest.isTrue); |
| 2869 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2870 pathOffset = index; |
| 2871 unittest.expect(subPart, unittest.equals("$arg_datasetId")); |
| 2872 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/tables/")); |
| 2873 pathOffset += 8; |
| 2874 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2875 pathOffset = path.length; |
| 2876 unittest.expect(subPart, unittest.equals("$arg_tableId")); |
| 2877 |
| 2878 var query = (req.url).query; |
| 2879 var queryOffset = 0; |
| 2880 var queryMap = {}; |
| 2881 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2882 parseBool(n) { |
| 2883 if (n == "true") return true; |
| 2884 if (n == "false") return false; |
| 2885 if (n == null) return null; |
| 2886 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2887 } |
| 2888 if (query.length > 0) { |
| 2889 for (var part in query.split("&")) { |
| 2890 var keyvalue = part.split("="); |
| 2891 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2892 } |
| 2893 } |
| 2894 |
| 2895 |
| 2896 var h = { |
| 2897 "content-type" : "application/json; charset=utf-8", |
| 2898 }; |
| 2899 var resp = convert.JSON.encode(buildTable()); |
| 2900 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2901 }), true); |
| 2902 res.patch(arg_request, arg_projectId, arg_datasetId, arg_tableId).then(uni
ttest.expectAsync(((api.Table response) { |
| 2903 checkTable(response); |
| 2904 }))); |
| 2905 }); |
| 2906 |
| 2907 unittest.test("method--update", () { |
| 2908 |
| 2909 var mock = new common_test.HttpServerMock(); |
| 2910 api.TablesResourceApi res = new api.BigqueryApi(mock).tables; |
| 2911 var arg_request = buildTable(); |
| 2912 var arg_projectId = "foo"; |
| 2913 var arg_datasetId = "foo"; |
| 2914 var arg_tableId = "foo"; |
| 2915 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2916 var obj = new api.Table.fromJson(json); |
| 2917 checkTable(obj); |
| 2918 |
| 2919 var path = (req.url).path; |
| 2920 var pathOffset = 0; |
| 2921 var index; |
| 2922 var subPart; |
| 2923 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/bigquery/v2/")); |
| 2924 pathOffset += 13; |
| 2925 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("projects/")); |
| 2926 pathOffset += 9; |
| 2927 index = path.indexOf("/datasets/", pathOffset); |
| 2928 unittest.expect(index >= 0, unittest.isTrue); |
| 2929 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2930 pathOffset = index; |
| 2931 unittest.expect(subPart, unittest.equals("$arg_projectId")); |
| 2932 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/datasets/")); |
| 2933 pathOffset += 10; |
| 2934 index = path.indexOf("/tables/", pathOffset); |
| 2935 unittest.expect(index >= 0, unittest.isTrue); |
| 2936 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2937 pathOffset = index; |
| 2938 unittest.expect(subPart, unittest.equals("$arg_datasetId")); |
| 2939 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/tables/")); |
| 2940 pathOffset += 8; |
| 2941 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2942 pathOffset = path.length; |
| 2943 unittest.expect(subPart, unittest.equals("$arg_tableId")); |
| 2944 |
| 2945 var query = (req.url).query; |
| 2946 var queryOffset = 0; |
| 2947 var queryMap = {}; |
| 2948 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2949 parseBool(n) { |
| 2950 if (n == "true") return true; |
| 2951 if (n == "false") return false; |
| 2952 if (n == null) return null; |
| 2953 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2954 } |
| 2955 if (query.length > 0) { |
| 2956 for (var part in query.split("&")) { |
| 2957 var keyvalue = part.split("="); |
| 2958 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2959 } |
| 2960 } |
| 2961 |
| 2962 |
| 2963 var h = { |
| 2964 "content-type" : "application/json; charset=utf-8", |
| 2965 }; |
| 2966 var resp = convert.JSON.encode(buildTable()); |
| 2967 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2968 }), true); |
| 2969 res.update(arg_request, arg_projectId, arg_datasetId, arg_tableId).then(un
ittest.expectAsync(((api.Table response) { |
| 2970 checkTable(response); |
| 2971 }))); |
| 2972 }); |
| 2973 |
| 2974 }); |
| 2975 |
| 2976 |
| 2977 } |
| 2978 |
OLD | NEW |