OLD | NEW |
(Empty) | |
| 1 library googleapis.dfareporting.v1_3.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/dfareporting/v1_3.dart' as api; |
| 16 |
| 17 |
| 18 |
| 19 buildUnnamed211() { |
| 20 var o = new core.List<api.DimensionValue>(); |
| 21 o.add(buildDimensionValue()); |
| 22 o.add(buildDimensionValue()); |
| 23 return o; |
| 24 } |
| 25 |
| 26 checkUnnamed211(core.List<api.DimensionValue> o) { |
| 27 unittest.expect(o, unittest.hasLength(2)); |
| 28 checkDimensionValue(o[0]); |
| 29 checkDimensionValue(o[1]); |
| 30 } |
| 31 |
| 32 buildUnnamed212() { |
| 33 var o = new core.List<core.String>(); |
| 34 o.add("foo"); |
| 35 o.add("foo"); |
| 36 return o; |
| 37 } |
| 38 |
| 39 checkUnnamed212(core.List<core.String> o) { |
| 40 unittest.expect(o, unittest.hasLength(2)); |
| 41 unittest.expect(o[0], unittest.equals('foo')); |
| 42 unittest.expect(o[1], unittest.equals('foo')); |
| 43 } |
| 44 |
| 45 core.int buildCounterActivities = 0; |
| 46 buildActivities() { |
| 47 var o = new api.Activities(); |
| 48 buildCounterActivities++; |
| 49 if (buildCounterActivities < 3) { |
| 50 o.filters = buildUnnamed211(); |
| 51 o.kind = "foo"; |
| 52 o.metricNames = buildUnnamed212(); |
| 53 } |
| 54 buildCounterActivities--; |
| 55 return o; |
| 56 } |
| 57 |
| 58 checkActivities(api.Activities o) { |
| 59 buildCounterActivities++; |
| 60 if (buildCounterActivities < 3) { |
| 61 checkUnnamed211(o.filters); |
| 62 unittest.expect(o.kind, unittest.equals('foo')); |
| 63 checkUnnamed212(o.metricNames); |
| 64 } |
| 65 buildCounterActivities--; |
| 66 } |
| 67 |
| 68 core.int buildCounterCompatibleFields = 0; |
| 69 buildCompatibleFields() { |
| 70 var o = new api.CompatibleFields(); |
| 71 buildCounterCompatibleFields++; |
| 72 if (buildCounterCompatibleFields < 3) { |
| 73 o.crossDimensionReachReportCompatibleFields = buildCrossDimensionReachReport
CompatibleFields(); |
| 74 o.floodlightReportCompatibleFields = buildFloodlightReportCompatibleFields()
; |
| 75 o.kind = "foo"; |
| 76 o.pathToConversionReportCompatibleFields = buildPathToConversionReportCompat
ibleFields(); |
| 77 o.reachReportCompatibleFields = buildReachReportCompatibleFields(); |
| 78 o.reportCompatibleFields = buildReportCompatibleFields(); |
| 79 } |
| 80 buildCounterCompatibleFields--; |
| 81 return o; |
| 82 } |
| 83 |
| 84 checkCompatibleFields(api.CompatibleFields o) { |
| 85 buildCounterCompatibleFields++; |
| 86 if (buildCounterCompatibleFields < 3) { |
| 87 checkCrossDimensionReachReportCompatibleFields(o.crossDimensionReachReportCo
mpatibleFields); |
| 88 checkFloodlightReportCompatibleFields(o.floodlightReportCompatibleFields); |
| 89 unittest.expect(o.kind, unittest.equals('foo')); |
| 90 checkPathToConversionReportCompatibleFields(o.pathToConversionReportCompatib
leFields); |
| 91 checkReachReportCompatibleFields(o.reachReportCompatibleFields); |
| 92 checkReportCompatibleFields(o.reportCompatibleFields); |
| 93 } |
| 94 buildCounterCompatibleFields--; |
| 95 } |
| 96 |
| 97 buildUnnamed213() { |
| 98 var o = new core.List<api.Dimension>(); |
| 99 o.add(buildDimension()); |
| 100 o.add(buildDimension()); |
| 101 return o; |
| 102 } |
| 103 |
| 104 checkUnnamed213(core.List<api.Dimension> o) { |
| 105 unittest.expect(o, unittest.hasLength(2)); |
| 106 checkDimension(o[0]); |
| 107 checkDimension(o[1]); |
| 108 } |
| 109 |
| 110 buildUnnamed214() { |
| 111 var o = new core.List<api.Dimension>(); |
| 112 o.add(buildDimension()); |
| 113 o.add(buildDimension()); |
| 114 return o; |
| 115 } |
| 116 |
| 117 checkUnnamed214(core.List<api.Dimension> o) { |
| 118 unittest.expect(o, unittest.hasLength(2)); |
| 119 checkDimension(o[0]); |
| 120 checkDimension(o[1]); |
| 121 } |
| 122 |
| 123 buildUnnamed215() { |
| 124 var o = new core.List<api.Metric>(); |
| 125 o.add(buildMetric()); |
| 126 o.add(buildMetric()); |
| 127 return o; |
| 128 } |
| 129 |
| 130 checkUnnamed215(core.List<api.Metric> o) { |
| 131 unittest.expect(o, unittest.hasLength(2)); |
| 132 checkMetric(o[0]); |
| 133 checkMetric(o[1]); |
| 134 } |
| 135 |
| 136 buildUnnamed216() { |
| 137 var o = new core.List<api.Metric>(); |
| 138 o.add(buildMetric()); |
| 139 o.add(buildMetric()); |
| 140 return o; |
| 141 } |
| 142 |
| 143 checkUnnamed216(core.List<api.Metric> o) { |
| 144 unittest.expect(o, unittest.hasLength(2)); |
| 145 checkMetric(o[0]); |
| 146 checkMetric(o[1]); |
| 147 } |
| 148 |
| 149 core.int buildCounterCrossDimensionReachReportCompatibleFields = 0; |
| 150 buildCrossDimensionReachReportCompatibleFields() { |
| 151 var o = new api.CrossDimensionReachReportCompatibleFields(); |
| 152 buildCounterCrossDimensionReachReportCompatibleFields++; |
| 153 if (buildCounterCrossDimensionReachReportCompatibleFields < 3) { |
| 154 o.breakdown = buildUnnamed213(); |
| 155 o.dimensionFilters = buildUnnamed214(); |
| 156 o.kind = "foo"; |
| 157 o.metrics = buildUnnamed215(); |
| 158 o.overlapMetrics = buildUnnamed216(); |
| 159 } |
| 160 buildCounterCrossDimensionReachReportCompatibleFields--; |
| 161 return o; |
| 162 } |
| 163 |
| 164 checkCrossDimensionReachReportCompatibleFields(api.CrossDimensionReachReportComp
atibleFields o) { |
| 165 buildCounterCrossDimensionReachReportCompatibleFields++; |
| 166 if (buildCounterCrossDimensionReachReportCompatibleFields < 3) { |
| 167 checkUnnamed213(o.breakdown); |
| 168 checkUnnamed214(o.dimensionFilters); |
| 169 unittest.expect(o.kind, unittest.equals('foo')); |
| 170 checkUnnamed215(o.metrics); |
| 171 checkUnnamed216(o.overlapMetrics); |
| 172 } |
| 173 buildCounterCrossDimensionReachReportCompatibleFields--; |
| 174 } |
| 175 |
| 176 buildUnnamed217() { |
| 177 var o = new core.List<api.DimensionValue>(); |
| 178 o.add(buildDimensionValue()); |
| 179 o.add(buildDimensionValue()); |
| 180 return o; |
| 181 } |
| 182 |
| 183 checkUnnamed217(core.List<api.DimensionValue> o) { |
| 184 unittest.expect(o, unittest.hasLength(2)); |
| 185 checkDimensionValue(o[0]); |
| 186 checkDimensionValue(o[1]); |
| 187 } |
| 188 |
| 189 core.int buildCounterCustomRichMediaEvents = 0; |
| 190 buildCustomRichMediaEvents() { |
| 191 var o = new api.CustomRichMediaEvents(); |
| 192 buildCounterCustomRichMediaEvents++; |
| 193 if (buildCounterCustomRichMediaEvents < 3) { |
| 194 o.filteredEventIds = buildUnnamed217(); |
| 195 o.kind = "foo"; |
| 196 } |
| 197 buildCounterCustomRichMediaEvents--; |
| 198 return o; |
| 199 } |
| 200 |
| 201 checkCustomRichMediaEvents(api.CustomRichMediaEvents o) { |
| 202 buildCounterCustomRichMediaEvents++; |
| 203 if (buildCounterCustomRichMediaEvents < 3) { |
| 204 checkUnnamed217(o.filteredEventIds); |
| 205 unittest.expect(o.kind, unittest.equals('foo')); |
| 206 } |
| 207 buildCounterCustomRichMediaEvents--; |
| 208 } |
| 209 |
| 210 core.int buildCounterDateRange = 0; |
| 211 buildDateRange() { |
| 212 var o = new api.DateRange(); |
| 213 buildCounterDateRange++; |
| 214 if (buildCounterDateRange < 3) { |
| 215 o.endDate = core.DateTime.parse("2002-02-27T14:01:02Z"); |
| 216 o.kind = "foo"; |
| 217 o.relativeDateRange = "foo"; |
| 218 o.startDate = core.DateTime.parse("2002-02-27T14:01:02Z"); |
| 219 } |
| 220 buildCounterDateRange--; |
| 221 return o; |
| 222 } |
| 223 |
| 224 checkDateRange(api.DateRange o) { |
| 225 buildCounterDateRange++; |
| 226 if (buildCounterDateRange < 3) { |
| 227 unittest.expect(o.endDate, unittest.equals(core.DateTime.parse("2002-02-27T0
0:00:00"))); |
| 228 unittest.expect(o.kind, unittest.equals('foo')); |
| 229 unittest.expect(o.relativeDateRange, unittest.equals('foo')); |
| 230 unittest.expect(o.startDate, unittest.equals(core.DateTime.parse("2002-02-27
T00:00:00"))); |
| 231 } |
| 232 buildCounterDateRange--; |
| 233 } |
| 234 |
| 235 core.int buildCounterDimension = 0; |
| 236 buildDimension() { |
| 237 var o = new api.Dimension(); |
| 238 buildCounterDimension++; |
| 239 if (buildCounterDimension < 3) { |
| 240 o.kind = "foo"; |
| 241 o.name = "foo"; |
| 242 } |
| 243 buildCounterDimension--; |
| 244 return o; |
| 245 } |
| 246 |
| 247 checkDimension(api.Dimension o) { |
| 248 buildCounterDimension++; |
| 249 if (buildCounterDimension < 3) { |
| 250 unittest.expect(o.kind, unittest.equals('foo')); |
| 251 unittest.expect(o.name, unittest.equals('foo')); |
| 252 } |
| 253 buildCounterDimension--; |
| 254 } |
| 255 |
| 256 core.int buildCounterDimensionFilter = 0; |
| 257 buildDimensionFilter() { |
| 258 var o = new api.DimensionFilter(); |
| 259 buildCounterDimensionFilter++; |
| 260 if (buildCounterDimensionFilter < 3) { |
| 261 o.dimensionName = "foo"; |
| 262 o.kind = "foo"; |
| 263 o.value = "foo"; |
| 264 } |
| 265 buildCounterDimensionFilter--; |
| 266 return o; |
| 267 } |
| 268 |
| 269 checkDimensionFilter(api.DimensionFilter o) { |
| 270 buildCounterDimensionFilter++; |
| 271 if (buildCounterDimensionFilter < 3) { |
| 272 unittest.expect(o.dimensionName, unittest.equals('foo')); |
| 273 unittest.expect(o.kind, unittest.equals('foo')); |
| 274 unittest.expect(o.value, unittest.equals('foo')); |
| 275 } |
| 276 buildCounterDimensionFilter--; |
| 277 } |
| 278 |
| 279 core.int buildCounterDimensionValue = 0; |
| 280 buildDimensionValue() { |
| 281 var o = new api.DimensionValue(); |
| 282 buildCounterDimensionValue++; |
| 283 if (buildCounterDimensionValue < 3) { |
| 284 o.dimensionName = "foo"; |
| 285 o.etag = "foo"; |
| 286 o.id = "foo"; |
| 287 o.kind = "foo"; |
| 288 o.matchType = "foo"; |
| 289 o.value = "foo"; |
| 290 } |
| 291 buildCounterDimensionValue--; |
| 292 return o; |
| 293 } |
| 294 |
| 295 checkDimensionValue(api.DimensionValue o) { |
| 296 buildCounterDimensionValue++; |
| 297 if (buildCounterDimensionValue < 3) { |
| 298 unittest.expect(o.dimensionName, unittest.equals('foo')); |
| 299 unittest.expect(o.etag, unittest.equals('foo')); |
| 300 unittest.expect(o.id, unittest.equals('foo')); |
| 301 unittest.expect(o.kind, unittest.equals('foo')); |
| 302 unittest.expect(o.matchType, unittest.equals('foo')); |
| 303 unittest.expect(o.value, unittest.equals('foo')); |
| 304 } |
| 305 buildCounterDimensionValue--; |
| 306 } |
| 307 |
| 308 buildUnnamed218() { |
| 309 var o = new core.List<api.DimensionValue>(); |
| 310 o.add(buildDimensionValue()); |
| 311 o.add(buildDimensionValue()); |
| 312 return o; |
| 313 } |
| 314 |
| 315 checkUnnamed218(core.List<api.DimensionValue> o) { |
| 316 unittest.expect(o, unittest.hasLength(2)); |
| 317 checkDimensionValue(o[0]); |
| 318 checkDimensionValue(o[1]); |
| 319 } |
| 320 |
| 321 core.int buildCounterDimensionValueList = 0; |
| 322 buildDimensionValueList() { |
| 323 var o = new api.DimensionValueList(); |
| 324 buildCounterDimensionValueList++; |
| 325 if (buildCounterDimensionValueList < 3) { |
| 326 o.etag = "foo"; |
| 327 o.items = buildUnnamed218(); |
| 328 o.kind = "foo"; |
| 329 o.nextPageToken = "foo"; |
| 330 } |
| 331 buildCounterDimensionValueList--; |
| 332 return o; |
| 333 } |
| 334 |
| 335 checkDimensionValueList(api.DimensionValueList o) { |
| 336 buildCounterDimensionValueList++; |
| 337 if (buildCounterDimensionValueList < 3) { |
| 338 unittest.expect(o.etag, unittest.equals('foo')); |
| 339 checkUnnamed218(o.items); |
| 340 unittest.expect(o.kind, unittest.equals('foo')); |
| 341 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 342 } |
| 343 buildCounterDimensionValueList--; |
| 344 } |
| 345 |
| 346 buildUnnamed219() { |
| 347 var o = new core.List<api.DimensionFilter>(); |
| 348 o.add(buildDimensionFilter()); |
| 349 o.add(buildDimensionFilter()); |
| 350 return o; |
| 351 } |
| 352 |
| 353 checkUnnamed219(core.List<api.DimensionFilter> o) { |
| 354 unittest.expect(o, unittest.hasLength(2)); |
| 355 checkDimensionFilter(o[0]); |
| 356 checkDimensionFilter(o[1]); |
| 357 } |
| 358 |
| 359 core.int buildCounterDimensionValueRequest = 0; |
| 360 buildDimensionValueRequest() { |
| 361 var o = new api.DimensionValueRequest(); |
| 362 buildCounterDimensionValueRequest++; |
| 363 if (buildCounterDimensionValueRequest < 3) { |
| 364 o.dimensionName = "foo"; |
| 365 o.endDate = core.DateTime.parse("2002-02-27T14:01:02Z"); |
| 366 o.filters = buildUnnamed219(); |
| 367 o.kind = "foo"; |
| 368 o.startDate = core.DateTime.parse("2002-02-27T14:01:02Z"); |
| 369 } |
| 370 buildCounterDimensionValueRequest--; |
| 371 return o; |
| 372 } |
| 373 |
| 374 checkDimensionValueRequest(api.DimensionValueRequest o) { |
| 375 buildCounterDimensionValueRequest++; |
| 376 if (buildCounterDimensionValueRequest < 3) { |
| 377 unittest.expect(o.dimensionName, unittest.equals('foo')); |
| 378 unittest.expect(o.endDate, unittest.equals(core.DateTime.parse("2002-02-27T0
0:00:00"))); |
| 379 checkUnnamed219(o.filters); |
| 380 unittest.expect(o.kind, unittest.equals('foo')); |
| 381 unittest.expect(o.startDate, unittest.equals(core.DateTime.parse("2002-02-27
T00:00:00"))); |
| 382 } |
| 383 buildCounterDimensionValueRequest--; |
| 384 } |
| 385 |
| 386 core.int buildCounterFileUrls = 0; |
| 387 buildFileUrls() { |
| 388 var o = new api.FileUrls(); |
| 389 buildCounterFileUrls++; |
| 390 if (buildCounterFileUrls < 3) { |
| 391 o.apiUrl = "foo"; |
| 392 o.browserUrl = "foo"; |
| 393 } |
| 394 buildCounterFileUrls--; |
| 395 return o; |
| 396 } |
| 397 |
| 398 checkFileUrls(api.FileUrls o) { |
| 399 buildCounterFileUrls++; |
| 400 if (buildCounterFileUrls < 3) { |
| 401 unittest.expect(o.apiUrl, unittest.equals('foo')); |
| 402 unittest.expect(o.browserUrl, unittest.equals('foo')); |
| 403 } |
| 404 buildCounterFileUrls--; |
| 405 } |
| 406 |
| 407 core.int buildCounterFile = 0; |
| 408 buildFile() { |
| 409 var o = new api.File(); |
| 410 buildCounterFile++; |
| 411 if (buildCounterFile < 3) { |
| 412 o.dateRange = buildDateRange(); |
| 413 o.etag = "foo"; |
| 414 o.fileName = "foo"; |
| 415 o.format = "foo"; |
| 416 o.id = "foo"; |
| 417 o.kind = "foo"; |
| 418 o.lastModifiedTime = "foo"; |
| 419 o.reportId = "foo"; |
| 420 o.status = "foo"; |
| 421 o.urls = buildFileUrls(); |
| 422 } |
| 423 buildCounterFile--; |
| 424 return o; |
| 425 } |
| 426 |
| 427 checkFile(api.File o) { |
| 428 buildCounterFile++; |
| 429 if (buildCounterFile < 3) { |
| 430 checkDateRange(o.dateRange); |
| 431 unittest.expect(o.etag, unittest.equals('foo')); |
| 432 unittest.expect(o.fileName, unittest.equals('foo')); |
| 433 unittest.expect(o.format, unittest.equals('foo')); |
| 434 unittest.expect(o.id, unittest.equals('foo')); |
| 435 unittest.expect(o.kind, unittest.equals('foo')); |
| 436 unittest.expect(o.lastModifiedTime, unittest.equals('foo')); |
| 437 unittest.expect(o.reportId, unittest.equals('foo')); |
| 438 unittest.expect(o.status, unittest.equals('foo')); |
| 439 checkFileUrls(o.urls); |
| 440 } |
| 441 buildCounterFile--; |
| 442 } |
| 443 |
| 444 buildUnnamed220() { |
| 445 var o = new core.List<api.File>(); |
| 446 o.add(buildFile()); |
| 447 o.add(buildFile()); |
| 448 return o; |
| 449 } |
| 450 |
| 451 checkUnnamed220(core.List<api.File> o) { |
| 452 unittest.expect(o, unittest.hasLength(2)); |
| 453 checkFile(o[0]); |
| 454 checkFile(o[1]); |
| 455 } |
| 456 |
| 457 core.int buildCounterFileList = 0; |
| 458 buildFileList() { |
| 459 var o = new api.FileList(); |
| 460 buildCounterFileList++; |
| 461 if (buildCounterFileList < 3) { |
| 462 o.etag = "foo"; |
| 463 o.items = buildUnnamed220(); |
| 464 o.kind = "foo"; |
| 465 o.nextPageToken = "foo"; |
| 466 } |
| 467 buildCounterFileList--; |
| 468 return o; |
| 469 } |
| 470 |
| 471 checkFileList(api.FileList o) { |
| 472 buildCounterFileList++; |
| 473 if (buildCounterFileList < 3) { |
| 474 unittest.expect(o.etag, unittest.equals('foo')); |
| 475 checkUnnamed220(o.items); |
| 476 unittest.expect(o.kind, unittest.equals('foo')); |
| 477 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 478 } |
| 479 buildCounterFileList--; |
| 480 } |
| 481 |
| 482 buildUnnamed221() { |
| 483 var o = new core.List<api.Dimension>(); |
| 484 o.add(buildDimension()); |
| 485 o.add(buildDimension()); |
| 486 return o; |
| 487 } |
| 488 |
| 489 checkUnnamed221(core.List<api.Dimension> o) { |
| 490 unittest.expect(o, unittest.hasLength(2)); |
| 491 checkDimension(o[0]); |
| 492 checkDimension(o[1]); |
| 493 } |
| 494 |
| 495 buildUnnamed222() { |
| 496 var o = new core.List<api.Dimension>(); |
| 497 o.add(buildDimension()); |
| 498 o.add(buildDimension()); |
| 499 return o; |
| 500 } |
| 501 |
| 502 checkUnnamed222(core.List<api.Dimension> o) { |
| 503 unittest.expect(o, unittest.hasLength(2)); |
| 504 checkDimension(o[0]); |
| 505 checkDimension(o[1]); |
| 506 } |
| 507 |
| 508 buildUnnamed223() { |
| 509 var o = new core.List<api.Metric>(); |
| 510 o.add(buildMetric()); |
| 511 o.add(buildMetric()); |
| 512 return o; |
| 513 } |
| 514 |
| 515 checkUnnamed223(core.List<api.Metric> o) { |
| 516 unittest.expect(o, unittest.hasLength(2)); |
| 517 checkMetric(o[0]); |
| 518 checkMetric(o[1]); |
| 519 } |
| 520 |
| 521 core.int buildCounterFloodlightReportCompatibleFields = 0; |
| 522 buildFloodlightReportCompatibleFields() { |
| 523 var o = new api.FloodlightReportCompatibleFields(); |
| 524 buildCounterFloodlightReportCompatibleFields++; |
| 525 if (buildCounterFloodlightReportCompatibleFields < 3) { |
| 526 o.dimensionFilters = buildUnnamed221(); |
| 527 o.dimensions = buildUnnamed222(); |
| 528 o.kind = "foo"; |
| 529 o.metrics = buildUnnamed223(); |
| 530 } |
| 531 buildCounterFloodlightReportCompatibleFields--; |
| 532 return o; |
| 533 } |
| 534 |
| 535 checkFloodlightReportCompatibleFields(api.FloodlightReportCompatibleFields o) { |
| 536 buildCounterFloodlightReportCompatibleFields++; |
| 537 if (buildCounterFloodlightReportCompatibleFields < 3) { |
| 538 checkUnnamed221(o.dimensionFilters); |
| 539 checkUnnamed222(o.dimensions); |
| 540 unittest.expect(o.kind, unittest.equals('foo')); |
| 541 checkUnnamed223(o.metrics); |
| 542 } |
| 543 buildCounterFloodlightReportCompatibleFields--; |
| 544 } |
| 545 |
| 546 core.int buildCounterMetric = 0; |
| 547 buildMetric() { |
| 548 var o = new api.Metric(); |
| 549 buildCounterMetric++; |
| 550 if (buildCounterMetric < 3) { |
| 551 o.kind = "foo"; |
| 552 o.name = "foo"; |
| 553 } |
| 554 buildCounterMetric--; |
| 555 return o; |
| 556 } |
| 557 |
| 558 checkMetric(api.Metric o) { |
| 559 buildCounterMetric++; |
| 560 if (buildCounterMetric < 3) { |
| 561 unittest.expect(o.kind, unittest.equals('foo')); |
| 562 unittest.expect(o.name, unittest.equals('foo')); |
| 563 } |
| 564 buildCounterMetric--; |
| 565 } |
| 566 |
| 567 buildUnnamed224() { |
| 568 var o = new core.List<api.Dimension>(); |
| 569 o.add(buildDimension()); |
| 570 o.add(buildDimension()); |
| 571 return o; |
| 572 } |
| 573 |
| 574 checkUnnamed224(core.List<api.Dimension> o) { |
| 575 unittest.expect(o, unittest.hasLength(2)); |
| 576 checkDimension(o[0]); |
| 577 checkDimension(o[1]); |
| 578 } |
| 579 |
| 580 buildUnnamed225() { |
| 581 var o = new core.List<api.Dimension>(); |
| 582 o.add(buildDimension()); |
| 583 o.add(buildDimension()); |
| 584 return o; |
| 585 } |
| 586 |
| 587 checkUnnamed225(core.List<api.Dimension> o) { |
| 588 unittest.expect(o, unittest.hasLength(2)); |
| 589 checkDimension(o[0]); |
| 590 checkDimension(o[1]); |
| 591 } |
| 592 |
| 593 buildUnnamed226() { |
| 594 var o = new core.List<api.Metric>(); |
| 595 o.add(buildMetric()); |
| 596 o.add(buildMetric()); |
| 597 return o; |
| 598 } |
| 599 |
| 600 checkUnnamed226(core.List<api.Metric> o) { |
| 601 unittest.expect(o, unittest.hasLength(2)); |
| 602 checkMetric(o[0]); |
| 603 checkMetric(o[1]); |
| 604 } |
| 605 |
| 606 buildUnnamed227() { |
| 607 var o = new core.List<api.Dimension>(); |
| 608 o.add(buildDimension()); |
| 609 o.add(buildDimension()); |
| 610 return o; |
| 611 } |
| 612 |
| 613 checkUnnamed227(core.List<api.Dimension> o) { |
| 614 unittest.expect(o, unittest.hasLength(2)); |
| 615 checkDimension(o[0]); |
| 616 checkDimension(o[1]); |
| 617 } |
| 618 |
| 619 core.int buildCounterPathToConversionReportCompatibleFields = 0; |
| 620 buildPathToConversionReportCompatibleFields() { |
| 621 var o = new api.PathToConversionReportCompatibleFields(); |
| 622 buildCounterPathToConversionReportCompatibleFields++; |
| 623 if (buildCounterPathToConversionReportCompatibleFields < 3) { |
| 624 o.conversionDimensions = buildUnnamed224(); |
| 625 o.customFloodlightVariables = buildUnnamed225(); |
| 626 o.kind = "foo"; |
| 627 o.metrics = buildUnnamed226(); |
| 628 o.perInteractionDimensions = buildUnnamed227(); |
| 629 } |
| 630 buildCounterPathToConversionReportCompatibleFields--; |
| 631 return o; |
| 632 } |
| 633 |
| 634 checkPathToConversionReportCompatibleFields(api.PathToConversionReportCompatible
Fields o) { |
| 635 buildCounterPathToConversionReportCompatibleFields++; |
| 636 if (buildCounterPathToConversionReportCompatibleFields < 3) { |
| 637 checkUnnamed224(o.conversionDimensions); |
| 638 checkUnnamed225(o.customFloodlightVariables); |
| 639 unittest.expect(o.kind, unittest.equals('foo')); |
| 640 checkUnnamed226(o.metrics); |
| 641 checkUnnamed227(o.perInteractionDimensions); |
| 642 } |
| 643 buildCounterPathToConversionReportCompatibleFields--; |
| 644 } |
| 645 |
| 646 buildUnnamed228() { |
| 647 var o = new core.List<api.Dimension>(); |
| 648 o.add(buildDimension()); |
| 649 o.add(buildDimension()); |
| 650 return o; |
| 651 } |
| 652 |
| 653 checkUnnamed228(core.List<api.Dimension> o) { |
| 654 unittest.expect(o, unittest.hasLength(2)); |
| 655 checkDimension(o[0]); |
| 656 checkDimension(o[1]); |
| 657 } |
| 658 |
| 659 buildUnnamed229() { |
| 660 var o = new core.List<api.Dimension>(); |
| 661 o.add(buildDimension()); |
| 662 o.add(buildDimension()); |
| 663 return o; |
| 664 } |
| 665 |
| 666 checkUnnamed229(core.List<api.Dimension> o) { |
| 667 unittest.expect(o, unittest.hasLength(2)); |
| 668 checkDimension(o[0]); |
| 669 checkDimension(o[1]); |
| 670 } |
| 671 |
| 672 buildUnnamed230() { |
| 673 var o = new core.List<api.Metric>(); |
| 674 o.add(buildMetric()); |
| 675 o.add(buildMetric()); |
| 676 return o; |
| 677 } |
| 678 |
| 679 checkUnnamed230(core.List<api.Metric> o) { |
| 680 unittest.expect(o, unittest.hasLength(2)); |
| 681 checkMetric(o[0]); |
| 682 checkMetric(o[1]); |
| 683 } |
| 684 |
| 685 buildUnnamed231() { |
| 686 var o = new core.List<api.Metric>(); |
| 687 o.add(buildMetric()); |
| 688 o.add(buildMetric()); |
| 689 return o; |
| 690 } |
| 691 |
| 692 checkUnnamed231(core.List<api.Metric> o) { |
| 693 unittest.expect(o, unittest.hasLength(2)); |
| 694 checkMetric(o[0]); |
| 695 checkMetric(o[1]); |
| 696 } |
| 697 |
| 698 buildUnnamed232() { |
| 699 var o = new core.List<api.Metric>(); |
| 700 o.add(buildMetric()); |
| 701 o.add(buildMetric()); |
| 702 return o; |
| 703 } |
| 704 |
| 705 checkUnnamed232(core.List<api.Metric> o) { |
| 706 unittest.expect(o, unittest.hasLength(2)); |
| 707 checkMetric(o[0]); |
| 708 checkMetric(o[1]); |
| 709 } |
| 710 |
| 711 core.int buildCounterReachReportCompatibleFields = 0; |
| 712 buildReachReportCompatibleFields() { |
| 713 var o = new api.ReachReportCompatibleFields(); |
| 714 buildCounterReachReportCompatibleFields++; |
| 715 if (buildCounterReachReportCompatibleFields < 3) { |
| 716 o.dimensionFilters = buildUnnamed228(); |
| 717 o.dimensions = buildUnnamed229(); |
| 718 o.kind = "foo"; |
| 719 o.metrics = buildUnnamed230(); |
| 720 o.pivotedActivityMetrics = buildUnnamed231(); |
| 721 o.reachByFrequencyMetrics = buildUnnamed232(); |
| 722 } |
| 723 buildCounterReachReportCompatibleFields--; |
| 724 return o; |
| 725 } |
| 726 |
| 727 checkReachReportCompatibleFields(api.ReachReportCompatibleFields o) { |
| 728 buildCounterReachReportCompatibleFields++; |
| 729 if (buildCounterReachReportCompatibleFields < 3) { |
| 730 checkUnnamed228(o.dimensionFilters); |
| 731 checkUnnamed229(o.dimensions); |
| 732 unittest.expect(o.kind, unittest.equals('foo')); |
| 733 checkUnnamed230(o.metrics); |
| 734 checkUnnamed231(o.pivotedActivityMetrics); |
| 735 checkUnnamed232(o.reachByFrequencyMetrics); |
| 736 } |
| 737 buildCounterReachReportCompatibleFields--; |
| 738 } |
| 739 |
| 740 core.int buildCounterRecipient = 0; |
| 741 buildRecipient() { |
| 742 var o = new api.Recipient(); |
| 743 buildCounterRecipient++; |
| 744 if (buildCounterRecipient < 3) { |
| 745 o.deliveryType = "foo"; |
| 746 o.email = "foo"; |
| 747 o.kind = "foo"; |
| 748 } |
| 749 buildCounterRecipient--; |
| 750 return o; |
| 751 } |
| 752 |
| 753 checkRecipient(api.Recipient o) { |
| 754 buildCounterRecipient++; |
| 755 if (buildCounterRecipient < 3) { |
| 756 unittest.expect(o.deliveryType, unittest.equals('foo')); |
| 757 unittest.expect(o.email, unittest.equals('foo')); |
| 758 unittest.expect(o.kind, unittest.equals('foo')); |
| 759 } |
| 760 buildCounterRecipient--; |
| 761 } |
| 762 |
| 763 buildUnnamed233() { |
| 764 var o = new core.List<api.DimensionValue>(); |
| 765 o.add(buildDimensionValue()); |
| 766 o.add(buildDimensionValue()); |
| 767 return o; |
| 768 } |
| 769 |
| 770 checkUnnamed233(core.List<api.DimensionValue> o) { |
| 771 unittest.expect(o, unittest.hasLength(2)); |
| 772 checkDimensionValue(o[0]); |
| 773 checkDimensionValue(o[1]); |
| 774 } |
| 775 |
| 776 buildUnnamed234() { |
| 777 var o = new core.List<api.SortedDimension>(); |
| 778 o.add(buildSortedDimension()); |
| 779 o.add(buildSortedDimension()); |
| 780 return o; |
| 781 } |
| 782 |
| 783 checkUnnamed234(core.List<api.SortedDimension> o) { |
| 784 unittest.expect(o, unittest.hasLength(2)); |
| 785 checkSortedDimension(o[0]); |
| 786 checkSortedDimension(o[1]); |
| 787 } |
| 788 |
| 789 buildUnnamed235() { |
| 790 var o = new core.List<core.String>(); |
| 791 o.add("foo"); |
| 792 o.add("foo"); |
| 793 return o; |
| 794 } |
| 795 |
| 796 checkUnnamed235(core.List<core.String> o) { |
| 797 unittest.expect(o, unittest.hasLength(2)); |
| 798 unittest.expect(o[0], unittest.equals('foo')); |
| 799 unittest.expect(o[1], unittest.equals('foo')); |
| 800 } |
| 801 |
| 802 core.int buildCounterReportActiveGrpCriteria = 0; |
| 803 buildReportActiveGrpCriteria() { |
| 804 var o = new api.ReportActiveGrpCriteria(); |
| 805 buildCounterReportActiveGrpCriteria++; |
| 806 if (buildCounterReportActiveGrpCriteria < 3) { |
| 807 o.dateRange = buildDateRange(); |
| 808 o.dimensionFilters = buildUnnamed233(); |
| 809 o.dimensions = buildUnnamed234(); |
| 810 o.metricNames = buildUnnamed235(); |
| 811 } |
| 812 buildCounterReportActiveGrpCriteria--; |
| 813 return o; |
| 814 } |
| 815 |
| 816 checkReportActiveGrpCriteria(api.ReportActiveGrpCriteria o) { |
| 817 buildCounterReportActiveGrpCriteria++; |
| 818 if (buildCounterReportActiveGrpCriteria < 3) { |
| 819 checkDateRange(o.dateRange); |
| 820 checkUnnamed233(o.dimensionFilters); |
| 821 checkUnnamed234(o.dimensions); |
| 822 checkUnnamed235(o.metricNames); |
| 823 } |
| 824 buildCounterReportActiveGrpCriteria--; |
| 825 } |
| 826 |
| 827 buildUnnamed236() { |
| 828 var o = new core.List<api.DimensionValue>(); |
| 829 o.add(buildDimensionValue()); |
| 830 o.add(buildDimensionValue()); |
| 831 return o; |
| 832 } |
| 833 |
| 834 checkUnnamed236(core.List<api.DimensionValue> o) { |
| 835 unittest.expect(o, unittest.hasLength(2)); |
| 836 checkDimensionValue(o[0]); |
| 837 checkDimensionValue(o[1]); |
| 838 } |
| 839 |
| 840 buildUnnamed237() { |
| 841 var o = new core.List<api.SortedDimension>(); |
| 842 o.add(buildSortedDimension()); |
| 843 o.add(buildSortedDimension()); |
| 844 return o; |
| 845 } |
| 846 |
| 847 checkUnnamed237(core.List<api.SortedDimension> o) { |
| 848 unittest.expect(o, unittest.hasLength(2)); |
| 849 checkSortedDimension(o[0]); |
| 850 checkSortedDimension(o[1]); |
| 851 } |
| 852 |
| 853 buildUnnamed238() { |
| 854 var o = new core.List<core.String>(); |
| 855 o.add("foo"); |
| 856 o.add("foo"); |
| 857 return o; |
| 858 } |
| 859 |
| 860 checkUnnamed238(core.List<core.String> o) { |
| 861 unittest.expect(o, unittest.hasLength(2)); |
| 862 unittest.expect(o[0], unittest.equals('foo')); |
| 863 unittest.expect(o[1], unittest.equals('foo')); |
| 864 } |
| 865 |
| 866 core.int buildCounterReportCriteria = 0; |
| 867 buildReportCriteria() { |
| 868 var o = new api.ReportCriteria(); |
| 869 buildCounterReportCriteria++; |
| 870 if (buildCounterReportCriteria < 3) { |
| 871 o.activities = buildActivities(); |
| 872 o.customRichMediaEvents = buildCustomRichMediaEvents(); |
| 873 o.dateRange = buildDateRange(); |
| 874 o.dimensionFilters = buildUnnamed236(); |
| 875 o.dimensions = buildUnnamed237(); |
| 876 o.metricNames = buildUnnamed238(); |
| 877 } |
| 878 buildCounterReportCriteria--; |
| 879 return o; |
| 880 } |
| 881 |
| 882 checkReportCriteria(api.ReportCriteria o) { |
| 883 buildCounterReportCriteria++; |
| 884 if (buildCounterReportCriteria < 3) { |
| 885 checkActivities(o.activities); |
| 886 checkCustomRichMediaEvents(o.customRichMediaEvents); |
| 887 checkDateRange(o.dateRange); |
| 888 checkUnnamed236(o.dimensionFilters); |
| 889 checkUnnamed237(o.dimensions); |
| 890 checkUnnamed238(o.metricNames); |
| 891 } |
| 892 buildCounterReportCriteria--; |
| 893 } |
| 894 |
| 895 buildUnnamed239() { |
| 896 var o = new core.List<api.SortedDimension>(); |
| 897 o.add(buildSortedDimension()); |
| 898 o.add(buildSortedDimension()); |
| 899 return o; |
| 900 } |
| 901 |
| 902 checkUnnamed239(core.List<api.SortedDimension> o) { |
| 903 unittest.expect(o, unittest.hasLength(2)); |
| 904 checkSortedDimension(o[0]); |
| 905 checkSortedDimension(o[1]); |
| 906 } |
| 907 |
| 908 buildUnnamed240() { |
| 909 var o = new core.List<api.DimensionValue>(); |
| 910 o.add(buildDimensionValue()); |
| 911 o.add(buildDimensionValue()); |
| 912 return o; |
| 913 } |
| 914 |
| 915 checkUnnamed240(core.List<api.DimensionValue> o) { |
| 916 unittest.expect(o, unittest.hasLength(2)); |
| 917 checkDimensionValue(o[0]); |
| 918 checkDimensionValue(o[1]); |
| 919 } |
| 920 |
| 921 buildUnnamed241() { |
| 922 var o = new core.List<core.String>(); |
| 923 o.add("foo"); |
| 924 o.add("foo"); |
| 925 return o; |
| 926 } |
| 927 |
| 928 checkUnnamed241(core.List<core.String> o) { |
| 929 unittest.expect(o, unittest.hasLength(2)); |
| 930 unittest.expect(o[0], unittest.equals('foo')); |
| 931 unittest.expect(o[1], unittest.equals('foo')); |
| 932 } |
| 933 |
| 934 buildUnnamed242() { |
| 935 var o = new core.List<core.String>(); |
| 936 o.add("foo"); |
| 937 o.add("foo"); |
| 938 return o; |
| 939 } |
| 940 |
| 941 checkUnnamed242(core.List<core.String> o) { |
| 942 unittest.expect(o, unittest.hasLength(2)); |
| 943 unittest.expect(o[0], unittest.equals('foo')); |
| 944 unittest.expect(o[1], unittest.equals('foo')); |
| 945 } |
| 946 |
| 947 core.int buildCounterReportCrossDimensionReachCriteria = 0; |
| 948 buildReportCrossDimensionReachCriteria() { |
| 949 var o = new api.ReportCrossDimensionReachCriteria(); |
| 950 buildCounterReportCrossDimensionReachCriteria++; |
| 951 if (buildCounterReportCrossDimensionReachCriteria < 3) { |
| 952 o.breakdown = buildUnnamed239(); |
| 953 o.dateRange = buildDateRange(); |
| 954 o.dimension = "foo"; |
| 955 o.dimensionFilters = buildUnnamed240(); |
| 956 o.metricNames = buildUnnamed241(); |
| 957 o.overlapMetricNames = buildUnnamed242(); |
| 958 o.pivoted = true; |
| 959 } |
| 960 buildCounterReportCrossDimensionReachCriteria--; |
| 961 return o; |
| 962 } |
| 963 |
| 964 checkReportCrossDimensionReachCriteria(api.ReportCrossDimensionReachCriteria o)
{ |
| 965 buildCounterReportCrossDimensionReachCriteria++; |
| 966 if (buildCounterReportCrossDimensionReachCriteria < 3) { |
| 967 checkUnnamed239(o.breakdown); |
| 968 checkDateRange(o.dateRange); |
| 969 unittest.expect(o.dimension, unittest.equals('foo')); |
| 970 checkUnnamed240(o.dimensionFilters); |
| 971 checkUnnamed241(o.metricNames); |
| 972 checkUnnamed242(o.overlapMetricNames); |
| 973 unittest.expect(o.pivoted, unittest.isTrue); |
| 974 } |
| 975 buildCounterReportCrossDimensionReachCriteria--; |
| 976 } |
| 977 |
| 978 buildUnnamed243() { |
| 979 var o = new core.List<api.Recipient>(); |
| 980 o.add(buildRecipient()); |
| 981 o.add(buildRecipient()); |
| 982 return o; |
| 983 } |
| 984 |
| 985 checkUnnamed243(core.List<api.Recipient> o) { |
| 986 unittest.expect(o, unittest.hasLength(2)); |
| 987 checkRecipient(o[0]); |
| 988 checkRecipient(o[1]); |
| 989 } |
| 990 |
| 991 core.int buildCounterReportDelivery = 0; |
| 992 buildReportDelivery() { |
| 993 var o = new api.ReportDelivery(); |
| 994 buildCounterReportDelivery++; |
| 995 if (buildCounterReportDelivery < 3) { |
| 996 o.emailOwner = true; |
| 997 o.emailOwnerDeliveryType = "foo"; |
| 998 o.message = "foo"; |
| 999 o.recipients = buildUnnamed243(); |
| 1000 } |
| 1001 buildCounterReportDelivery--; |
| 1002 return o; |
| 1003 } |
| 1004 |
| 1005 checkReportDelivery(api.ReportDelivery o) { |
| 1006 buildCounterReportDelivery++; |
| 1007 if (buildCounterReportDelivery < 3) { |
| 1008 unittest.expect(o.emailOwner, unittest.isTrue); |
| 1009 unittest.expect(o.emailOwnerDeliveryType, unittest.equals('foo')); |
| 1010 unittest.expect(o.message, unittest.equals('foo')); |
| 1011 checkUnnamed243(o.recipients); |
| 1012 } |
| 1013 buildCounterReportDelivery--; |
| 1014 } |
| 1015 |
| 1016 buildUnnamed244() { |
| 1017 var o = new core.List<api.DimensionValue>(); |
| 1018 o.add(buildDimensionValue()); |
| 1019 o.add(buildDimensionValue()); |
| 1020 return o; |
| 1021 } |
| 1022 |
| 1023 checkUnnamed244(core.List<api.DimensionValue> o) { |
| 1024 unittest.expect(o, unittest.hasLength(2)); |
| 1025 checkDimensionValue(o[0]); |
| 1026 checkDimensionValue(o[1]); |
| 1027 } |
| 1028 |
| 1029 buildUnnamed245() { |
| 1030 var o = new core.List<api.DimensionValue>(); |
| 1031 o.add(buildDimensionValue()); |
| 1032 o.add(buildDimensionValue()); |
| 1033 return o; |
| 1034 } |
| 1035 |
| 1036 checkUnnamed245(core.List<api.DimensionValue> o) { |
| 1037 unittest.expect(o, unittest.hasLength(2)); |
| 1038 checkDimensionValue(o[0]); |
| 1039 checkDimensionValue(o[1]); |
| 1040 } |
| 1041 |
| 1042 buildUnnamed246() { |
| 1043 var o = new core.List<api.SortedDimension>(); |
| 1044 o.add(buildSortedDimension()); |
| 1045 o.add(buildSortedDimension()); |
| 1046 return o; |
| 1047 } |
| 1048 |
| 1049 checkUnnamed246(core.List<api.SortedDimension> o) { |
| 1050 unittest.expect(o, unittest.hasLength(2)); |
| 1051 checkSortedDimension(o[0]); |
| 1052 checkSortedDimension(o[1]); |
| 1053 } |
| 1054 |
| 1055 buildUnnamed247() { |
| 1056 var o = new core.List<core.String>(); |
| 1057 o.add("foo"); |
| 1058 o.add("foo"); |
| 1059 return o; |
| 1060 } |
| 1061 |
| 1062 checkUnnamed247(core.List<core.String> o) { |
| 1063 unittest.expect(o, unittest.hasLength(2)); |
| 1064 unittest.expect(o[0], unittest.equals('foo')); |
| 1065 unittest.expect(o[1], unittest.equals('foo')); |
| 1066 } |
| 1067 |
| 1068 core.int buildCounterReportFloodlightCriteriaReportProperties = 0; |
| 1069 buildReportFloodlightCriteriaReportProperties() { |
| 1070 var o = new api.ReportFloodlightCriteriaReportProperties(); |
| 1071 buildCounterReportFloodlightCriteriaReportProperties++; |
| 1072 if (buildCounterReportFloodlightCriteriaReportProperties < 3) { |
| 1073 o.includeAttributedIPConversions = true; |
| 1074 o.includeUnattributedCookieConversions = true; |
| 1075 o.includeUnattributedIPConversions = true; |
| 1076 } |
| 1077 buildCounterReportFloodlightCriteriaReportProperties--; |
| 1078 return o; |
| 1079 } |
| 1080 |
| 1081 checkReportFloodlightCriteriaReportProperties(api.ReportFloodlightCriteriaReport
Properties o) { |
| 1082 buildCounterReportFloodlightCriteriaReportProperties++; |
| 1083 if (buildCounterReportFloodlightCriteriaReportProperties < 3) { |
| 1084 unittest.expect(o.includeAttributedIPConversions, unittest.isTrue); |
| 1085 unittest.expect(o.includeUnattributedCookieConversions, unittest.isTrue); |
| 1086 unittest.expect(o.includeUnattributedIPConversions, unittest.isTrue); |
| 1087 } |
| 1088 buildCounterReportFloodlightCriteriaReportProperties--; |
| 1089 } |
| 1090 |
| 1091 core.int buildCounterReportFloodlightCriteria = 0; |
| 1092 buildReportFloodlightCriteria() { |
| 1093 var o = new api.ReportFloodlightCriteria(); |
| 1094 buildCounterReportFloodlightCriteria++; |
| 1095 if (buildCounterReportFloodlightCriteria < 3) { |
| 1096 o.customRichMediaEvents = buildUnnamed244(); |
| 1097 o.dateRange = buildDateRange(); |
| 1098 o.dimensionFilters = buildUnnamed245(); |
| 1099 o.dimensions = buildUnnamed246(); |
| 1100 o.floodlightConfigId = buildDimensionValue(); |
| 1101 o.metricNames = buildUnnamed247(); |
| 1102 o.reportProperties = buildReportFloodlightCriteriaReportProperties(); |
| 1103 } |
| 1104 buildCounterReportFloodlightCriteria--; |
| 1105 return o; |
| 1106 } |
| 1107 |
| 1108 checkReportFloodlightCriteria(api.ReportFloodlightCriteria o) { |
| 1109 buildCounterReportFloodlightCriteria++; |
| 1110 if (buildCounterReportFloodlightCriteria < 3) { |
| 1111 checkUnnamed244(o.customRichMediaEvents); |
| 1112 checkDateRange(o.dateRange); |
| 1113 checkUnnamed245(o.dimensionFilters); |
| 1114 checkUnnamed246(o.dimensions); |
| 1115 checkDimensionValue(o.floodlightConfigId); |
| 1116 checkUnnamed247(o.metricNames); |
| 1117 checkReportFloodlightCriteriaReportProperties(o.reportProperties); |
| 1118 } |
| 1119 buildCounterReportFloodlightCriteria--; |
| 1120 } |
| 1121 |
| 1122 buildUnnamed248() { |
| 1123 var o = new core.List<api.DimensionValue>(); |
| 1124 o.add(buildDimensionValue()); |
| 1125 o.add(buildDimensionValue()); |
| 1126 return o; |
| 1127 } |
| 1128 |
| 1129 checkUnnamed248(core.List<api.DimensionValue> o) { |
| 1130 unittest.expect(o, unittest.hasLength(2)); |
| 1131 checkDimensionValue(o[0]); |
| 1132 checkDimensionValue(o[1]); |
| 1133 } |
| 1134 |
| 1135 buildUnnamed249() { |
| 1136 var o = new core.List<api.SortedDimension>(); |
| 1137 o.add(buildSortedDimension()); |
| 1138 o.add(buildSortedDimension()); |
| 1139 return o; |
| 1140 } |
| 1141 |
| 1142 checkUnnamed249(core.List<api.SortedDimension> o) { |
| 1143 unittest.expect(o, unittest.hasLength(2)); |
| 1144 checkSortedDimension(o[0]); |
| 1145 checkSortedDimension(o[1]); |
| 1146 } |
| 1147 |
| 1148 buildUnnamed250() { |
| 1149 var o = new core.List<api.SortedDimension>(); |
| 1150 o.add(buildSortedDimension()); |
| 1151 o.add(buildSortedDimension()); |
| 1152 return o; |
| 1153 } |
| 1154 |
| 1155 checkUnnamed250(core.List<api.SortedDimension> o) { |
| 1156 unittest.expect(o, unittest.hasLength(2)); |
| 1157 checkSortedDimension(o[0]); |
| 1158 checkSortedDimension(o[1]); |
| 1159 } |
| 1160 |
| 1161 buildUnnamed251() { |
| 1162 var o = new core.List<api.DimensionValue>(); |
| 1163 o.add(buildDimensionValue()); |
| 1164 o.add(buildDimensionValue()); |
| 1165 return o; |
| 1166 } |
| 1167 |
| 1168 checkUnnamed251(core.List<api.DimensionValue> o) { |
| 1169 unittest.expect(o, unittest.hasLength(2)); |
| 1170 checkDimensionValue(o[0]); |
| 1171 checkDimensionValue(o[1]); |
| 1172 } |
| 1173 |
| 1174 buildUnnamed252() { |
| 1175 var o = new core.List<core.String>(); |
| 1176 o.add("foo"); |
| 1177 o.add("foo"); |
| 1178 return o; |
| 1179 } |
| 1180 |
| 1181 checkUnnamed252(core.List<core.String> o) { |
| 1182 unittest.expect(o, unittest.hasLength(2)); |
| 1183 unittest.expect(o[0], unittest.equals('foo')); |
| 1184 unittest.expect(o[1], unittest.equals('foo')); |
| 1185 } |
| 1186 |
| 1187 buildUnnamed253() { |
| 1188 var o = new core.List<api.SortedDimension>(); |
| 1189 o.add(buildSortedDimension()); |
| 1190 o.add(buildSortedDimension()); |
| 1191 return o; |
| 1192 } |
| 1193 |
| 1194 checkUnnamed253(core.List<api.SortedDimension> o) { |
| 1195 unittest.expect(o, unittest.hasLength(2)); |
| 1196 checkSortedDimension(o[0]); |
| 1197 checkSortedDimension(o[1]); |
| 1198 } |
| 1199 |
| 1200 core.int buildCounterReportPathToConversionCriteriaReportProperties = 0; |
| 1201 buildReportPathToConversionCriteriaReportProperties() { |
| 1202 var o = new api.ReportPathToConversionCriteriaReportProperties(); |
| 1203 buildCounterReportPathToConversionCriteriaReportProperties++; |
| 1204 if (buildCounterReportPathToConversionCriteriaReportProperties < 3) { |
| 1205 o.clicksLookbackWindow = 42; |
| 1206 o.impressionsLookbackWindow = 42; |
| 1207 o.includeAttributedIPConversions = true; |
| 1208 o.includeUnattributedCookieConversions = true; |
| 1209 o.includeUnattributedIPConversions = true; |
| 1210 o.maximumClickInteractions = 42; |
| 1211 o.maximumImpressionInteractions = 42; |
| 1212 o.maximumInteractionGap = 42; |
| 1213 o.pivotOnInteractionPath = true; |
| 1214 } |
| 1215 buildCounterReportPathToConversionCriteriaReportProperties--; |
| 1216 return o; |
| 1217 } |
| 1218 |
| 1219 checkReportPathToConversionCriteriaReportProperties(api.ReportPathToConversionCr
iteriaReportProperties o) { |
| 1220 buildCounterReportPathToConversionCriteriaReportProperties++; |
| 1221 if (buildCounterReportPathToConversionCriteriaReportProperties < 3) { |
| 1222 unittest.expect(o.clicksLookbackWindow, unittest.equals(42)); |
| 1223 unittest.expect(o.impressionsLookbackWindow, unittest.equals(42)); |
| 1224 unittest.expect(o.includeAttributedIPConversions, unittest.isTrue); |
| 1225 unittest.expect(o.includeUnattributedCookieConversions, unittest.isTrue); |
| 1226 unittest.expect(o.includeUnattributedIPConversions, unittest.isTrue); |
| 1227 unittest.expect(o.maximumClickInteractions, unittest.equals(42)); |
| 1228 unittest.expect(o.maximumImpressionInteractions, unittest.equals(42)); |
| 1229 unittest.expect(o.maximumInteractionGap, unittest.equals(42)); |
| 1230 unittest.expect(o.pivotOnInteractionPath, unittest.isTrue); |
| 1231 } |
| 1232 buildCounterReportPathToConversionCriteriaReportProperties--; |
| 1233 } |
| 1234 |
| 1235 core.int buildCounterReportPathToConversionCriteria = 0; |
| 1236 buildReportPathToConversionCriteria() { |
| 1237 var o = new api.ReportPathToConversionCriteria(); |
| 1238 buildCounterReportPathToConversionCriteria++; |
| 1239 if (buildCounterReportPathToConversionCriteria < 3) { |
| 1240 o.activityFilters = buildUnnamed248(); |
| 1241 o.conversionDimensions = buildUnnamed249(); |
| 1242 o.customFloodlightVariables = buildUnnamed250(); |
| 1243 o.customRichMediaEvents = buildUnnamed251(); |
| 1244 o.dateRange = buildDateRange(); |
| 1245 o.floodlightConfigId = buildDimensionValue(); |
| 1246 o.metricNames = buildUnnamed252(); |
| 1247 o.perInteractionDimensions = buildUnnamed253(); |
| 1248 o.reportProperties = buildReportPathToConversionCriteriaReportProperties(); |
| 1249 } |
| 1250 buildCounterReportPathToConversionCriteria--; |
| 1251 return o; |
| 1252 } |
| 1253 |
| 1254 checkReportPathToConversionCriteria(api.ReportPathToConversionCriteria o) { |
| 1255 buildCounterReportPathToConversionCriteria++; |
| 1256 if (buildCounterReportPathToConversionCriteria < 3) { |
| 1257 checkUnnamed248(o.activityFilters); |
| 1258 checkUnnamed249(o.conversionDimensions); |
| 1259 checkUnnamed250(o.customFloodlightVariables); |
| 1260 checkUnnamed251(o.customRichMediaEvents); |
| 1261 checkDateRange(o.dateRange); |
| 1262 checkDimensionValue(o.floodlightConfigId); |
| 1263 checkUnnamed252(o.metricNames); |
| 1264 checkUnnamed253(o.perInteractionDimensions); |
| 1265 checkReportPathToConversionCriteriaReportProperties(o.reportProperties); |
| 1266 } |
| 1267 buildCounterReportPathToConversionCriteria--; |
| 1268 } |
| 1269 |
| 1270 buildUnnamed254() { |
| 1271 var o = new core.List<api.DimensionValue>(); |
| 1272 o.add(buildDimensionValue()); |
| 1273 o.add(buildDimensionValue()); |
| 1274 return o; |
| 1275 } |
| 1276 |
| 1277 checkUnnamed254(core.List<api.DimensionValue> o) { |
| 1278 unittest.expect(o, unittest.hasLength(2)); |
| 1279 checkDimensionValue(o[0]); |
| 1280 checkDimensionValue(o[1]); |
| 1281 } |
| 1282 |
| 1283 buildUnnamed255() { |
| 1284 var o = new core.List<api.SortedDimension>(); |
| 1285 o.add(buildSortedDimension()); |
| 1286 o.add(buildSortedDimension()); |
| 1287 return o; |
| 1288 } |
| 1289 |
| 1290 checkUnnamed255(core.List<api.SortedDimension> o) { |
| 1291 unittest.expect(o, unittest.hasLength(2)); |
| 1292 checkSortedDimension(o[0]); |
| 1293 checkSortedDimension(o[1]); |
| 1294 } |
| 1295 |
| 1296 buildUnnamed256() { |
| 1297 var o = new core.List<core.String>(); |
| 1298 o.add("foo"); |
| 1299 o.add("foo"); |
| 1300 return o; |
| 1301 } |
| 1302 |
| 1303 checkUnnamed256(core.List<core.String> o) { |
| 1304 unittest.expect(o, unittest.hasLength(2)); |
| 1305 unittest.expect(o[0], unittest.equals('foo')); |
| 1306 unittest.expect(o[1], unittest.equals('foo')); |
| 1307 } |
| 1308 |
| 1309 buildUnnamed257() { |
| 1310 var o = new core.List<core.String>(); |
| 1311 o.add("foo"); |
| 1312 o.add("foo"); |
| 1313 return o; |
| 1314 } |
| 1315 |
| 1316 checkUnnamed257(core.List<core.String> o) { |
| 1317 unittest.expect(o, unittest.hasLength(2)); |
| 1318 unittest.expect(o[0], unittest.equals('foo')); |
| 1319 unittest.expect(o[1], unittest.equals('foo')); |
| 1320 } |
| 1321 |
| 1322 core.int buildCounterReportReachCriteria = 0; |
| 1323 buildReportReachCriteria() { |
| 1324 var o = new api.ReportReachCriteria(); |
| 1325 buildCounterReportReachCriteria++; |
| 1326 if (buildCounterReportReachCriteria < 3) { |
| 1327 o.activities = buildActivities(); |
| 1328 o.customRichMediaEvents = buildCustomRichMediaEvents(); |
| 1329 o.dateRange = buildDateRange(); |
| 1330 o.dimensionFilters = buildUnnamed254(); |
| 1331 o.dimensions = buildUnnamed255(); |
| 1332 o.metricNames = buildUnnamed256(); |
| 1333 o.reachByFrequencyMetricNames = buildUnnamed257(); |
| 1334 } |
| 1335 buildCounterReportReachCriteria--; |
| 1336 return o; |
| 1337 } |
| 1338 |
| 1339 checkReportReachCriteria(api.ReportReachCriteria o) { |
| 1340 buildCounterReportReachCriteria++; |
| 1341 if (buildCounterReportReachCriteria < 3) { |
| 1342 checkActivities(o.activities); |
| 1343 checkCustomRichMediaEvents(o.customRichMediaEvents); |
| 1344 checkDateRange(o.dateRange); |
| 1345 checkUnnamed254(o.dimensionFilters); |
| 1346 checkUnnamed255(o.dimensions); |
| 1347 checkUnnamed256(o.metricNames); |
| 1348 checkUnnamed257(o.reachByFrequencyMetricNames); |
| 1349 } |
| 1350 buildCounterReportReachCriteria--; |
| 1351 } |
| 1352 |
| 1353 buildUnnamed258() { |
| 1354 var o = new core.List<core.String>(); |
| 1355 o.add("foo"); |
| 1356 o.add("foo"); |
| 1357 return o; |
| 1358 } |
| 1359 |
| 1360 checkUnnamed258(core.List<core.String> o) { |
| 1361 unittest.expect(o, unittest.hasLength(2)); |
| 1362 unittest.expect(o[0], unittest.equals('foo')); |
| 1363 unittest.expect(o[1], unittest.equals('foo')); |
| 1364 } |
| 1365 |
| 1366 core.int buildCounterReportSchedule = 0; |
| 1367 buildReportSchedule() { |
| 1368 var o = new api.ReportSchedule(); |
| 1369 buildCounterReportSchedule++; |
| 1370 if (buildCounterReportSchedule < 3) { |
| 1371 o.active = true; |
| 1372 o.every = 42; |
| 1373 o.expirationDate = core.DateTime.parse("2002-02-27T14:01:02Z"); |
| 1374 o.repeats = "foo"; |
| 1375 o.repeatsOnWeekDays = buildUnnamed258(); |
| 1376 o.runsOnDayOfMonth = "foo"; |
| 1377 o.startDate = core.DateTime.parse("2002-02-27T14:01:02Z"); |
| 1378 } |
| 1379 buildCounterReportSchedule--; |
| 1380 return o; |
| 1381 } |
| 1382 |
| 1383 checkReportSchedule(api.ReportSchedule o) { |
| 1384 buildCounterReportSchedule++; |
| 1385 if (buildCounterReportSchedule < 3) { |
| 1386 unittest.expect(o.active, unittest.isTrue); |
| 1387 unittest.expect(o.every, unittest.equals(42)); |
| 1388 unittest.expect(o.expirationDate, unittest.equals(core.DateTime.parse("2002-
02-27T00:00:00"))); |
| 1389 unittest.expect(o.repeats, unittest.equals('foo')); |
| 1390 checkUnnamed258(o.repeatsOnWeekDays); |
| 1391 unittest.expect(o.runsOnDayOfMonth, unittest.equals('foo')); |
| 1392 unittest.expect(o.startDate, unittest.equals(core.DateTime.parse("2002-02-27
T00:00:00"))); |
| 1393 } |
| 1394 buildCounterReportSchedule--; |
| 1395 } |
| 1396 |
| 1397 core.int buildCounterReport = 0; |
| 1398 buildReport() { |
| 1399 var o = new api.Report(); |
| 1400 buildCounterReport++; |
| 1401 if (buildCounterReport < 3) { |
| 1402 o.accountId = "foo"; |
| 1403 o.activeGrpCriteria = buildReportActiveGrpCriteria(); |
| 1404 o.criteria = buildReportCriteria(); |
| 1405 o.crossDimensionReachCriteria = buildReportCrossDimensionReachCriteria(); |
| 1406 o.delivery = buildReportDelivery(); |
| 1407 o.etag = "foo"; |
| 1408 o.fileName = "foo"; |
| 1409 o.floodlightCriteria = buildReportFloodlightCriteria(); |
| 1410 o.format = "foo"; |
| 1411 o.id = "foo"; |
| 1412 o.kind = "foo"; |
| 1413 o.lastModifiedTime = "foo"; |
| 1414 o.name = "foo"; |
| 1415 o.ownerProfileId = "foo"; |
| 1416 o.pathToConversionCriteria = buildReportPathToConversionCriteria(); |
| 1417 o.reachCriteria = buildReportReachCriteria(); |
| 1418 o.schedule = buildReportSchedule(); |
| 1419 o.subAccountId = "foo"; |
| 1420 o.type = "foo"; |
| 1421 } |
| 1422 buildCounterReport--; |
| 1423 return o; |
| 1424 } |
| 1425 |
| 1426 checkReport(api.Report o) { |
| 1427 buildCounterReport++; |
| 1428 if (buildCounterReport < 3) { |
| 1429 unittest.expect(o.accountId, unittest.equals('foo')); |
| 1430 checkReportActiveGrpCriteria(o.activeGrpCriteria); |
| 1431 checkReportCriteria(o.criteria); |
| 1432 checkReportCrossDimensionReachCriteria(o.crossDimensionReachCriteria); |
| 1433 checkReportDelivery(o.delivery); |
| 1434 unittest.expect(o.etag, unittest.equals('foo')); |
| 1435 unittest.expect(o.fileName, unittest.equals('foo')); |
| 1436 checkReportFloodlightCriteria(o.floodlightCriteria); |
| 1437 unittest.expect(o.format, unittest.equals('foo')); |
| 1438 unittest.expect(o.id, unittest.equals('foo')); |
| 1439 unittest.expect(o.kind, unittest.equals('foo')); |
| 1440 unittest.expect(o.lastModifiedTime, unittest.equals('foo')); |
| 1441 unittest.expect(o.name, unittest.equals('foo')); |
| 1442 unittest.expect(o.ownerProfileId, unittest.equals('foo')); |
| 1443 checkReportPathToConversionCriteria(o.pathToConversionCriteria); |
| 1444 checkReportReachCriteria(o.reachCriteria); |
| 1445 checkReportSchedule(o.schedule); |
| 1446 unittest.expect(o.subAccountId, unittest.equals('foo')); |
| 1447 unittest.expect(o.type, unittest.equals('foo')); |
| 1448 } |
| 1449 buildCounterReport--; |
| 1450 } |
| 1451 |
| 1452 buildUnnamed259() { |
| 1453 var o = new core.List<api.Dimension>(); |
| 1454 o.add(buildDimension()); |
| 1455 o.add(buildDimension()); |
| 1456 return o; |
| 1457 } |
| 1458 |
| 1459 checkUnnamed259(core.List<api.Dimension> o) { |
| 1460 unittest.expect(o, unittest.hasLength(2)); |
| 1461 checkDimension(o[0]); |
| 1462 checkDimension(o[1]); |
| 1463 } |
| 1464 |
| 1465 buildUnnamed260() { |
| 1466 var o = new core.List<api.Dimension>(); |
| 1467 o.add(buildDimension()); |
| 1468 o.add(buildDimension()); |
| 1469 return o; |
| 1470 } |
| 1471 |
| 1472 checkUnnamed260(core.List<api.Dimension> o) { |
| 1473 unittest.expect(o, unittest.hasLength(2)); |
| 1474 checkDimension(o[0]); |
| 1475 checkDimension(o[1]); |
| 1476 } |
| 1477 |
| 1478 buildUnnamed261() { |
| 1479 var o = new core.List<api.Metric>(); |
| 1480 o.add(buildMetric()); |
| 1481 o.add(buildMetric()); |
| 1482 return o; |
| 1483 } |
| 1484 |
| 1485 checkUnnamed261(core.List<api.Metric> o) { |
| 1486 unittest.expect(o, unittest.hasLength(2)); |
| 1487 checkMetric(o[0]); |
| 1488 checkMetric(o[1]); |
| 1489 } |
| 1490 |
| 1491 buildUnnamed262() { |
| 1492 var o = new core.List<api.Metric>(); |
| 1493 o.add(buildMetric()); |
| 1494 o.add(buildMetric()); |
| 1495 return o; |
| 1496 } |
| 1497 |
| 1498 checkUnnamed262(core.List<api.Metric> o) { |
| 1499 unittest.expect(o, unittest.hasLength(2)); |
| 1500 checkMetric(o[0]); |
| 1501 checkMetric(o[1]); |
| 1502 } |
| 1503 |
| 1504 core.int buildCounterReportCompatibleFields = 0; |
| 1505 buildReportCompatibleFields() { |
| 1506 var o = new api.ReportCompatibleFields(); |
| 1507 buildCounterReportCompatibleFields++; |
| 1508 if (buildCounterReportCompatibleFields < 3) { |
| 1509 o.dimensionFilters = buildUnnamed259(); |
| 1510 o.dimensions = buildUnnamed260(); |
| 1511 o.kind = "foo"; |
| 1512 o.metrics = buildUnnamed261(); |
| 1513 o.pivotedActivityMetrics = buildUnnamed262(); |
| 1514 } |
| 1515 buildCounterReportCompatibleFields--; |
| 1516 return o; |
| 1517 } |
| 1518 |
| 1519 checkReportCompatibleFields(api.ReportCompatibleFields o) { |
| 1520 buildCounterReportCompatibleFields++; |
| 1521 if (buildCounterReportCompatibleFields < 3) { |
| 1522 checkUnnamed259(o.dimensionFilters); |
| 1523 checkUnnamed260(o.dimensions); |
| 1524 unittest.expect(o.kind, unittest.equals('foo')); |
| 1525 checkUnnamed261(o.metrics); |
| 1526 checkUnnamed262(o.pivotedActivityMetrics); |
| 1527 } |
| 1528 buildCounterReportCompatibleFields--; |
| 1529 } |
| 1530 |
| 1531 buildUnnamed263() { |
| 1532 var o = new core.List<api.Report>(); |
| 1533 o.add(buildReport()); |
| 1534 o.add(buildReport()); |
| 1535 return o; |
| 1536 } |
| 1537 |
| 1538 checkUnnamed263(core.List<api.Report> o) { |
| 1539 unittest.expect(o, unittest.hasLength(2)); |
| 1540 checkReport(o[0]); |
| 1541 checkReport(o[1]); |
| 1542 } |
| 1543 |
| 1544 core.int buildCounterReportList = 0; |
| 1545 buildReportList() { |
| 1546 var o = new api.ReportList(); |
| 1547 buildCounterReportList++; |
| 1548 if (buildCounterReportList < 3) { |
| 1549 o.etag = "foo"; |
| 1550 o.items = buildUnnamed263(); |
| 1551 o.kind = "foo"; |
| 1552 o.nextPageToken = "foo"; |
| 1553 } |
| 1554 buildCounterReportList--; |
| 1555 return o; |
| 1556 } |
| 1557 |
| 1558 checkReportList(api.ReportList o) { |
| 1559 buildCounterReportList++; |
| 1560 if (buildCounterReportList < 3) { |
| 1561 unittest.expect(o.etag, unittest.equals('foo')); |
| 1562 checkUnnamed263(o.items); |
| 1563 unittest.expect(o.kind, unittest.equals('foo')); |
| 1564 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 1565 } |
| 1566 buildCounterReportList--; |
| 1567 } |
| 1568 |
| 1569 core.int buildCounterSortedDimension = 0; |
| 1570 buildSortedDimension() { |
| 1571 var o = new api.SortedDimension(); |
| 1572 buildCounterSortedDimension++; |
| 1573 if (buildCounterSortedDimension < 3) { |
| 1574 o.kind = "foo"; |
| 1575 o.name = "foo"; |
| 1576 o.sortOrder = "foo"; |
| 1577 } |
| 1578 buildCounterSortedDimension--; |
| 1579 return o; |
| 1580 } |
| 1581 |
| 1582 checkSortedDimension(api.SortedDimension o) { |
| 1583 buildCounterSortedDimension++; |
| 1584 if (buildCounterSortedDimension < 3) { |
| 1585 unittest.expect(o.kind, unittest.equals('foo')); |
| 1586 unittest.expect(o.name, unittest.equals('foo')); |
| 1587 unittest.expect(o.sortOrder, unittest.equals('foo')); |
| 1588 } |
| 1589 buildCounterSortedDimension--; |
| 1590 } |
| 1591 |
| 1592 core.int buildCounterUserProfile = 0; |
| 1593 buildUserProfile() { |
| 1594 var o = new api.UserProfile(); |
| 1595 buildCounterUserProfile++; |
| 1596 if (buildCounterUserProfile < 3) { |
| 1597 o.accountId = "foo"; |
| 1598 o.accountName = "foo"; |
| 1599 o.etag = "foo"; |
| 1600 o.kind = "foo"; |
| 1601 o.profileId = "foo"; |
| 1602 o.subAccountId = "foo"; |
| 1603 o.subAccountName = "foo"; |
| 1604 o.userName = "foo"; |
| 1605 } |
| 1606 buildCounterUserProfile--; |
| 1607 return o; |
| 1608 } |
| 1609 |
| 1610 checkUserProfile(api.UserProfile o) { |
| 1611 buildCounterUserProfile++; |
| 1612 if (buildCounterUserProfile < 3) { |
| 1613 unittest.expect(o.accountId, unittest.equals('foo')); |
| 1614 unittest.expect(o.accountName, unittest.equals('foo')); |
| 1615 unittest.expect(o.etag, unittest.equals('foo')); |
| 1616 unittest.expect(o.kind, unittest.equals('foo')); |
| 1617 unittest.expect(o.profileId, unittest.equals('foo')); |
| 1618 unittest.expect(o.subAccountId, unittest.equals('foo')); |
| 1619 unittest.expect(o.subAccountName, unittest.equals('foo')); |
| 1620 unittest.expect(o.userName, unittest.equals('foo')); |
| 1621 } |
| 1622 buildCounterUserProfile--; |
| 1623 } |
| 1624 |
| 1625 buildUnnamed264() { |
| 1626 var o = new core.List<api.UserProfile>(); |
| 1627 o.add(buildUserProfile()); |
| 1628 o.add(buildUserProfile()); |
| 1629 return o; |
| 1630 } |
| 1631 |
| 1632 checkUnnamed264(core.List<api.UserProfile> o) { |
| 1633 unittest.expect(o, unittest.hasLength(2)); |
| 1634 checkUserProfile(o[0]); |
| 1635 checkUserProfile(o[1]); |
| 1636 } |
| 1637 |
| 1638 core.int buildCounterUserProfileList = 0; |
| 1639 buildUserProfileList() { |
| 1640 var o = new api.UserProfileList(); |
| 1641 buildCounterUserProfileList++; |
| 1642 if (buildCounterUserProfileList < 3) { |
| 1643 o.etag = "foo"; |
| 1644 o.items = buildUnnamed264(); |
| 1645 o.kind = "foo"; |
| 1646 } |
| 1647 buildCounterUserProfileList--; |
| 1648 return o; |
| 1649 } |
| 1650 |
| 1651 checkUserProfileList(api.UserProfileList o) { |
| 1652 buildCounterUserProfileList++; |
| 1653 if (buildCounterUserProfileList < 3) { |
| 1654 unittest.expect(o.etag, unittest.equals('foo')); |
| 1655 checkUnnamed264(o.items); |
| 1656 unittest.expect(o.kind, unittest.equals('foo')); |
| 1657 } |
| 1658 buildCounterUserProfileList--; |
| 1659 } |
| 1660 |
| 1661 |
| 1662 main() { |
| 1663 unittest.group("obj-schema-Activities", () { |
| 1664 unittest.test("to-json--from-json", () { |
| 1665 var o = buildActivities(); |
| 1666 var od = new api.Activities.fromJson(o.toJson()); |
| 1667 checkActivities(od); |
| 1668 }); |
| 1669 }); |
| 1670 |
| 1671 |
| 1672 unittest.group("obj-schema-CompatibleFields", () { |
| 1673 unittest.test("to-json--from-json", () { |
| 1674 var o = buildCompatibleFields(); |
| 1675 var od = new api.CompatibleFields.fromJson(o.toJson()); |
| 1676 checkCompatibleFields(od); |
| 1677 }); |
| 1678 }); |
| 1679 |
| 1680 |
| 1681 unittest.group("obj-schema-CrossDimensionReachReportCompatibleFields", () { |
| 1682 unittest.test("to-json--from-json", () { |
| 1683 var o = buildCrossDimensionReachReportCompatibleFields(); |
| 1684 var od = new api.CrossDimensionReachReportCompatibleFields.fromJson(o.toJs
on()); |
| 1685 checkCrossDimensionReachReportCompatibleFields(od); |
| 1686 }); |
| 1687 }); |
| 1688 |
| 1689 |
| 1690 unittest.group("obj-schema-CustomRichMediaEvents", () { |
| 1691 unittest.test("to-json--from-json", () { |
| 1692 var o = buildCustomRichMediaEvents(); |
| 1693 var od = new api.CustomRichMediaEvents.fromJson(o.toJson()); |
| 1694 checkCustomRichMediaEvents(od); |
| 1695 }); |
| 1696 }); |
| 1697 |
| 1698 |
| 1699 unittest.group("obj-schema-DateRange", () { |
| 1700 unittest.test("to-json--from-json", () { |
| 1701 var o = buildDateRange(); |
| 1702 var od = new api.DateRange.fromJson(o.toJson()); |
| 1703 checkDateRange(od); |
| 1704 }); |
| 1705 }); |
| 1706 |
| 1707 |
| 1708 unittest.group("obj-schema-Dimension", () { |
| 1709 unittest.test("to-json--from-json", () { |
| 1710 var o = buildDimension(); |
| 1711 var od = new api.Dimension.fromJson(o.toJson()); |
| 1712 checkDimension(od); |
| 1713 }); |
| 1714 }); |
| 1715 |
| 1716 |
| 1717 unittest.group("obj-schema-DimensionFilter", () { |
| 1718 unittest.test("to-json--from-json", () { |
| 1719 var o = buildDimensionFilter(); |
| 1720 var od = new api.DimensionFilter.fromJson(o.toJson()); |
| 1721 checkDimensionFilter(od); |
| 1722 }); |
| 1723 }); |
| 1724 |
| 1725 |
| 1726 unittest.group("obj-schema-DimensionValue", () { |
| 1727 unittest.test("to-json--from-json", () { |
| 1728 var o = buildDimensionValue(); |
| 1729 var od = new api.DimensionValue.fromJson(o.toJson()); |
| 1730 checkDimensionValue(od); |
| 1731 }); |
| 1732 }); |
| 1733 |
| 1734 |
| 1735 unittest.group("obj-schema-DimensionValueList", () { |
| 1736 unittest.test("to-json--from-json", () { |
| 1737 var o = buildDimensionValueList(); |
| 1738 var od = new api.DimensionValueList.fromJson(o.toJson()); |
| 1739 checkDimensionValueList(od); |
| 1740 }); |
| 1741 }); |
| 1742 |
| 1743 |
| 1744 unittest.group("obj-schema-DimensionValueRequest", () { |
| 1745 unittest.test("to-json--from-json", () { |
| 1746 var o = buildDimensionValueRequest(); |
| 1747 var od = new api.DimensionValueRequest.fromJson(o.toJson()); |
| 1748 checkDimensionValueRequest(od); |
| 1749 }); |
| 1750 }); |
| 1751 |
| 1752 |
| 1753 unittest.group("obj-schema-FileUrls", () { |
| 1754 unittest.test("to-json--from-json", () { |
| 1755 var o = buildFileUrls(); |
| 1756 var od = new api.FileUrls.fromJson(o.toJson()); |
| 1757 checkFileUrls(od); |
| 1758 }); |
| 1759 }); |
| 1760 |
| 1761 |
| 1762 unittest.group("obj-schema-File", () { |
| 1763 unittest.test("to-json--from-json", () { |
| 1764 var o = buildFile(); |
| 1765 var od = new api.File.fromJson(o.toJson()); |
| 1766 checkFile(od); |
| 1767 }); |
| 1768 }); |
| 1769 |
| 1770 |
| 1771 unittest.group("obj-schema-FileList", () { |
| 1772 unittest.test("to-json--from-json", () { |
| 1773 var o = buildFileList(); |
| 1774 var od = new api.FileList.fromJson(o.toJson()); |
| 1775 checkFileList(od); |
| 1776 }); |
| 1777 }); |
| 1778 |
| 1779 |
| 1780 unittest.group("obj-schema-FloodlightReportCompatibleFields", () { |
| 1781 unittest.test("to-json--from-json", () { |
| 1782 var o = buildFloodlightReportCompatibleFields(); |
| 1783 var od = new api.FloodlightReportCompatibleFields.fromJson(o.toJson()); |
| 1784 checkFloodlightReportCompatibleFields(od); |
| 1785 }); |
| 1786 }); |
| 1787 |
| 1788 |
| 1789 unittest.group("obj-schema-Metric", () { |
| 1790 unittest.test("to-json--from-json", () { |
| 1791 var o = buildMetric(); |
| 1792 var od = new api.Metric.fromJson(o.toJson()); |
| 1793 checkMetric(od); |
| 1794 }); |
| 1795 }); |
| 1796 |
| 1797 |
| 1798 unittest.group("obj-schema-PathToConversionReportCompatibleFields", () { |
| 1799 unittest.test("to-json--from-json", () { |
| 1800 var o = buildPathToConversionReportCompatibleFields(); |
| 1801 var od = new api.PathToConversionReportCompatibleFields.fromJson(o.toJson(
)); |
| 1802 checkPathToConversionReportCompatibleFields(od); |
| 1803 }); |
| 1804 }); |
| 1805 |
| 1806 |
| 1807 unittest.group("obj-schema-ReachReportCompatibleFields", () { |
| 1808 unittest.test("to-json--from-json", () { |
| 1809 var o = buildReachReportCompatibleFields(); |
| 1810 var od = new api.ReachReportCompatibleFields.fromJson(o.toJson()); |
| 1811 checkReachReportCompatibleFields(od); |
| 1812 }); |
| 1813 }); |
| 1814 |
| 1815 |
| 1816 unittest.group("obj-schema-Recipient", () { |
| 1817 unittest.test("to-json--from-json", () { |
| 1818 var o = buildRecipient(); |
| 1819 var od = new api.Recipient.fromJson(o.toJson()); |
| 1820 checkRecipient(od); |
| 1821 }); |
| 1822 }); |
| 1823 |
| 1824 |
| 1825 unittest.group("obj-schema-ReportActiveGrpCriteria", () { |
| 1826 unittest.test("to-json--from-json", () { |
| 1827 var o = buildReportActiveGrpCriteria(); |
| 1828 var od = new api.ReportActiveGrpCriteria.fromJson(o.toJson()); |
| 1829 checkReportActiveGrpCriteria(od); |
| 1830 }); |
| 1831 }); |
| 1832 |
| 1833 |
| 1834 unittest.group("obj-schema-ReportCriteria", () { |
| 1835 unittest.test("to-json--from-json", () { |
| 1836 var o = buildReportCriteria(); |
| 1837 var od = new api.ReportCriteria.fromJson(o.toJson()); |
| 1838 checkReportCriteria(od); |
| 1839 }); |
| 1840 }); |
| 1841 |
| 1842 |
| 1843 unittest.group("obj-schema-ReportCrossDimensionReachCriteria", () { |
| 1844 unittest.test("to-json--from-json", () { |
| 1845 var o = buildReportCrossDimensionReachCriteria(); |
| 1846 var od = new api.ReportCrossDimensionReachCriteria.fromJson(o.toJson()); |
| 1847 checkReportCrossDimensionReachCriteria(od); |
| 1848 }); |
| 1849 }); |
| 1850 |
| 1851 |
| 1852 unittest.group("obj-schema-ReportDelivery", () { |
| 1853 unittest.test("to-json--from-json", () { |
| 1854 var o = buildReportDelivery(); |
| 1855 var od = new api.ReportDelivery.fromJson(o.toJson()); |
| 1856 checkReportDelivery(od); |
| 1857 }); |
| 1858 }); |
| 1859 |
| 1860 |
| 1861 unittest.group("obj-schema-ReportFloodlightCriteriaReportProperties", () { |
| 1862 unittest.test("to-json--from-json", () { |
| 1863 var o = buildReportFloodlightCriteriaReportProperties(); |
| 1864 var od = new api.ReportFloodlightCriteriaReportProperties.fromJson(o.toJso
n()); |
| 1865 checkReportFloodlightCriteriaReportProperties(od); |
| 1866 }); |
| 1867 }); |
| 1868 |
| 1869 |
| 1870 unittest.group("obj-schema-ReportFloodlightCriteria", () { |
| 1871 unittest.test("to-json--from-json", () { |
| 1872 var o = buildReportFloodlightCriteria(); |
| 1873 var od = new api.ReportFloodlightCriteria.fromJson(o.toJson()); |
| 1874 checkReportFloodlightCriteria(od); |
| 1875 }); |
| 1876 }); |
| 1877 |
| 1878 |
| 1879 unittest.group("obj-schema-ReportPathToConversionCriteriaReportProperties", ()
{ |
| 1880 unittest.test("to-json--from-json", () { |
| 1881 var o = buildReportPathToConversionCriteriaReportProperties(); |
| 1882 var od = new api.ReportPathToConversionCriteriaReportProperties.fromJson(o
.toJson()); |
| 1883 checkReportPathToConversionCriteriaReportProperties(od); |
| 1884 }); |
| 1885 }); |
| 1886 |
| 1887 |
| 1888 unittest.group("obj-schema-ReportPathToConversionCriteria", () { |
| 1889 unittest.test("to-json--from-json", () { |
| 1890 var o = buildReportPathToConversionCriteria(); |
| 1891 var od = new api.ReportPathToConversionCriteria.fromJson(o.toJson()); |
| 1892 checkReportPathToConversionCriteria(od); |
| 1893 }); |
| 1894 }); |
| 1895 |
| 1896 |
| 1897 unittest.group("obj-schema-ReportReachCriteria", () { |
| 1898 unittest.test("to-json--from-json", () { |
| 1899 var o = buildReportReachCriteria(); |
| 1900 var od = new api.ReportReachCriteria.fromJson(o.toJson()); |
| 1901 checkReportReachCriteria(od); |
| 1902 }); |
| 1903 }); |
| 1904 |
| 1905 |
| 1906 unittest.group("obj-schema-ReportSchedule", () { |
| 1907 unittest.test("to-json--from-json", () { |
| 1908 var o = buildReportSchedule(); |
| 1909 var od = new api.ReportSchedule.fromJson(o.toJson()); |
| 1910 checkReportSchedule(od); |
| 1911 }); |
| 1912 }); |
| 1913 |
| 1914 |
| 1915 unittest.group("obj-schema-Report", () { |
| 1916 unittest.test("to-json--from-json", () { |
| 1917 var o = buildReport(); |
| 1918 var od = new api.Report.fromJson(o.toJson()); |
| 1919 checkReport(od); |
| 1920 }); |
| 1921 }); |
| 1922 |
| 1923 |
| 1924 unittest.group("obj-schema-ReportCompatibleFields", () { |
| 1925 unittest.test("to-json--from-json", () { |
| 1926 var o = buildReportCompatibleFields(); |
| 1927 var od = new api.ReportCompatibleFields.fromJson(o.toJson()); |
| 1928 checkReportCompatibleFields(od); |
| 1929 }); |
| 1930 }); |
| 1931 |
| 1932 |
| 1933 unittest.group("obj-schema-ReportList", () { |
| 1934 unittest.test("to-json--from-json", () { |
| 1935 var o = buildReportList(); |
| 1936 var od = new api.ReportList.fromJson(o.toJson()); |
| 1937 checkReportList(od); |
| 1938 }); |
| 1939 }); |
| 1940 |
| 1941 |
| 1942 unittest.group("obj-schema-SortedDimension", () { |
| 1943 unittest.test("to-json--from-json", () { |
| 1944 var o = buildSortedDimension(); |
| 1945 var od = new api.SortedDimension.fromJson(o.toJson()); |
| 1946 checkSortedDimension(od); |
| 1947 }); |
| 1948 }); |
| 1949 |
| 1950 |
| 1951 unittest.group("obj-schema-UserProfile", () { |
| 1952 unittest.test("to-json--from-json", () { |
| 1953 var o = buildUserProfile(); |
| 1954 var od = new api.UserProfile.fromJson(o.toJson()); |
| 1955 checkUserProfile(od); |
| 1956 }); |
| 1957 }); |
| 1958 |
| 1959 |
| 1960 unittest.group("obj-schema-UserProfileList", () { |
| 1961 unittest.test("to-json--from-json", () { |
| 1962 var o = buildUserProfileList(); |
| 1963 var od = new api.UserProfileList.fromJson(o.toJson()); |
| 1964 checkUserProfileList(od); |
| 1965 }); |
| 1966 }); |
| 1967 |
| 1968 |
| 1969 unittest.group("resource-DimensionValuesResourceApi", () { |
| 1970 unittest.test("method--query", () { |
| 1971 |
| 1972 var mock = new common_test.HttpServerMock(); |
| 1973 api.DimensionValuesResourceApi res = new api.DfareportingApi(mock).dimensi
onValues; |
| 1974 var arg_request = buildDimensionValueRequest(); |
| 1975 var arg_profileId = "foo"; |
| 1976 var arg_maxResults = 42; |
| 1977 var arg_pageToken = "foo"; |
| 1978 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1979 var obj = new api.DimensionValueRequest.fromJson(json); |
| 1980 checkDimensionValueRequest(obj); |
| 1981 |
| 1982 var path = (req.url).path; |
| 1983 var pathOffset = 0; |
| 1984 var index; |
| 1985 var subPart; |
| 1986 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 1987 pathOffset += 19; |
| 1988 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 1989 pathOffset += 13; |
| 1990 index = path.indexOf("/dimensionvalues/query", pathOffset); |
| 1991 unittest.expect(index >= 0, unittest.isTrue); |
| 1992 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1993 pathOffset = index; |
| 1994 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 1995 unittest.expect(path.substring(pathOffset, pathOffset + 22), unittest.eq
uals("/dimensionvalues/query")); |
| 1996 pathOffset += 22; |
| 1997 |
| 1998 var query = (req.url).query; |
| 1999 var queryOffset = 0; |
| 2000 var queryMap = {}; |
| 2001 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2002 parseBool(n) { |
| 2003 if (n == "true") return true; |
| 2004 if (n == "false") return false; |
| 2005 if (n == null) return null; |
| 2006 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2007 } |
| 2008 if (query.length > 0) { |
| 2009 for (var part in query.split("&")) { |
| 2010 var keyvalue = part.split("="); |
| 2011 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2012 } |
| 2013 } |
| 2014 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 2015 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2016 |
| 2017 |
| 2018 var h = { |
| 2019 "content-type" : "application/json; charset=utf-8", |
| 2020 }; |
| 2021 var resp = convert.JSON.encode(buildDimensionValueList()); |
| 2022 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2023 }), true); |
| 2024 res.query(arg_request, arg_profileId, maxResults: arg_maxResults, pageToke
n: arg_pageToken).then(unittest.expectAsync(((api.DimensionValueList response) { |
| 2025 checkDimensionValueList(response); |
| 2026 }))); |
| 2027 }); |
| 2028 |
| 2029 }); |
| 2030 |
| 2031 |
| 2032 unittest.group("resource-FilesResourceApi", () { |
| 2033 unittest.test("method--get", () { |
| 2034 // TODO: Implement tests for media upload; |
| 2035 // TODO: Implement tests for media download; |
| 2036 |
| 2037 var mock = new common_test.HttpServerMock(); |
| 2038 api.FilesResourceApi res = new api.DfareportingApi(mock).files; |
| 2039 var arg_reportId = "foo"; |
| 2040 var arg_fileId = "foo"; |
| 2041 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2042 var path = (req.url).path; |
| 2043 var pathOffset = 0; |
| 2044 var index; |
| 2045 var subPart; |
| 2046 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2047 pathOffset += 19; |
| 2048 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("reports/")); |
| 2049 pathOffset += 8; |
| 2050 index = path.indexOf("/files/", pathOffset); |
| 2051 unittest.expect(index >= 0, unittest.isTrue); |
| 2052 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2053 pathOffset = index; |
| 2054 unittest.expect(subPart, unittest.equals("$arg_reportId")); |
| 2055 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/files/")); |
| 2056 pathOffset += 7; |
| 2057 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2058 pathOffset = path.length; |
| 2059 unittest.expect(subPart, unittest.equals("$arg_fileId")); |
| 2060 |
| 2061 var query = (req.url).query; |
| 2062 var queryOffset = 0; |
| 2063 var queryMap = {}; |
| 2064 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2065 parseBool(n) { |
| 2066 if (n == "true") return true; |
| 2067 if (n == "false") return false; |
| 2068 if (n == null) return null; |
| 2069 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2070 } |
| 2071 if (query.length > 0) { |
| 2072 for (var part in query.split("&")) { |
| 2073 var keyvalue = part.split("="); |
| 2074 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2075 } |
| 2076 } |
| 2077 |
| 2078 |
| 2079 var h = { |
| 2080 "content-type" : "application/json; charset=utf-8", |
| 2081 }; |
| 2082 var resp = convert.JSON.encode(buildFile()); |
| 2083 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2084 }), true); |
| 2085 res.get(arg_reportId, arg_fileId).then(unittest.expectAsync(((api.File res
ponse) { |
| 2086 checkFile(response); |
| 2087 }))); |
| 2088 }); |
| 2089 |
| 2090 unittest.test("method--list", () { |
| 2091 |
| 2092 var mock = new common_test.HttpServerMock(); |
| 2093 api.FilesResourceApi res = new api.DfareportingApi(mock).files; |
| 2094 var arg_profileId = "foo"; |
| 2095 var arg_maxResults = 42; |
| 2096 var arg_pageToken = "foo"; |
| 2097 var arg_scope = "foo"; |
| 2098 var arg_sortField = "foo"; |
| 2099 var arg_sortOrder = "foo"; |
| 2100 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2101 var path = (req.url).path; |
| 2102 var pathOffset = 0; |
| 2103 var index; |
| 2104 var subPart; |
| 2105 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2106 pathOffset += 19; |
| 2107 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 2108 pathOffset += 13; |
| 2109 index = path.indexOf("/files", pathOffset); |
| 2110 unittest.expect(index >= 0, unittest.isTrue); |
| 2111 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2112 pathOffset = index; |
| 2113 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 2114 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/files")); |
| 2115 pathOffset += 6; |
| 2116 |
| 2117 var query = (req.url).query; |
| 2118 var queryOffset = 0; |
| 2119 var queryMap = {}; |
| 2120 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2121 parseBool(n) { |
| 2122 if (n == "true") return true; |
| 2123 if (n == "false") return false; |
| 2124 if (n == null) return null; |
| 2125 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2126 } |
| 2127 if (query.length > 0) { |
| 2128 for (var part in query.split("&")) { |
| 2129 var keyvalue = part.split("="); |
| 2130 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2131 } |
| 2132 } |
| 2133 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 2134 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2135 unittest.expect(queryMap["scope"].first, unittest.equals(arg_scope)); |
| 2136 unittest.expect(queryMap["sortField"].first, unittest.equals(arg_sortFie
ld)); |
| 2137 unittest.expect(queryMap["sortOrder"].first, unittest.equals(arg_sortOrd
er)); |
| 2138 |
| 2139 |
| 2140 var h = { |
| 2141 "content-type" : "application/json; charset=utf-8", |
| 2142 }; |
| 2143 var resp = convert.JSON.encode(buildFileList()); |
| 2144 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2145 }), true); |
| 2146 res.list(arg_profileId, maxResults: arg_maxResults, pageToken: arg_pageTok
en, scope: arg_scope, sortField: arg_sortField, sortOrder: arg_sortOrder).then(u
nittest.expectAsync(((api.FileList response) { |
| 2147 checkFileList(response); |
| 2148 }))); |
| 2149 }); |
| 2150 |
| 2151 }); |
| 2152 |
| 2153 |
| 2154 unittest.group("resource-ReportsResourceApi", () { |
| 2155 unittest.test("method--delete", () { |
| 2156 |
| 2157 var mock = new common_test.HttpServerMock(); |
| 2158 api.ReportsResourceApi res = new api.DfareportingApi(mock).reports; |
| 2159 var arg_profileId = "foo"; |
| 2160 var arg_reportId = "foo"; |
| 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 + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2167 pathOffset += 19; |
| 2168 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 2169 pathOffset += 13; |
| 2170 index = path.indexOf("/reports/", 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_profileId")); |
| 2175 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/reports/")); |
| 2176 pathOffset += 9; |
| 2177 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2178 pathOffset = path.length; |
| 2179 unittest.expect(subPart, unittest.equals("$arg_reportId")); |
| 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 |
| 2198 |
| 2199 var h = { |
| 2200 "content-type" : "application/json; charset=utf-8", |
| 2201 }; |
| 2202 var resp = ""; |
| 2203 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2204 }), true); |
| 2205 res.delete(arg_profileId, arg_reportId).then(unittest.expectAsync((_) {}))
; |
| 2206 }); |
| 2207 |
| 2208 unittest.test("method--get", () { |
| 2209 |
| 2210 var mock = new common_test.HttpServerMock(); |
| 2211 api.ReportsResourceApi res = new api.DfareportingApi(mock).reports; |
| 2212 var arg_profileId = "foo"; |
| 2213 var arg_reportId = "foo"; |
| 2214 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2215 var path = (req.url).path; |
| 2216 var pathOffset = 0; |
| 2217 var index; |
| 2218 var subPart; |
| 2219 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2220 pathOffset += 19; |
| 2221 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 2222 pathOffset += 13; |
| 2223 index = path.indexOf("/reports/", pathOffset); |
| 2224 unittest.expect(index >= 0, unittest.isTrue); |
| 2225 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2226 pathOffset = index; |
| 2227 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 2228 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/reports/")); |
| 2229 pathOffset += 9; |
| 2230 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2231 pathOffset = path.length; |
| 2232 unittest.expect(subPart, unittest.equals("$arg_reportId")); |
| 2233 |
| 2234 var query = (req.url).query; |
| 2235 var queryOffset = 0; |
| 2236 var queryMap = {}; |
| 2237 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2238 parseBool(n) { |
| 2239 if (n == "true") return true; |
| 2240 if (n == "false") return false; |
| 2241 if (n == null) return null; |
| 2242 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2243 } |
| 2244 if (query.length > 0) { |
| 2245 for (var part in query.split("&")) { |
| 2246 var keyvalue = part.split("="); |
| 2247 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2248 } |
| 2249 } |
| 2250 |
| 2251 |
| 2252 var h = { |
| 2253 "content-type" : "application/json; charset=utf-8", |
| 2254 }; |
| 2255 var resp = convert.JSON.encode(buildReport()); |
| 2256 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2257 }), true); |
| 2258 res.get(arg_profileId, arg_reportId).then(unittest.expectAsync(((api.Repor
t response) { |
| 2259 checkReport(response); |
| 2260 }))); |
| 2261 }); |
| 2262 |
| 2263 unittest.test("method--insert", () { |
| 2264 |
| 2265 var mock = new common_test.HttpServerMock(); |
| 2266 api.ReportsResourceApi res = new api.DfareportingApi(mock).reports; |
| 2267 var arg_request = buildReport(); |
| 2268 var arg_profileId = "foo"; |
| 2269 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2270 var obj = new api.Report.fromJson(json); |
| 2271 checkReport(obj); |
| 2272 |
| 2273 var path = (req.url).path; |
| 2274 var pathOffset = 0; |
| 2275 var index; |
| 2276 var subPart; |
| 2277 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2278 pathOffset += 19; |
| 2279 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 2280 pathOffset += 13; |
| 2281 index = path.indexOf("/reports", pathOffset); |
| 2282 unittest.expect(index >= 0, unittest.isTrue); |
| 2283 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2284 pathOffset = index; |
| 2285 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 2286 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/reports")); |
| 2287 pathOffset += 8; |
| 2288 |
| 2289 var query = (req.url).query; |
| 2290 var queryOffset = 0; |
| 2291 var queryMap = {}; |
| 2292 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2293 parseBool(n) { |
| 2294 if (n == "true") return true; |
| 2295 if (n == "false") return false; |
| 2296 if (n == null) return null; |
| 2297 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2298 } |
| 2299 if (query.length > 0) { |
| 2300 for (var part in query.split("&")) { |
| 2301 var keyvalue = part.split("="); |
| 2302 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2303 } |
| 2304 } |
| 2305 |
| 2306 |
| 2307 var h = { |
| 2308 "content-type" : "application/json; charset=utf-8", |
| 2309 }; |
| 2310 var resp = convert.JSON.encode(buildReport()); |
| 2311 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2312 }), true); |
| 2313 res.insert(arg_request, arg_profileId).then(unittest.expectAsync(((api.Rep
ort response) { |
| 2314 checkReport(response); |
| 2315 }))); |
| 2316 }); |
| 2317 |
| 2318 unittest.test("method--list", () { |
| 2319 |
| 2320 var mock = new common_test.HttpServerMock(); |
| 2321 api.ReportsResourceApi res = new api.DfareportingApi(mock).reports; |
| 2322 var arg_profileId = "foo"; |
| 2323 var arg_maxResults = 42; |
| 2324 var arg_pageToken = "foo"; |
| 2325 var arg_scope = "foo"; |
| 2326 var arg_sortField = "foo"; |
| 2327 var arg_sortOrder = "foo"; |
| 2328 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2329 var path = (req.url).path; |
| 2330 var pathOffset = 0; |
| 2331 var index; |
| 2332 var subPart; |
| 2333 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2334 pathOffset += 19; |
| 2335 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 2336 pathOffset += 13; |
| 2337 index = path.indexOf("/reports", pathOffset); |
| 2338 unittest.expect(index >= 0, unittest.isTrue); |
| 2339 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2340 pathOffset = index; |
| 2341 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 2342 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/reports")); |
| 2343 pathOffset += 8; |
| 2344 |
| 2345 var query = (req.url).query; |
| 2346 var queryOffset = 0; |
| 2347 var queryMap = {}; |
| 2348 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2349 parseBool(n) { |
| 2350 if (n == "true") return true; |
| 2351 if (n == "false") return false; |
| 2352 if (n == null) return null; |
| 2353 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2354 } |
| 2355 if (query.length > 0) { |
| 2356 for (var part in query.split("&")) { |
| 2357 var keyvalue = part.split("="); |
| 2358 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2359 } |
| 2360 } |
| 2361 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 2362 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2363 unittest.expect(queryMap["scope"].first, unittest.equals(arg_scope)); |
| 2364 unittest.expect(queryMap["sortField"].first, unittest.equals(arg_sortFie
ld)); |
| 2365 unittest.expect(queryMap["sortOrder"].first, unittest.equals(arg_sortOrd
er)); |
| 2366 |
| 2367 |
| 2368 var h = { |
| 2369 "content-type" : "application/json; charset=utf-8", |
| 2370 }; |
| 2371 var resp = convert.JSON.encode(buildReportList()); |
| 2372 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2373 }), true); |
| 2374 res.list(arg_profileId, maxResults: arg_maxResults, pageToken: arg_pageTok
en, scope: arg_scope, sortField: arg_sortField, sortOrder: arg_sortOrder).then(u
nittest.expectAsync(((api.ReportList response) { |
| 2375 checkReportList(response); |
| 2376 }))); |
| 2377 }); |
| 2378 |
| 2379 unittest.test("method--patch", () { |
| 2380 |
| 2381 var mock = new common_test.HttpServerMock(); |
| 2382 api.ReportsResourceApi res = new api.DfareportingApi(mock).reports; |
| 2383 var arg_request = buildReport(); |
| 2384 var arg_profileId = "foo"; |
| 2385 var arg_reportId = "foo"; |
| 2386 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2387 var obj = new api.Report.fromJson(json); |
| 2388 checkReport(obj); |
| 2389 |
| 2390 var path = (req.url).path; |
| 2391 var pathOffset = 0; |
| 2392 var index; |
| 2393 var subPart; |
| 2394 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2395 pathOffset += 19; |
| 2396 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 2397 pathOffset += 13; |
| 2398 index = path.indexOf("/reports/", pathOffset); |
| 2399 unittest.expect(index >= 0, unittest.isTrue); |
| 2400 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2401 pathOffset = index; |
| 2402 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 2403 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/reports/")); |
| 2404 pathOffset += 9; |
| 2405 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2406 pathOffset = path.length; |
| 2407 unittest.expect(subPart, unittest.equals("$arg_reportId")); |
| 2408 |
| 2409 var query = (req.url).query; |
| 2410 var queryOffset = 0; |
| 2411 var queryMap = {}; |
| 2412 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2413 parseBool(n) { |
| 2414 if (n == "true") return true; |
| 2415 if (n == "false") return false; |
| 2416 if (n == null) return null; |
| 2417 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2418 } |
| 2419 if (query.length > 0) { |
| 2420 for (var part in query.split("&")) { |
| 2421 var keyvalue = part.split("="); |
| 2422 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2423 } |
| 2424 } |
| 2425 |
| 2426 |
| 2427 var h = { |
| 2428 "content-type" : "application/json; charset=utf-8", |
| 2429 }; |
| 2430 var resp = convert.JSON.encode(buildReport()); |
| 2431 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2432 }), true); |
| 2433 res.patch(arg_request, arg_profileId, arg_reportId).then(unittest.expectAs
ync(((api.Report response) { |
| 2434 checkReport(response); |
| 2435 }))); |
| 2436 }); |
| 2437 |
| 2438 unittest.test("method--run", () { |
| 2439 |
| 2440 var mock = new common_test.HttpServerMock(); |
| 2441 api.ReportsResourceApi res = new api.DfareportingApi(mock).reports; |
| 2442 var arg_profileId = "foo"; |
| 2443 var arg_reportId = "foo"; |
| 2444 var arg_synchronous = true; |
| 2445 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2446 var path = (req.url).path; |
| 2447 var pathOffset = 0; |
| 2448 var index; |
| 2449 var subPart; |
| 2450 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2451 pathOffset += 19; |
| 2452 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 2453 pathOffset += 13; |
| 2454 index = path.indexOf("/reports/", pathOffset); |
| 2455 unittest.expect(index >= 0, unittest.isTrue); |
| 2456 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2457 pathOffset = index; |
| 2458 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 2459 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/reports/")); |
| 2460 pathOffset += 9; |
| 2461 index = path.indexOf("/run", pathOffset); |
| 2462 unittest.expect(index >= 0, unittest.isTrue); |
| 2463 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2464 pathOffset = index; |
| 2465 unittest.expect(subPart, unittest.equals("$arg_reportId")); |
| 2466 unittest.expect(path.substring(pathOffset, pathOffset + 4), unittest.equ
als("/run")); |
| 2467 pathOffset += 4; |
| 2468 |
| 2469 var query = (req.url).query; |
| 2470 var queryOffset = 0; |
| 2471 var queryMap = {}; |
| 2472 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2473 parseBool(n) { |
| 2474 if (n == "true") return true; |
| 2475 if (n == "false") return false; |
| 2476 if (n == null) return null; |
| 2477 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2478 } |
| 2479 if (query.length > 0) { |
| 2480 for (var part in query.split("&")) { |
| 2481 var keyvalue = part.split("="); |
| 2482 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2483 } |
| 2484 } |
| 2485 unittest.expect(queryMap["synchronous"].first, unittest.equals("$arg_syn
chronous")); |
| 2486 |
| 2487 |
| 2488 var h = { |
| 2489 "content-type" : "application/json; charset=utf-8", |
| 2490 }; |
| 2491 var resp = convert.JSON.encode(buildFile()); |
| 2492 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2493 }), true); |
| 2494 res.run(arg_profileId, arg_reportId, synchronous: arg_synchronous).then(un
ittest.expectAsync(((api.File response) { |
| 2495 checkFile(response); |
| 2496 }))); |
| 2497 }); |
| 2498 |
| 2499 unittest.test("method--update", () { |
| 2500 |
| 2501 var mock = new common_test.HttpServerMock(); |
| 2502 api.ReportsResourceApi res = new api.DfareportingApi(mock).reports; |
| 2503 var arg_request = buildReport(); |
| 2504 var arg_profileId = "foo"; |
| 2505 var arg_reportId = "foo"; |
| 2506 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2507 var obj = new api.Report.fromJson(json); |
| 2508 checkReport(obj); |
| 2509 |
| 2510 var path = (req.url).path; |
| 2511 var pathOffset = 0; |
| 2512 var index; |
| 2513 var subPart; |
| 2514 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2515 pathOffset += 19; |
| 2516 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 2517 pathOffset += 13; |
| 2518 index = path.indexOf("/reports/", pathOffset); |
| 2519 unittest.expect(index >= 0, unittest.isTrue); |
| 2520 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2521 pathOffset = index; |
| 2522 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 2523 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/reports/")); |
| 2524 pathOffset += 9; |
| 2525 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2526 pathOffset = path.length; |
| 2527 unittest.expect(subPart, unittest.equals("$arg_reportId")); |
| 2528 |
| 2529 var query = (req.url).query; |
| 2530 var queryOffset = 0; |
| 2531 var queryMap = {}; |
| 2532 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2533 parseBool(n) { |
| 2534 if (n == "true") return true; |
| 2535 if (n == "false") return false; |
| 2536 if (n == null) return null; |
| 2537 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2538 } |
| 2539 if (query.length > 0) { |
| 2540 for (var part in query.split("&")) { |
| 2541 var keyvalue = part.split("="); |
| 2542 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2543 } |
| 2544 } |
| 2545 |
| 2546 |
| 2547 var h = { |
| 2548 "content-type" : "application/json; charset=utf-8", |
| 2549 }; |
| 2550 var resp = convert.JSON.encode(buildReport()); |
| 2551 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2552 }), true); |
| 2553 res.update(arg_request, arg_profileId, arg_reportId).then(unittest.expectA
sync(((api.Report response) { |
| 2554 checkReport(response); |
| 2555 }))); |
| 2556 }); |
| 2557 |
| 2558 }); |
| 2559 |
| 2560 |
| 2561 unittest.group("resource-ReportsCompatibleFieldsResourceApi", () { |
| 2562 unittest.test("method--query", () { |
| 2563 |
| 2564 var mock = new common_test.HttpServerMock(); |
| 2565 api.ReportsCompatibleFieldsResourceApi res = new api.DfareportingApi(mock)
.reports.compatibleFields; |
| 2566 var arg_request = buildReport(); |
| 2567 var arg_profileId = "foo"; |
| 2568 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2569 var obj = new api.Report.fromJson(json); |
| 2570 checkReport(obj); |
| 2571 |
| 2572 var path = (req.url).path; |
| 2573 var pathOffset = 0; |
| 2574 var index; |
| 2575 var subPart; |
| 2576 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2577 pathOffset += 19; |
| 2578 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 2579 pathOffset += 13; |
| 2580 index = path.indexOf("/reports/compatiblefields/query", pathOffset); |
| 2581 unittest.expect(index >= 0, unittest.isTrue); |
| 2582 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2583 pathOffset = index; |
| 2584 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 2585 unittest.expect(path.substring(pathOffset, pathOffset + 31), unittest.eq
uals("/reports/compatiblefields/query")); |
| 2586 pathOffset += 31; |
| 2587 |
| 2588 var query = (req.url).query; |
| 2589 var queryOffset = 0; |
| 2590 var queryMap = {}; |
| 2591 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2592 parseBool(n) { |
| 2593 if (n == "true") return true; |
| 2594 if (n == "false") return false; |
| 2595 if (n == null) return null; |
| 2596 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2597 } |
| 2598 if (query.length > 0) { |
| 2599 for (var part in query.split("&")) { |
| 2600 var keyvalue = part.split("="); |
| 2601 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2602 } |
| 2603 } |
| 2604 |
| 2605 |
| 2606 var h = { |
| 2607 "content-type" : "application/json; charset=utf-8", |
| 2608 }; |
| 2609 var resp = convert.JSON.encode(buildCompatibleFields()); |
| 2610 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2611 }), true); |
| 2612 res.query(arg_request, arg_profileId).then(unittest.expectAsync(((api.Comp
atibleFields response) { |
| 2613 checkCompatibleFields(response); |
| 2614 }))); |
| 2615 }); |
| 2616 |
| 2617 }); |
| 2618 |
| 2619 |
| 2620 unittest.group("resource-ReportsFilesResourceApi", () { |
| 2621 unittest.test("method--get", () { |
| 2622 // TODO: Implement tests for media upload; |
| 2623 // TODO: Implement tests for media download; |
| 2624 |
| 2625 var mock = new common_test.HttpServerMock(); |
| 2626 api.ReportsFilesResourceApi res = new api.DfareportingApi(mock).reports.fi
les; |
| 2627 var arg_profileId = "foo"; |
| 2628 var arg_reportId = "foo"; |
| 2629 var arg_fileId = "foo"; |
| 2630 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2631 var path = (req.url).path; |
| 2632 var pathOffset = 0; |
| 2633 var index; |
| 2634 var subPart; |
| 2635 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2636 pathOffset += 19; |
| 2637 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 2638 pathOffset += 13; |
| 2639 index = path.indexOf("/reports/", pathOffset); |
| 2640 unittest.expect(index >= 0, unittest.isTrue); |
| 2641 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2642 pathOffset = index; |
| 2643 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 2644 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/reports/")); |
| 2645 pathOffset += 9; |
| 2646 index = path.indexOf("/files/", pathOffset); |
| 2647 unittest.expect(index >= 0, unittest.isTrue); |
| 2648 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2649 pathOffset = index; |
| 2650 unittest.expect(subPart, unittest.equals("$arg_reportId")); |
| 2651 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/files/")); |
| 2652 pathOffset += 7; |
| 2653 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2654 pathOffset = path.length; |
| 2655 unittest.expect(subPart, unittest.equals("$arg_fileId")); |
| 2656 |
| 2657 var query = (req.url).query; |
| 2658 var queryOffset = 0; |
| 2659 var queryMap = {}; |
| 2660 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2661 parseBool(n) { |
| 2662 if (n == "true") return true; |
| 2663 if (n == "false") return false; |
| 2664 if (n == null) return null; |
| 2665 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2666 } |
| 2667 if (query.length > 0) { |
| 2668 for (var part in query.split("&")) { |
| 2669 var keyvalue = part.split("="); |
| 2670 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2671 } |
| 2672 } |
| 2673 |
| 2674 |
| 2675 var h = { |
| 2676 "content-type" : "application/json; charset=utf-8", |
| 2677 }; |
| 2678 var resp = convert.JSON.encode(buildFile()); |
| 2679 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2680 }), true); |
| 2681 res.get(arg_profileId, arg_reportId, arg_fileId).then(unittest.expectAsync
(((api.File response) { |
| 2682 checkFile(response); |
| 2683 }))); |
| 2684 }); |
| 2685 |
| 2686 unittest.test("method--list", () { |
| 2687 |
| 2688 var mock = new common_test.HttpServerMock(); |
| 2689 api.ReportsFilesResourceApi res = new api.DfareportingApi(mock).reports.fi
les; |
| 2690 var arg_profileId = "foo"; |
| 2691 var arg_reportId = "foo"; |
| 2692 var arg_maxResults = 42; |
| 2693 var arg_pageToken = "foo"; |
| 2694 var arg_sortField = "foo"; |
| 2695 var arg_sortOrder = "foo"; |
| 2696 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2697 var path = (req.url).path; |
| 2698 var pathOffset = 0; |
| 2699 var index; |
| 2700 var subPart; |
| 2701 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2702 pathOffset += 19; |
| 2703 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 2704 pathOffset += 13; |
| 2705 index = path.indexOf("/reports/", pathOffset); |
| 2706 unittest.expect(index >= 0, unittest.isTrue); |
| 2707 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2708 pathOffset = index; |
| 2709 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 2710 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/reports/")); |
| 2711 pathOffset += 9; |
| 2712 index = path.indexOf("/files", pathOffset); |
| 2713 unittest.expect(index >= 0, unittest.isTrue); |
| 2714 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2715 pathOffset = index; |
| 2716 unittest.expect(subPart, unittest.equals("$arg_reportId")); |
| 2717 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/files")); |
| 2718 pathOffset += 6; |
| 2719 |
| 2720 var query = (req.url).query; |
| 2721 var queryOffset = 0; |
| 2722 var queryMap = {}; |
| 2723 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2724 parseBool(n) { |
| 2725 if (n == "true") return true; |
| 2726 if (n == "false") return false; |
| 2727 if (n == null) return null; |
| 2728 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2729 } |
| 2730 if (query.length > 0) { |
| 2731 for (var part in query.split("&")) { |
| 2732 var keyvalue = part.split("="); |
| 2733 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2734 } |
| 2735 } |
| 2736 unittest.expect(core.int.parse(queryMap["maxResults"].first), unittest.e
quals(arg_maxResults)); |
| 2737 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2738 unittest.expect(queryMap["sortField"].first, unittest.equals(arg_sortFie
ld)); |
| 2739 unittest.expect(queryMap["sortOrder"].first, unittest.equals(arg_sortOrd
er)); |
| 2740 |
| 2741 |
| 2742 var h = { |
| 2743 "content-type" : "application/json; charset=utf-8", |
| 2744 }; |
| 2745 var resp = convert.JSON.encode(buildFileList()); |
| 2746 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2747 }), true); |
| 2748 res.list(arg_profileId, arg_reportId, maxResults: arg_maxResults, pageToke
n: arg_pageToken, sortField: arg_sortField, sortOrder: arg_sortOrder).then(unitt
est.expectAsync(((api.FileList response) { |
| 2749 checkFileList(response); |
| 2750 }))); |
| 2751 }); |
| 2752 |
| 2753 }); |
| 2754 |
| 2755 |
| 2756 unittest.group("resource-UserProfilesResourceApi", () { |
| 2757 unittest.test("method--get", () { |
| 2758 |
| 2759 var mock = new common_test.HttpServerMock(); |
| 2760 api.UserProfilesResourceApi res = new api.DfareportingApi(mock).userProfil
es; |
| 2761 var arg_profileId = "foo"; |
| 2762 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2763 var path = (req.url).path; |
| 2764 var pathOffset = 0; |
| 2765 var index; |
| 2766 var subPart; |
| 2767 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2768 pathOffset += 19; |
| 2769 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("userprofiles/")); |
| 2770 pathOffset += 13; |
| 2771 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2772 pathOffset = path.length; |
| 2773 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 2774 |
| 2775 var query = (req.url).query; |
| 2776 var queryOffset = 0; |
| 2777 var queryMap = {}; |
| 2778 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2779 parseBool(n) { |
| 2780 if (n == "true") return true; |
| 2781 if (n == "false") return false; |
| 2782 if (n == null) return null; |
| 2783 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2784 } |
| 2785 if (query.length > 0) { |
| 2786 for (var part in query.split("&")) { |
| 2787 var keyvalue = part.split("="); |
| 2788 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2789 } |
| 2790 } |
| 2791 |
| 2792 |
| 2793 var h = { |
| 2794 "content-type" : "application/json; charset=utf-8", |
| 2795 }; |
| 2796 var resp = convert.JSON.encode(buildUserProfile()); |
| 2797 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2798 }), true); |
| 2799 res.get(arg_profileId).then(unittest.expectAsync(((api.UserProfile respons
e) { |
| 2800 checkUserProfile(response); |
| 2801 }))); |
| 2802 }); |
| 2803 |
| 2804 unittest.test("method--list", () { |
| 2805 |
| 2806 var mock = new common_test.HttpServerMock(); |
| 2807 api.UserProfilesResourceApi res = new api.DfareportingApi(mock).userProfil
es; |
| 2808 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2809 var path = (req.url).path; |
| 2810 var pathOffset = 0; |
| 2811 var index; |
| 2812 var subPart; |
| 2813 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/dfareporting/v1.3/")); |
| 2814 pathOffset += 19; |
| 2815 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("userprofiles")); |
| 2816 pathOffset += 12; |
| 2817 |
| 2818 var query = (req.url).query; |
| 2819 var queryOffset = 0; |
| 2820 var queryMap = {}; |
| 2821 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2822 parseBool(n) { |
| 2823 if (n == "true") return true; |
| 2824 if (n == "false") return false; |
| 2825 if (n == null) return null; |
| 2826 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2827 } |
| 2828 if (query.length > 0) { |
| 2829 for (var part in query.split("&")) { |
| 2830 var keyvalue = part.split("="); |
| 2831 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2832 } |
| 2833 } |
| 2834 |
| 2835 |
| 2836 var h = { |
| 2837 "content-type" : "application/json; charset=utf-8", |
| 2838 }; |
| 2839 var resp = convert.JSON.encode(buildUserProfileList()); |
| 2840 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 2841 }), true); |
| 2842 res.list().then(unittest.expectAsync(((api.UserProfileList response) { |
| 2843 checkUserProfileList(response); |
| 2844 }))); |
| 2845 }); |
| 2846 |
| 2847 }); |
| 2848 |
| 2849 |
| 2850 } |
| 2851 |
OLD | NEW |