| OLD | NEW |
| 1 library googleapis_beta.adexchangebuyer2.v2beta1.test; | 1 library googleapis_beta.adexchangebuyer2.v2beta1.test; |
| 2 | 2 |
| 3 import "dart:core" as core; | 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; | 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; | 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; | 6 import "dart:convert" as convert; |
| 7 | 7 |
| 8 import 'package:http/http.dart' as http; | 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; | 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; | 10 import 'package:unittest/unittest.dart' as unittest; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 } | 46 } |
| 47 | 47 |
| 48 http.StreamedResponse stringResponse( | 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { | 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); | 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); | 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } | 52 } |
| 53 | 53 |
| 54 core.int buildCounterAddDealAssociationRequest = 0; |
| 55 buildAddDealAssociationRequest() { |
| 56 var o = new api.AddDealAssociationRequest(); |
| 57 buildCounterAddDealAssociationRequest++; |
| 58 if (buildCounterAddDealAssociationRequest < 3) { |
| 59 o.association = buildCreativeDealAssociation(); |
| 60 } |
| 61 buildCounterAddDealAssociationRequest--; |
| 62 return o; |
| 63 } |
| 64 |
| 65 checkAddDealAssociationRequest(api.AddDealAssociationRequest o) { |
| 66 buildCounterAddDealAssociationRequest++; |
| 67 if (buildCounterAddDealAssociationRequest < 3) { |
| 68 checkCreativeDealAssociation(o.association); |
| 69 } |
| 70 buildCounterAddDealAssociationRequest--; |
| 71 } |
| 72 |
| 73 buildUnnamed3467() { |
| 74 var o = new core.List<core.String>(); |
| 75 o.add("foo"); |
| 76 o.add("foo"); |
| 77 return o; |
| 78 } |
| 79 |
| 80 checkUnnamed3467(core.List<core.String> o) { |
| 81 unittest.expect(o, unittest.hasLength(2)); |
| 82 unittest.expect(o[0], unittest.equals('foo')); |
| 83 unittest.expect(o[1], unittest.equals('foo')); |
| 84 } |
| 85 |
| 86 core.int buildCounterAppContext = 0; |
| 87 buildAppContext() { |
| 88 var o = new api.AppContext(); |
| 89 buildCounterAppContext++; |
| 90 if (buildCounterAppContext < 3) { |
| 91 o.appTypes = buildUnnamed3467(); |
| 92 } |
| 93 buildCounterAppContext--; |
| 94 return o; |
| 95 } |
| 96 |
| 97 checkAppContext(api.AppContext o) { |
| 98 buildCounterAppContext++; |
| 99 if (buildCounterAppContext < 3) { |
| 100 checkUnnamed3467(o.appTypes); |
| 101 } |
| 102 buildCounterAppContext--; |
| 103 } |
| 104 |
| 105 buildUnnamed3468() { |
| 106 var o = new core.List<core.String>(); |
| 107 o.add("foo"); |
| 108 o.add("foo"); |
| 109 return o; |
| 110 } |
| 111 |
| 112 checkUnnamed3468(core.List<core.String> o) { |
| 113 unittest.expect(o, unittest.hasLength(2)); |
| 114 unittest.expect(o[0], unittest.equals('foo')); |
| 115 unittest.expect(o[1], unittest.equals('foo')); |
| 116 } |
| 117 |
| 118 core.int buildCounterAuctionContext = 0; |
| 119 buildAuctionContext() { |
| 120 var o = new api.AuctionContext(); |
| 121 buildCounterAuctionContext++; |
| 122 if (buildCounterAuctionContext < 3) { |
| 123 o.auctionTypes = buildUnnamed3468(); |
| 124 } |
| 125 buildCounterAuctionContext--; |
| 126 return o; |
| 127 } |
| 128 |
| 129 checkAuctionContext(api.AuctionContext o) { |
| 130 buildCounterAuctionContext++; |
| 131 if (buildCounterAuctionContext < 3) { |
| 132 checkUnnamed3468(o.auctionTypes); |
| 133 } |
| 134 buildCounterAuctionContext--; |
| 135 } |
| 136 |
| 54 core.int buildCounterClient = 0; | 137 core.int buildCounterClient = 0; |
| 55 buildClient() { | 138 buildClient() { |
| 56 var o = new api.Client(); | 139 var o = new api.Client(); |
| 57 buildCounterClient++; | 140 buildCounterClient++; |
| 58 if (buildCounterClient < 3) { | 141 if (buildCounterClient < 3) { |
| 59 o.clientAccountId = "foo"; | 142 o.clientAccountId = "foo"; |
| 60 o.clientName = "foo"; | 143 o.clientName = "foo"; |
| 61 o.entityId = "foo"; | 144 o.entityId = "foo"; |
| 62 o.entityName = "foo"; | 145 o.entityName = "foo"; |
| 63 o.entityType = "foo"; | 146 o.entityType = "foo"; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 checkClientUserInvitation(api.ClientUserInvitation o) { | 208 checkClientUserInvitation(api.ClientUserInvitation o) { |
| 126 buildCounterClientUserInvitation++; | 209 buildCounterClientUserInvitation++; |
| 127 if (buildCounterClientUserInvitation < 3) { | 210 if (buildCounterClientUserInvitation < 3) { |
| 128 unittest.expect(o.clientAccountId, unittest.equals('foo')); | 211 unittest.expect(o.clientAccountId, unittest.equals('foo')); |
| 129 unittest.expect(o.email, unittest.equals('foo')); | 212 unittest.expect(o.email, unittest.equals('foo')); |
| 130 unittest.expect(o.invitationId, unittest.equals('foo')); | 213 unittest.expect(o.invitationId, unittest.equals('foo')); |
| 131 } | 214 } |
| 132 buildCounterClientUserInvitation--; | 215 buildCounterClientUserInvitation--; |
| 133 } | 216 } |
| 134 | 217 |
| 135 buildUnnamed3885() { | 218 buildUnnamed3469() { |
| 219 var o = new core.List<api.ServingContext>(); |
| 220 o.add(buildServingContext()); |
| 221 o.add(buildServingContext()); |
| 222 return o; |
| 223 } |
| 224 |
| 225 checkUnnamed3469(core.List<api.ServingContext> o) { |
| 226 unittest.expect(o, unittest.hasLength(2)); |
| 227 checkServingContext(o[0]); |
| 228 checkServingContext(o[1]); |
| 229 } |
| 230 |
| 231 buildUnnamed3470() { |
| 232 var o = new core.List<core.String>(); |
| 233 o.add("foo"); |
| 234 o.add("foo"); |
| 235 return o; |
| 236 } |
| 237 |
| 238 checkUnnamed3470(core.List<core.String> o) { |
| 239 unittest.expect(o, unittest.hasLength(2)); |
| 240 unittest.expect(o[0], unittest.equals('foo')); |
| 241 unittest.expect(o[1], unittest.equals('foo')); |
| 242 } |
| 243 |
| 244 core.int buildCounterCorrection = 0; |
| 245 buildCorrection() { |
| 246 var o = new api.Correction(); |
| 247 buildCounterCorrection++; |
| 248 if (buildCounterCorrection < 3) { |
| 249 o.contexts = buildUnnamed3469(); |
| 250 o.details = buildUnnamed3470(); |
| 251 o.type = "foo"; |
| 252 } |
| 253 buildCounterCorrection--; |
| 254 return o; |
| 255 } |
| 256 |
| 257 checkCorrection(api.Correction o) { |
| 258 buildCounterCorrection++; |
| 259 if (buildCounterCorrection < 3) { |
| 260 checkUnnamed3469(o.contexts); |
| 261 checkUnnamed3470(o.details); |
| 262 unittest.expect(o.type, unittest.equals('foo')); |
| 263 } |
| 264 buildCounterCorrection--; |
| 265 } |
| 266 |
| 267 buildUnnamed3471() { |
| 268 var o = new core.List<core.String>(); |
| 269 o.add("foo"); |
| 270 o.add("foo"); |
| 271 return o; |
| 272 } |
| 273 |
| 274 checkUnnamed3471(core.List<core.String> o) { |
| 275 unittest.expect(o, unittest.hasLength(2)); |
| 276 unittest.expect(o[0], unittest.equals('foo')); |
| 277 unittest.expect(o[1], unittest.equals('foo')); |
| 278 } |
| 279 |
| 280 buildUnnamed3472() { |
| 281 var o = new core.List<core.String>(); |
| 282 o.add("foo"); |
| 283 o.add("foo"); |
| 284 return o; |
| 285 } |
| 286 |
| 287 checkUnnamed3472(core.List<core.String> o) { |
| 288 unittest.expect(o, unittest.hasLength(2)); |
| 289 unittest.expect(o[0], unittest.equals('foo')); |
| 290 unittest.expect(o[1], unittest.equals('foo')); |
| 291 } |
| 292 |
| 293 buildUnnamed3473() { |
| 294 var o = new core.List<api.Correction>(); |
| 295 o.add(buildCorrection()); |
| 296 o.add(buildCorrection()); |
| 297 return o; |
| 298 } |
| 299 |
| 300 checkUnnamed3473(core.List<api.Correction> o) { |
| 301 unittest.expect(o, unittest.hasLength(2)); |
| 302 checkCorrection(o[0]); |
| 303 checkCorrection(o[1]); |
| 304 } |
| 305 |
| 306 buildUnnamed3474() { |
| 307 var o = new core.List<core.String>(); |
| 308 o.add("foo"); |
| 309 o.add("foo"); |
| 310 return o; |
| 311 } |
| 312 |
| 313 checkUnnamed3474(core.List<core.String> o) { |
| 314 unittest.expect(o, unittest.hasLength(2)); |
| 315 unittest.expect(o[0], unittest.equals('foo')); |
| 316 unittest.expect(o[1], unittest.equals('foo')); |
| 317 } |
| 318 |
| 319 buildUnnamed3475() { |
| 320 var o = new core.List<core.String>(); |
| 321 o.add("foo"); |
| 322 o.add("foo"); |
| 323 return o; |
| 324 } |
| 325 |
| 326 checkUnnamed3475(core.List<core.String> o) { |
| 327 unittest.expect(o, unittest.hasLength(2)); |
| 328 unittest.expect(o[0], unittest.equals('foo')); |
| 329 unittest.expect(o[1], unittest.equals('foo')); |
| 330 } |
| 331 |
| 332 buildUnnamed3476() { |
| 333 var o = new core.List<core.String>(); |
| 334 o.add("foo"); |
| 335 o.add("foo"); |
| 336 return o; |
| 337 } |
| 338 |
| 339 checkUnnamed3476(core.List<core.String> o) { |
| 340 unittest.expect(o, unittest.hasLength(2)); |
| 341 unittest.expect(o[0], unittest.equals('foo')); |
| 342 unittest.expect(o[1], unittest.equals('foo')); |
| 343 } |
| 344 |
| 345 buildUnnamed3477() { |
| 346 var o = new core.List<core.int>(); |
| 347 o.add(42); |
| 348 o.add(42); |
| 349 return o; |
| 350 } |
| 351 |
| 352 checkUnnamed3477(core.List<core.int> o) { |
| 353 unittest.expect(o, unittest.hasLength(2)); |
| 354 unittest.expect(o[0], unittest.equals(42)); |
| 355 unittest.expect(o[1], unittest.equals(42)); |
| 356 } |
| 357 |
| 358 buildUnnamed3478() { |
| 359 var o = new core.List<core.int>(); |
| 360 o.add(42); |
| 361 o.add(42); |
| 362 return o; |
| 363 } |
| 364 |
| 365 checkUnnamed3478(core.List<core.int> o) { |
| 366 unittest.expect(o, unittest.hasLength(2)); |
| 367 unittest.expect(o[0], unittest.equals(42)); |
| 368 unittest.expect(o[1], unittest.equals(42)); |
| 369 } |
| 370 |
| 371 buildUnnamed3479() { |
| 372 var o = new core.List<core.String>(); |
| 373 o.add("foo"); |
| 374 o.add("foo"); |
| 375 return o; |
| 376 } |
| 377 |
| 378 checkUnnamed3479(core.List<core.String> o) { |
| 379 unittest.expect(o, unittest.hasLength(2)); |
| 380 unittest.expect(o[0], unittest.equals('foo')); |
| 381 unittest.expect(o[1], unittest.equals('foo')); |
| 382 } |
| 383 |
| 384 buildUnnamed3480() { |
| 385 var o = new core.List<core.String>(); |
| 386 o.add("foo"); |
| 387 o.add("foo"); |
| 388 return o; |
| 389 } |
| 390 |
| 391 checkUnnamed3480(core.List<core.String> o) { |
| 392 unittest.expect(o, unittest.hasLength(2)); |
| 393 unittest.expect(o[0], unittest.equals('foo')); |
| 394 unittest.expect(o[1], unittest.equals('foo')); |
| 395 } |
| 396 |
| 397 buildUnnamed3481() { |
| 398 var o = new core.List<api.ServingRestriction>(); |
| 399 o.add(buildServingRestriction()); |
| 400 o.add(buildServingRestriction()); |
| 401 return o; |
| 402 } |
| 403 |
| 404 checkUnnamed3481(core.List<api.ServingRestriction> o) { |
| 405 unittest.expect(o, unittest.hasLength(2)); |
| 406 checkServingRestriction(o[0]); |
| 407 checkServingRestriction(o[1]); |
| 408 } |
| 409 |
| 410 buildUnnamed3482() { |
| 411 var o = new core.List<core.int>(); |
| 412 o.add(42); |
| 413 o.add(42); |
| 414 return o; |
| 415 } |
| 416 |
| 417 checkUnnamed3482(core.List<core.int> o) { |
| 418 unittest.expect(o, unittest.hasLength(2)); |
| 419 unittest.expect(o[0], unittest.equals(42)); |
| 420 unittest.expect(o[1], unittest.equals(42)); |
| 421 } |
| 422 |
| 423 core.int buildCounterCreative = 0; |
| 424 buildCreative() { |
| 425 var o = new api.Creative(); |
| 426 buildCounterCreative++; |
| 427 if (buildCounterCreative < 3) { |
| 428 o.accountId = "foo"; |
| 429 o.adChoicesDestinationUrl = "foo"; |
| 430 o.advertiserName = "foo"; |
| 431 o.agencyId = "foo"; |
| 432 o.apiUpdateTime = "foo"; |
| 433 o.attributes = buildUnnamed3471(); |
| 434 o.clickThroughUrls = buildUnnamed3472(); |
| 435 o.corrections = buildUnnamed3473(); |
| 436 o.creativeId = "foo"; |
| 437 o.dealsStatus = "foo"; |
| 438 o.detectedAdvertiserIds = buildUnnamed3474(); |
| 439 o.detectedDomains = buildUnnamed3475(); |
| 440 o.detectedLanguages = buildUnnamed3476(); |
| 441 o.detectedProductCategories = buildUnnamed3477(); |
| 442 o.detectedSensitiveCategories = buildUnnamed3478(); |
| 443 o.filteringStats = buildFilteringStats(); |
| 444 o.html = buildHtmlContent(); |
| 445 o.impressionTrackingUrls = buildUnnamed3479(); |
| 446 o.native = buildNativeContent(); |
| 447 o.openAuctionStatus = "foo"; |
| 448 o.restrictedCategories = buildUnnamed3480(); |
| 449 o.servingRestrictions = buildUnnamed3481(); |
| 450 o.vendorIds = buildUnnamed3482(); |
| 451 o.version = 42; |
| 452 o.video = buildVideoContent(); |
| 453 } |
| 454 buildCounterCreative--; |
| 455 return o; |
| 456 } |
| 457 |
| 458 checkCreative(api.Creative o) { |
| 459 buildCounterCreative++; |
| 460 if (buildCounterCreative < 3) { |
| 461 unittest.expect(o.accountId, unittest.equals('foo')); |
| 462 unittest.expect(o.adChoicesDestinationUrl, unittest.equals('foo')); |
| 463 unittest.expect(o.advertiserName, unittest.equals('foo')); |
| 464 unittest.expect(o.agencyId, unittest.equals('foo')); |
| 465 unittest.expect(o.apiUpdateTime, unittest.equals('foo')); |
| 466 checkUnnamed3471(o.attributes); |
| 467 checkUnnamed3472(o.clickThroughUrls); |
| 468 checkUnnamed3473(o.corrections); |
| 469 unittest.expect(o.creativeId, unittest.equals('foo')); |
| 470 unittest.expect(o.dealsStatus, unittest.equals('foo')); |
| 471 checkUnnamed3474(o.detectedAdvertiserIds); |
| 472 checkUnnamed3475(o.detectedDomains); |
| 473 checkUnnamed3476(o.detectedLanguages); |
| 474 checkUnnamed3477(o.detectedProductCategories); |
| 475 checkUnnamed3478(o.detectedSensitiveCategories); |
| 476 checkFilteringStats(o.filteringStats); |
| 477 checkHtmlContent(o.html); |
| 478 checkUnnamed3479(o.impressionTrackingUrls); |
| 479 checkNativeContent(o.native); |
| 480 unittest.expect(o.openAuctionStatus, unittest.equals('foo')); |
| 481 checkUnnamed3480(o.restrictedCategories); |
| 482 checkUnnamed3481(o.servingRestrictions); |
| 483 checkUnnamed3482(o.vendorIds); |
| 484 unittest.expect(o.version, unittest.equals(42)); |
| 485 checkVideoContent(o.video); |
| 486 } |
| 487 buildCounterCreative--; |
| 488 } |
| 489 |
| 490 core.int buildCounterCreativeDealAssociation = 0; |
| 491 buildCreativeDealAssociation() { |
| 492 var o = new api.CreativeDealAssociation(); |
| 493 buildCounterCreativeDealAssociation++; |
| 494 if (buildCounterCreativeDealAssociation < 3) { |
| 495 o.accountId = "foo"; |
| 496 o.creativeId = "foo"; |
| 497 o.dealsId = "foo"; |
| 498 } |
| 499 buildCounterCreativeDealAssociation--; |
| 500 return o; |
| 501 } |
| 502 |
| 503 checkCreativeDealAssociation(api.CreativeDealAssociation o) { |
| 504 buildCounterCreativeDealAssociation++; |
| 505 if (buildCounterCreativeDealAssociation < 3) { |
| 506 unittest.expect(o.accountId, unittest.equals('foo')); |
| 507 unittest.expect(o.creativeId, unittest.equals('foo')); |
| 508 unittest.expect(o.dealsId, unittest.equals('foo')); |
| 509 } |
| 510 buildCounterCreativeDealAssociation--; |
| 511 } |
| 512 |
| 513 core.int buildCounterDate = 0; |
| 514 buildDate() { |
| 515 var o = new api.Date(); |
| 516 buildCounterDate++; |
| 517 if (buildCounterDate < 3) { |
| 518 o.day = 42; |
| 519 o.month = 42; |
| 520 o.year = 42; |
| 521 } |
| 522 buildCounterDate--; |
| 523 return o; |
| 524 } |
| 525 |
| 526 checkDate(api.Date o) { |
| 527 buildCounterDate++; |
| 528 if (buildCounterDate < 3) { |
| 529 unittest.expect(o.day, unittest.equals(42)); |
| 530 unittest.expect(o.month, unittest.equals(42)); |
| 531 unittest.expect(o.year, unittest.equals(42)); |
| 532 } |
| 533 buildCounterDate--; |
| 534 } |
| 535 |
| 536 buildUnnamed3483() { |
| 537 var o = new core.List<core.String>(); |
| 538 o.add("foo"); |
| 539 o.add("foo"); |
| 540 return o; |
| 541 } |
| 542 |
| 543 checkUnnamed3483(core.List<core.String> o) { |
| 544 unittest.expect(o, unittest.hasLength(2)); |
| 545 unittest.expect(o[0], unittest.equals('foo')); |
| 546 unittest.expect(o[1], unittest.equals('foo')); |
| 547 } |
| 548 |
| 549 core.int buildCounterDisapproval = 0; |
| 550 buildDisapproval() { |
| 551 var o = new api.Disapproval(); |
| 552 buildCounterDisapproval++; |
| 553 if (buildCounterDisapproval < 3) { |
| 554 o.details = buildUnnamed3483(); |
| 555 o.reason = "foo"; |
| 556 } |
| 557 buildCounterDisapproval--; |
| 558 return o; |
| 559 } |
| 560 |
| 561 checkDisapproval(api.Disapproval o) { |
| 562 buildCounterDisapproval++; |
| 563 if (buildCounterDisapproval < 3) { |
| 564 checkUnnamed3483(o.details); |
| 565 unittest.expect(o.reason, unittest.equals('foo')); |
| 566 } |
| 567 buildCounterDisapproval--; |
| 568 } |
| 569 |
| 570 core.int buildCounterEmpty = 0; |
| 571 buildEmpty() { |
| 572 var o = new api.Empty(); |
| 573 buildCounterEmpty++; |
| 574 if (buildCounterEmpty < 3) { |
| 575 } |
| 576 buildCounterEmpty--; |
| 577 return o; |
| 578 } |
| 579 |
| 580 checkEmpty(api.Empty o) { |
| 581 buildCounterEmpty++; |
| 582 if (buildCounterEmpty < 3) { |
| 583 } |
| 584 buildCounterEmpty--; |
| 585 } |
| 586 |
| 587 buildUnnamed3484() { |
| 588 var o = new core.List<api.Reason>(); |
| 589 o.add(buildReason()); |
| 590 o.add(buildReason()); |
| 591 return o; |
| 592 } |
| 593 |
| 594 checkUnnamed3484(core.List<api.Reason> o) { |
| 595 unittest.expect(o, unittest.hasLength(2)); |
| 596 checkReason(o[0]); |
| 597 checkReason(o[1]); |
| 598 } |
| 599 |
| 600 core.int buildCounterFilteringStats = 0; |
| 601 buildFilteringStats() { |
| 602 var o = new api.FilteringStats(); |
| 603 buildCounterFilteringStats++; |
| 604 if (buildCounterFilteringStats < 3) { |
| 605 o.date = buildDate(); |
| 606 o.reasons = buildUnnamed3484(); |
| 607 } |
| 608 buildCounterFilteringStats--; |
| 609 return o; |
| 610 } |
| 611 |
| 612 checkFilteringStats(api.FilteringStats o) { |
| 613 buildCounterFilteringStats++; |
| 614 if (buildCounterFilteringStats < 3) { |
| 615 checkDate(o.date); |
| 616 checkUnnamed3484(o.reasons); |
| 617 } |
| 618 buildCounterFilteringStats--; |
| 619 } |
| 620 |
| 621 core.int buildCounterHtmlContent = 0; |
| 622 buildHtmlContent() { |
| 623 var o = new api.HtmlContent(); |
| 624 buildCounterHtmlContent++; |
| 625 if (buildCounterHtmlContent < 3) { |
| 626 o.height = 42; |
| 627 o.snippet = "foo"; |
| 628 o.width = 42; |
| 629 } |
| 630 buildCounterHtmlContent--; |
| 631 return o; |
| 632 } |
| 633 |
| 634 checkHtmlContent(api.HtmlContent o) { |
| 635 buildCounterHtmlContent++; |
| 636 if (buildCounterHtmlContent < 3) { |
| 637 unittest.expect(o.height, unittest.equals(42)); |
| 638 unittest.expect(o.snippet, unittest.equals('foo')); |
| 639 unittest.expect(o.width, unittest.equals(42)); |
| 640 } |
| 641 buildCounterHtmlContent--; |
| 642 } |
| 643 |
| 644 core.int buildCounterImage = 0; |
| 645 buildImage() { |
| 646 var o = new api.Image(); |
| 647 buildCounterImage++; |
| 648 if (buildCounterImage < 3) { |
| 649 o.height = 42; |
| 650 o.url = "foo"; |
| 651 o.width = 42; |
| 652 } |
| 653 buildCounterImage--; |
| 654 return o; |
| 655 } |
| 656 |
| 657 checkImage(api.Image o) { |
| 658 buildCounterImage++; |
| 659 if (buildCounterImage < 3) { |
| 660 unittest.expect(o.height, unittest.equals(42)); |
| 661 unittest.expect(o.url, unittest.equals('foo')); |
| 662 unittest.expect(o.width, unittest.equals(42)); |
| 663 } |
| 664 buildCounterImage--; |
| 665 } |
| 666 |
| 667 buildUnnamed3485() { |
| 136 var o = new core.List<api.ClientUserInvitation>(); | 668 var o = new core.List<api.ClientUserInvitation>(); |
| 137 o.add(buildClientUserInvitation()); | 669 o.add(buildClientUserInvitation()); |
| 138 o.add(buildClientUserInvitation()); | 670 o.add(buildClientUserInvitation()); |
| 139 return o; | 671 return o; |
| 140 } | 672 } |
| 141 | 673 |
| 142 checkUnnamed3885(core.List<api.ClientUserInvitation> o) { | 674 checkUnnamed3485(core.List<api.ClientUserInvitation> o) { |
| 143 unittest.expect(o, unittest.hasLength(2)); | 675 unittest.expect(o, unittest.hasLength(2)); |
| 144 checkClientUserInvitation(o[0]); | 676 checkClientUserInvitation(o[0]); |
| 145 checkClientUserInvitation(o[1]); | 677 checkClientUserInvitation(o[1]); |
| 146 } | 678 } |
| 147 | 679 |
| 148 core.int buildCounterListClientUserInvitationsResponse = 0; | 680 core.int buildCounterListClientUserInvitationsResponse = 0; |
| 149 buildListClientUserInvitationsResponse() { | 681 buildListClientUserInvitationsResponse() { |
| 150 var o = new api.ListClientUserInvitationsResponse(); | 682 var o = new api.ListClientUserInvitationsResponse(); |
| 151 buildCounterListClientUserInvitationsResponse++; | 683 buildCounterListClientUserInvitationsResponse++; |
| 152 if (buildCounterListClientUserInvitationsResponse < 3) { | 684 if (buildCounterListClientUserInvitationsResponse < 3) { |
| 153 o.invitations = buildUnnamed3885(); | 685 o.invitations = buildUnnamed3485(); |
| 154 o.nextPageToken = "foo"; | 686 o.nextPageToken = "foo"; |
| 155 } | 687 } |
| 156 buildCounterListClientUserInvitationsResponse--; | 688 buildCounterListClientUserInvitationsResponse--; |
| 157 return o; | 689 return o; |
| 158 } | 690 } |
| 159 | 691 |
| 160 checkListClientUserInvitationsResponse(api.ListClientUserInvitationsResponse o)
{ | 692 checkListClientUserInvitationsResponse(api.ListClientUserInvitationsResponse o)
{ |
| 161 buildCounterListClientUserInvitationsResponse++; | 693 buildCounterListClientUserInvitationsResponse++; |
| 162 if (buildCounterListClientUserInvitationsResponse < 3) { | 694 if (buildCounterListClientUserInvitationsResponse < 3) { |
| 163 checkUnnamed3885(o.invitations); | 695 checkUnnamed3485(o.invitations); |
| 164 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 696 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 165 } | 697 } |
| 166 buildCounterListClientUserInvitationsResponse--; | 698 buildCounterListClientUserInvitationsResponse--; |
| 167 } | 699 } |
| 168 | 700 |
| 169 buildUnnamed3886() { | 701 buildUnnamed3486() { |
| 170 var o = new core.List<api.ClientUser>(); | 702 var o = new core.List<api.ClientUser>(); |
| 171 o.add(buildClientUser()); | 703 o.add(buildClientUser()); |
| 172 o.add(buildClientUser()); | 704 o.add(buildClientUser()); |
| 173 return o; | 705 return o; |
| 174 } | 706 } |
| 175 | 707 |
| 176 checkUnnamed3886(core.List<api.ClientUser> o) { | 708 checkUnnamed3486(core.List<api.ClientUser> o) { |
| 177 unittest.expect(o, unittest.hasLength(2)); | 709 unittest.expect(o, unittest.hasLength(2)); |
| 178 checkClientUser(o[0]); | 710 checkClientUser(o[0]); |
| 179 checkClientUser(o[1]); | 711 checkClientUser(o[1]); |
| 180 } | 712 } |
| 181 | 713 |
| 182 core.int buildCounterListClientUsersResponse = 0; | 714 core.int buildCounterListClientUsersResponse = 0; |
| 183 buildListClientUsersResponse() { | 715 buildListClientUsersResponse() { |
| 184 var o = new api.ListClientUsersResponse(); | 716 var o = new api.ListClientUsersResponse(); |
| 185 buildCounterListClientUsersResponse++; | 717 buildCounterListClientUsersResponse++; |
| 186 if (buildCounterListClientUsersResponse < 3) { | 718 if (buildCounterListClientUsersResponse < 3) { |
| 187 o.nextPageToken = "foo"; | 719 o.nextPageToken = "foo"; |
| 188 o.users = buildUnnamed3886(); | 720 o.users = buildUnnamed3486(); |
| 189 } | 721 } |
| 190 buildCounterListClientUsersResponse--; | 722 buildCounterListClientUsersResponse--; |
| 191 return o; | 723 return o; |
| 192 } | 724 } |
| 193 | 725 |
| 194 checkListClientUsersResponse(api.ListClientUsersResponse o) { | 726 checkListClientUsersResponse(api.ListClientUsersResponse o) { |
| 195 buildCounterListClientUsersResponse++; | 727 buildCounterListClientUsersResponse++; |
| 196 if (buildCounterListClientUsersResponse < 3) { | 728 if (buildCounterListClientUsersResponse < 3) { |
| 197 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 729 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 198 checkUnnamed3886(o.users); | 730 checkUnnamed3486(o.users); |
| 199 } | 731 } |
| 200 buildCounterListClientUsersResponse--; | 732 buildCounterListClientUsersResponse--; |
| 201 } | 733 } |
| 202 | 734 |
| 203 buildUnnamed3887() { | 735 buildUnnamed3487() { |
| 204 var o = new core.List<api.Client>(); | 736 var o = new core.List<api.Client>(); |
| 205 o.add(buildClient()); | 737 o.add(buildClient()); |
| 206 o.add(buildClient()); | 738 o.add(buildClient()); |
| 207 return o; | 739 return o; |
| 208 } | 740 } |
| 209 | 741 |
| 210 checkUnnamed3887(core.List<api.Client> o) { | 742 checkUnnamed3487(core.List<api.Client> o) { |
| 211 unittest.expect(o, unittest.hasLength(2)); | 743 unittest.expect(o, unittest.hasLength(2)); |
| 212 checkClient(o[0]); | 744 checkClient(o[0]); |
| 213 checkClient(o[1]); | 745 checkClient(o[1]); |
| 214 } | 746 } |
| 215 | 747 |
| 216 core.int buildCounterListClientsResponse = 0; | 748 core.int buildCounterListClientsResponse = 0; |
| 217 buildListClientsResponse() { | 749 buildListClientsResponse() { |
| 218 var o = new api.ListClientsResponse(); | 750 var o = new api.ListClientsResponse(); |
| 219 buildCounterListClientsResponse++; | 751 buildCounterListClientsResponse++; |
| 220 if (buildCounterListClientsResponse < 3) { | 752 if (buildCounterListClientsResponse < 3) { |
| 221 o.clients = buildUnnamed3887(); | 753 o.clients = buildUnnamed3487(); |
| 222 o.nextPageToken = "foo"; | 754 o.nextPageToken = "foo"; |
| 223 } | 755 } |
| 224 buildCounterListClientsResponse--; | 756 buildCounterListClientsResponse--; |
| 225 return o; | 757 return o; |
| 226 } | 758 } |
| 227 | 759 |
| 228 checkListClientsResponse(api.ListClientsResponse o) { | 760 checkListClientsResponse(api.ListClientsResponse o) { |
| 229 buildCounterListClientsResponse++; | 761 buildCounterListClientsResponse++; |
| 230 if (buildCounterListClientsResponse < 3) { | 762 if (buildCounterListClientsResponse < 3) { |
| 231 checkUnnamed3887(o.clients); | 763 checkUnnamed3487(o.clients); |
| 232 unittest.expect(o.nextPageToken, unittest.equals('foo')); | 764 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 233 } | 765 } |
| 234 buildCounterListClientsResponse--; | 766 buildCounterListClientsResponse--; |
| 235 } | 767 } |
| 236 | 768 |
| 769 buildUnnamed3488() { |
| 770 var o = new core.List<api.Creative>(); |
| 771 o.add(buildCreative()); |
| 772 o.add(buildCreative()); |
| 773 return o; |
| 774 } |
| 775 |
| 776 checkUnnamed3488(core.List<api.Creative> o) { |
| 777 unittest.expect(o, unittest.hasLength(2)); |
| 778 checkCreative(o[0]); |
| 779 checkCreative(o[1]); |
| 780 } |
| 781 |
| 782 core.int buildCounterListCreativesResponse = 0; |
| 783 buildListCreativesResponse() { |
| 784 var o = new api.ListCreativesResponse(); |
| 785 buildCounterListCreativesResponse++; |
| 786 if (buildCounterListCreativesResponse < 3) { |
| 787 o.creatives = buildUnnamed3488(); |
| 788 o.nextPageToken = "foo"; |
| 789 } |
| 790 buildCounterListCreativesResponse--; |
| 791 return o; |
| 792 } |
| 793 |
| 794 checkListCreativesResponse(api.ListCreativesResponse o) { |
| 795 buildCounterListCreativesResponse++; |
| 796 if (buildCounterListCreativesResponse < 3) { |
| 797 checkUnnamed3488(o.creatives); |
| 798 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 799 } |
| 800 buildCounterListCreativesResponse--; |
| 801 } |
| 802 |
| 803 buildUnnamed3489() { |
| 804 var o = new core.List<api.CreativeDealAssociation>(); |
| 805 o.add(buildCreativeDealAssociation()); |
| 806 o.add(buildCreativeDealAssociation()); |
| 807 return o; |
| 808 } |
| 809 |
| 810 checkUnnamed3489(core.List<api.CreativeDealAssociation> o) { |
| 811 unittest.expect(o, unittest.hasLength(2)); |
| 812 checkCreativeDealAssociation(o[0]); |
| 813 checkCreativeDealAssociation(o[1]); |
| 814 } |
| 815 |
| 816 core.int buildCounterListDealAssociationsResponse = 0; |
| 817 buildListDealAssociationsResponse() { |
| 818 var o = new api.ListDealAssociationsResponse(); |
| 819 buildCounterListDealAssociationsResponse++; |
| 820 if (buildCounterListDealAssociationsResponse < 3) { |
| 821 o.associations = buildUnnamed3489(); |
| 822 o.nextPageToken = "foo"; |
| 823 } |
| 824 buildCounterListDealAssociationsResponse--; |
| 825 return o; |
| 826 } |
| 827 |
| 828 checkListDealAssociationsResponse(api.ListDealAssociationsResponse o) { |
| 829 buildCounterListDealAssociationsResponse++; |
| 830 if (buildCounterListDealAssociationsResponse < 3) { |
| 831 checkUnnamed3489(o.associations); |
| 832 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 833 } |
| 834 buildCounterListDealAssociationsResponse--; |
| 835 } |
| 836 |
| 837 buildUnnamed3490() { |
| 838 var o = new core.List<core.int>(); |
| 839 o.add(42); |
| 840 o.add(42); |
| 841 return o; |
| 842 } |
| 843 |
| 844 checkUnnamed3490(core.List<core.int> o) { |
| 845 unittest.expect(o, unittest.hasLength(2)); |
| 846 unittest.expect(o[0], unittest.equals(42)); |
| 847 unittest.expect(o[1], unittest.equals(42)); |
| 848 } |
| 849 |
| 850 core.int buildCounterLocationContext = 0; |
| 851 buildLocationContext() { |
| 852 var o = new api.LocationContext(); |
| 853 buildCounterLocationContext++; |
| 854 if (buildCounterLocationContext < 3) { |
| 855 o.geoCriteriaIds = buildUnnamed3490(); |
| 856 } |
| 857 buildCounterLocationContext--; |
| 858 return o; |
| 859 } |
| 860 |
| 861 checkLocationContext(api.LocationContext o) { |
| 862 buildCounterLocationContext++; |
| 863 if (buildCounterLocationContext < 3) { |
| 864 checkUnnamed3490(o.geoCriteriaIds); |
| 865 } |
| 866 buildCounterLocationContext--; |
| 867 } |
| 868 |
| 869 core.int buildCounterNativeContent = 0; |
| 870 buildNativeContent() { |
| 871 var o = new api.NativeContent(); |
| 872 buildCounterNativeContent++; |
| 873 if (buildCounterNativeContent < 3) { |
| 874 o.advertiserName = "foo"; |
| 875 o.appIcon = buildImage(); |
| 876 o.body = "foo"; |
| 877 o.callToAction = "foo"; |
| 878 o.clickLinkUrl = "foo"; |
| 879 o.clickTrackingUrl = "foo"; |
| 880 o.headline = "foo"; |
| 881 o.image = buildImage(); |
| 882 o.logo = buildImage(); |
| 883 o.priceDisplayText = "foo"; |
| 884 o.starRating = 42.0; |
| 885 o.storeUrl = "foo"; |
| 886 o.videoUrl = "foo"; |
| 887 } |
| 888 buildCounterNativeContent--; |
| 889 return o; |
| 890 } |
| 891 |
| 892 checkNativeContent(api.NativeContent o) { |
| 893 buildCounterNativeContent++; |
| 894 if (buildCounterNativeContent < 3) { |
| 895 unittest.expect(o.advertiserName, unittest.equals('foo')); |
| 896 checkImage(o.appIcon); |
| 897 unittest.expect(o.body, unittest.equals('foo')); |
| 898 unittest.expect(o.callToAction, unittest.equals('foo')); |
| 899 unittest.expect(o.clickLinkUrl, unittest.equals('foo')); |
| 900 unittest.expect(o.clickTrackingUrl, unittest.equals('foo')); |
| 901 unittest.expect(o.headline, unittest.equals('foo')); |
| 902 checkImage(o.image); |
| 903 checkImage(o.logo); |
| 904 unittest.expect(o.priceDisplayText, unittest.equals('foo')); |
| 905 unittest.expect(o.starRating, unittest.equals(42.0)); |
| 906 unittest.expect(o.storeUrl, unittest.equals('foo')); |
| 907 unittest.expect(o.videoUrl, unittest.equals('foo')); |
| 908 } |
| 909 buildCounterNativeContent--; |
| 910 } |
| 911 |
| 912 buildUnnamed3491() { |
| 913 var o = new core.List<core.String>(); |
| 914 o.add("foo"); |
| 915 o.add("foo"); |
| 916 return o; |
| 917 } |
| 918 |
| 919 checkUnnamed3491(core.List<core.String> o) { |
| 920 unittest.expect(o, unittest.hasLength(2)); |
| 921 unittest.expect(o[0], unittest.equals('foo')); |
| 922 unittest.expect(o[1], unittest.equals('foo')); |
| 923 } |
| 924 |
| 925 core.int buildCounterPlatformContext = 0; |
| 926 buildPlatformContext() { |
| 927 var o = new api.PlatformContext(); |
| 928 buildCounterPlatformContext++; |
| 929 if (buildCounterPlatformContext < 3) { |
| 930 o.platforms = buildUnnamed3491(); |
| 931 } |
| 932 buildCounterPlatformContext--; |
| 933 return o; |
| 934 } |
| 935 |
| 936 checkPlatformContext(api.PlatformContext o) { |
| 937 buildCounterPlatformContext++; |
| 938 if (buildCounterPlatformContext < 3) { |
| 939 checkUnnamed3491(o.platforms); |
| 940 } |
| 941 buildCounterPlatformContext--; |
| 942 } |
| 943 |
| 944 core.int buildCounterReason = 0; |
| 945 buildReason() { |
| 946 var o = new api.Reason(); |
| 947 buildCounterReason++; |
| 948 if (buildCounterReason < 3) { |
| 949 o.count = "foo"; |
| 950 o.status = 42; |
| 951 } |
| 952 buildCounterReason--; |
| 953 return o; |
| 954 } |
| 955 |
| 956 checkReason(api.Reason o) { |
| 957 buildCounterReason++; |
| 958 if (buildCounterReason < 3) { |
| 959 unittest.expect(o.count, unittest.equals('foo')); |
| 960 unittest.expect(o.status, unittest.equals(42)); |
| 961 } |
| 962 buildCounterReason--; |
| 963 } |
| 964 |
| 965 core.int buildCounterRemoveDealAssociationRequest = 0; |
| 966 buildRemoveDealAssociationRequest() { |
| 967 var o = new api.RemoveDealAssociationRequest(); |
| 968 buildCounterRemoveDealAssociationRequest++; |
| 969 if (buildCounterRemoveDealAssociationRequest < 3) { |
| 970 o.association = buildCreativeDealAssociation(); |
| 971 } |
| 972 buildCounterRemoveDealAssociationRequest--; |
| 973 return o; |
| 974 } |
| 975 |
| 976 checkRemoveDealAssociationRequest(api.RemoveDealAssociationRequest o) { |
| 977 buildCounterRemoveDealAssociationRequest++; |
| 978 if (buildCounterRemoveDealAssociationRequest < 3) { |
| 979 checkCreativeDealAssociation(o.association); |
| 980 } |
| 981 buildCounterRemoveDealAssociationRequest--; |
| 982 } |
| 983 |
| 984 buildUnnamed3492() { |
| 985 var o = new core.List<core.String>(); |
| 986 o.add("foo"); |
| 987 o.add("foo"); |
| 988 return o; |
| 989 } |
| 990 |
| 991 checkUnnamed3492(core.List<core.String> o) { |
| 992 unittest.expect(o, unittest.hasLength(2)); |
| 993 unittest.expect(o[0], unittest.equals('foo')); |
| 994 unittest.expect(o[1], unittest.equals('foo')); |
| 995 } |
| 996 |
| 997 core.int buildCounterSecurityContext = 0; |
| 998 buildSecurityContext() { |
| 999 var o = new api.SecurityContext(); |
| 1000 buildCounterSecurityContext++; |
| 1001 if (buildCounterSecurityContext < 3) { |
| 1002 o.securities = buildUnnamed3492(); |
| 1003 } |
| 1004 buildCounterSecurityContext--; |
| 1005 return o; |
| 1006 } |
| 1007 |
| 1008 checkSecurityContext(api.SecurityContext o) { |
| 1009 buildCounterSecurityContext++; |
| 1010 if (buildCounterSecurityContext < 3) { |
| 1011 checkUnnamed3492(o.securities); |
| 1012 } |
| 1013 buildCounterSecurityContext--; |
| 1014 } |
| 1015 |
| 1016 core.int buildCounterServingContext = 0; |
| 1017 buildServingContext() { |
| 1018 var o = new api.ServingContext(); |
| 1019 buildCounterServingContext++; |
| 1020 if (buildCounterServingContext < 3) { |
| 1021 o.all = "foo"; |
| 1022 o.appType = buildAppContext(); |
| 1023 o.auctionType = buildAuctionContext(); |
| 1024 o.location = buildLocationContext(); |
| 1025 o.platform = buildPlatformContext(); |
| 1026 o.securityType = buildSecurityContext(); |
| 1027 } |
| 1028 buildCounterServingContext--; |
| 1029 return o; |
| 1030 } |
| 1031 |
| 1032 checkServingContext(api.ServingContext o) { |
| 1033 buildCounterServingContext++; |
| 1034 if (buildCounterServingContext < 3) { |
| 1035 unittest.expect(o.all, unittest.equals('foo')); |
| 1036 checkAppContext(o.appType); |
| 1037 checkAuctionContext(o.auctionType); |
| 1038 checkLocationContext(o.location); |
| 1039 checkPlatformContext(o.platform); |
| 1040 checkSecurityContext(o.securityType); |
| 1041 } |
| 1042 buildCounterServingContext--; |
| 1043 } |
| 1044 |
| 1045 buildUnnamed3493() { |
| 1046 var o = new core.List<api.ServingContext>(); |
| 1047 o.add(buildServingContext()); |
| 1048 o.add(buildServingContext()); |
| 1049 return o; |
| 1050 } |
| 1051 |
| 1052 checkUnnamed3493(core.List<api.ServingContext> o) { |
| 1053 unittest.expect(o, unittest.hasLength(2)); |
| 1054 checkServingContext(o[0]); |
| 1055 checkServingContext(o[1]); |
| 1056 } |
| 1057 |
| 1058 buildUnnamed3494() { |
| 1059 var o = new core.List<api.Disapproval>(); |
| 1060 o.add(buildDisapproval()); |
| 1061 o.add(buildDisapproval()); |
| 1062 return o; |
| 1063 } |
| 1064 |
| 1065 checkUnnamed3494(core.List<api.Disapproval> o) { |
| 1066 unittest.expect(o, unittest.hasLength(2)); |
| 1067 checkDisapproval(o[0]); |
| 1068 checkDisapproval(o[1]); |
| 1069 } |
| 1070 |
| 1071 core.int buildCounterServingRestriction = 0; |
| 1072 buildServingRestriction() { |
| 1073 var o = new api.ServingRestriction(); |
| 1074 buildCounterServingRestriction++; |
| 1075 if (buildCounterServingRestriction < 3) { |
| 1076 o.contexts = buildUnnamed3493(); |
| 1077 o.disapprovalReasons = buildUnnamed3494(); |
| 1078 o.status = "foo"; |
| 1079 } |
| 1080 buildCounterServingRestriction--; |
| 1081 return o; |
| 1082 } |
| 1083 |
| 1084 checkServingRestriction(api.ServingRestriction o) { |
| 1085 buildCounterServingRestriction++; |
| 1086 if (buildCounterServingRestriction < 3) { |
| 1087 checkUnnamed3493(o.contexts); |
| 1088 checkUnnamed3494(o.disapprovalReasons); |
| 1089 unittest.expect(o.status, unittest.equals('foo')); |
| 1090 } |
| 1091 buildCounterServingRestriction--; |
| 1092 } |
| 1093 |
| 1094 core.int buildCounterStopWatchingCreativeRequest = 0; |
| 1095 buildStopWatchingCreativeRequest() { |
| 1096 var o = new api.StopWatchingCreativeRequest(); |
| 1097 buildCounterStopWatchingCreativeRequest++; |
| 1098 if (buildCounterStopWatchingCreativeRequest < 3) { |
| 1099 } |
| 1100 buildCounterStopWatchingCreativeRequest--; |
| 1101 return o; |
| 1102 } |
| 1103 |
| 1104 checkStopWatchingCreativeRequest(api.StopWatchingCreativeRequest o) { |
| 1105 buildCounterStopWatchingCreativeRequest++; |
| 1106 if (buildCounterStopWatchingCreativeRequest < 3) { |
| 1107 } |
| 1108 buildCounterStopWatchingCreativeRequest--; |
| 1109 } |
| 1110 |
| 1111 core.int buildCounterVideoContent = 0; |
| 1112 buildVideoContent() { |
| 1113 var o = new api.VideoContent(); |
| 1114 buildCounterVideoContent++; |
| 1115 if (buildCounterVideoContent < 3) { |
| 1116 o.videoUrl = "foo"; |
| 1117 } |
| 1118 buildCounterVideoContent--; |
| 1119 return o; |
| 1120 } |
| 1121 |
| 1122 checkVideoContent(api.VideoContent o) { |
| 1123 buildCounterVideoContent++; |
| 1124 if (buildCounterVideoContent < 3) { |
| 1125 unittest.expect(o.videoUrl, unittest.equals('foo')); |
| 1126 } |
| 1127 buildCounterVideoContent--; |
| 1128 } |
| 1129 |
| 1130 core.int buildCounterWatchCreativeRequest = 0; |
| 1131 buildWatchCreativeRequest() { |
| 1132 var o = new api.WatchCreativeRequest(); |
| 1133 buildCounterWatchCreativeRequest++; |
| 1134 if (buildCounterWatchCreativeRequest < 3) { |
| 1135 o.topic = "foo"; |
| 1136 } |
| 1137 buildCounterWatchCreativeRequest--; |
| 1138 return o; |
| 1139 } |
| 1140 |
| 1141 checkWatchCreativeRequest(api.WatchCreativeRequest o) { |
| 1142 buildCounterWatchCreativeRequest++; |
| 1143 if (buildCounterWatchCreativeRequest < 3) { |
| 1144 unittest.expect(o.topic, unittest.equals('foo')); |
| 1145 } |
| 1146 buildCounterWatchCreativeRequest--; |
| 1147 } |
| 1148 |
| 237 | 1149 |
| 238 main() { | 1150 main() { |
| 1151 unittest.group("obj-schema-AddDealAssociationRequest", () { |
| 1152 unittest.test("to-json--from-json", () { |
| 1153 var o = buildAddDealAssociationRequest(); |
| 1154 var od = new api.AddDealAssociationRequest.fromJson(o.toJson()); |
| 1155 checkAddDealAssociationRequest(od); |
| 1156 }); |
| 1157 }); |
| 1158 |
| 1159 |
| 1160 unittest.group("obj-schema-AppContext", () { |
| 1161 unittest.test("to-json--from-json", () { |
| 1162 var o = buildAppContext(); |
| 1163 var od = new api.AppContext.fromJson(o.toJson()); |
| 1164 checkAppContext(od); |
| 1165 }); |
| 1166 }); |
| 1167 |
| 1168 |
| 1169 unittest.group("obj-schema-AuctionContext", () { |
| 1170 unittest.test("to-json--from-json", () { |
| 1171 var o = buildAuctionContext(); |
| 1172 var od = new api.AuctionContext.fromJson(o.toJson()); |
| 1173 checkAuctionContext(od); |
| 1174 }); |
| 1175 }); |
| 1176 |
| 1177 |
| 239 unittest.group("obj-schema-Client", () { | 1178 unittest.group("obj-schema-Client", () { |
| 240 unittest.test("to-json--from-json", () { | 1179 unittest.test("to-json--from-json", () { |
| 241 var o = buildClient(); | 1180 var o = buildClient(); |
| 242 var od = new api.Client.fromJson(o.toJson()); | 1181 var od = new api.Client.fromJson(o.toJson()); |
| 243 checkClient(od); | 1182 checkClient(od); |
| 244 }); | 1183 }); |
| 245 }); | 1184 }); |
| 246 | 1185 |
| 247 | 1186 |
| 248 unittest.group("obj-schema-ClientUser", () { | 1187 unittest.group("obj-schema-ClientUser", () { |
| 249 unittest.test("to-json--from-json", () { | 1188 unittest.test("to-json--from-json", () { |
| 250 var o = buildClientUser(); | 1189 var o = buildClientUser(); |
| 251 var od = new api.ClientUser.fromJson(o.toJson()); | 1190 var od = new api.ClientUser.fromJson(o.toJson()); |
| 252 checkClientUser(od); | 1191 checkClientUser(od); |
| 253 }); | 1192 }); |
| 254 }); | 1193 }); |
| 255 | 1194 |
| 256 | 1195 |
| 257 unittest.group("obj-schema-ClientUserInvitation", () { | 1196 unittest.group("obj-schema-ClientUserInvitation", () { |
| 258 unittest.test("to-json--from-json", () { | 1197 unittest.test("to-json--from-json", () { |
| 259 var o = buildClientUserInvitation(); | 1198 var o = buildClientUserInvitation(); |
| 260 var od = new api.ClientUserInvitation.fromJson(o.toJson()); | 1199 var od = new api.ClientUserInvitation.fromJson(o.toJson()); |
| 261 checkClientUserInvitation(od); | 1200 checkClientUserInvitation(od); |
| 262 }); | 1201 }); |
| 263 }); | 1202 }); |
| 264 | 1203 |
| 265 | 1204 |
| 1205 unittest.group("obj-schema-Correction", () { |
| 1206 unittest.test("to-json--from-json", () { |
| 1207 var o = buildCorrection(); |
| 1208 var od = new api.Correction.fromJson(o.toJson()); |
| 1209 checkCorrection(od); |
| 1210 }); |
| 1211 }); |
| 1212 |
| 1213 |
| 1214 unittest.group("obj-schema-Creative", () { |
| 1215 unittest.test("to-json--from-json", () { |
| 1216 var o = buildCreative(); |
| 1217 var od = new api.Creative.fromJson(o.toJson()); |
| 1218 checkCreative(od); |
| 1219 }); |
| 1220 }); |
| 1221 |
| 1222 |
| 1223 unittest.group("obj-schema-CreativeDealAssociation", () { |
| 1224 unittest.test("to-json--from-json", () { |
| 1225 var o = buildCreativeDealAssociation(); |
| 1226 var od = new api.CreativeDealAssociation.fromJson(o.toJson()); |
| 1227 checkCreativeDealAssociation(od); |
| 1228 }); |
| 1229 }); |
| 1230 |
| 1231 |
| 1232 unittest.group("obj-schema-Date", () { |
| 1233 unittest.test("to-json--from-json", () { |
| 1234 var o = buildDate(); |
| 1235 var od = new api.Date.fromJson(o.toJson()); |
| 1236 checkDate(od); |
| 1237 }); |
| 1238 }); |
| 1239 |
| 1240 |
| 1241 unittest.group("obj-schema-Disapproval", () { |
| 1242 unittest.test("to-json--from-json", () { |
| 1243 var o = buildDisapproval(); |
| 1244 var od = new api.Disapproval.fromJson(o.toJson()); |
| 1245 checkDisapproval(od); |
| 1246 }); |
| 1247 }); |
| 1248 |
| 1249 |
| 1250 unittest.group("obj-schema-Empty", () { |
| 1251 unittest.test("to-json--from-json", () { |
| 1252 var o = buildEmpty(); |
| 1253 var od = new api.Empty.fromJson(o.toJson()); |
| 1254 checkEmpty(od); |
| 1255 }); |
| 1256 }); |
| 1257 |
| 1258 |
| 1259 unittest.group("obj-schema-FilteringStats", () { |
| 1260 unittest.test("to-json--from-json", () { |
| 1261 var o = buildFilteringStats(); |
| 1262 var od = new api.FilteringStats.fromJson(o.toJson()); |
| 1263 checkFilteringStats(od); |
| 1264 }); |
| 1265 }); |
| 1266 |
| 1267 |
| 1268 unittest.group("obj-schema-HtmlContent", () { |
| 1269 unittest.test("to-json--from-json", () { |
| 1270 var o = buildHtmlContent(); |
| 1271 var od = new api.HtmlContent.fromJson(o.toJson()); |
| 1272 checkHtmlContent(od); |
| 1273 }); |
| 1274 }); |
| 1275 |
| 1276 |
| 1277 unittest.group("obj-schema-Image", () { |
| 1278 unittest.test("to-json--from-json", () { |
| 1279 var o = buildImage(); |
| 1280 var od = new api.Image.fromJson(o.toJson()); |
| 1281 checkImage(od); |
| 1282 }); |
| 1283 }); |
| 1284 |
| 1285 |
| 266 unittest.group("obj-schema-ListClientUserInvitationsResponse", () { | 1286 unittest.group("obj-schema-ListClientUserInvitationsResponse", () { |
| 267 unittest.test("to-json--from-json", () { | 1287 unittest.test("to-json--from-json", () { |
| 268 var o = buildListClientUserInvitationsResponse(); | 1288 var o = buildListClientUserInvitationsResponse(); |
| 269 var od = new api.ListClientUserInvitationsResponse.fromJson(o.toJson()); | 1289 var od = new api.ListClientUserInvitationsResponse.fromJson(o.toJson()); |
| 270 checkListClientUserInvitationsResponse(od); | 1290 checkListClientUserInvitationsResponse(od); |
| 271 }); | 1291 }); |
| 272 }); | 1292 }); |
| 273 | 1293 |
| 274 | 1294 |
| 275 unittest.group("obj-schema-ListClientUsersResponse", () { | 1295 unittest.group("obj-schema-ListClientUsersResponse", () { |
| 276 unittest.test("to-json--from-json", () { | 1296 unittest.test("to-json--from-json", () { |
| 277 var o = buildListClientUsersResponse(); | 1297 var o = buildListClientUsersResponse(); |
| 278 var od = new api.ListClientUsersResponse.fromJson(o.toJson()); | 1298 var od = new api.ListClientUsersResponse.fromJson(o.toJson()); |
| 279 checkListClientUsersResponse(od); | 1299 checkListClientUsersResponse(od); |
| 280 }); | 1300 }); |
| 281 }); | 1301 }); |
| 282 | 1302 |
| 283 | 1303 |
| 284 unittest.group("obj-schema-ListClientsResponse", () { | 1304 unittest.group("obj-schema-ListClientsResponse", () { |
| 285 unittest.test("to-json--from-json", () { | 1305 unittest.test("to-json--from-json", () { |
| 286 var o = buildListClientsResponse(); | 1306 var o = buildListClientsResponse(); |
| 287 var od = new api.ListClientsResponse.fromJson(o.toJson()); | 1307 var od = new api.ListClientsResponse.fromJson(o.toJson()); |
| 288 checkListClientsResponse(od); | 1308 checkListClientsResponse(od); |
| 289 }); | 1309 }); |
| 290 }); | 1310 }); |
| 291 | 1311 |
| 292 | 1312 |
| 1313 unittest.group("obj-schema-ListCreativesResponse", () { |
| 1314 unittest.test("to-json--from-json", () { |
| 1315 var o = buildListCreativesResponse(); |
| 1316 var od = new api.ListCreativesResponse.fromJson(o.toJson()); |
| 1317 checkListCreativesResponse(od); |
| 1318 }); |
| 1319 }); |
| 1320 |
| 1321 |
| 1322 unittest.group("obj-schema-ListDealAssociationsResponse", () { |
| 1323 unittest.test("to-json--from-json", () { |
| 1324 var o = buildListDealAssociationsResponse(); |
| 1325 var od = new api.ListDealAssociationsResponse.fromJson(o.toJson()); |
| 1326 checkListDealAssociationsResponse(od); |
| 1327 }); |
| 1328 }); |
| 1329 |
| 1330 |
| 1331 unittest.group("obj-schema-LocationContext", () { |
| 1332 unittest.test("to-json--from-json", () { |
| 1333 var o = buildLocationContext(); |
| 1334 var od = new api.LocationContext.fromJson(o.toJson()); |
| 1335 checkLocationContext(od); |
| 1336 }); |
| 1337 }); |
| 1338 |
| 1339 |
| 1340 unittest.group("obj-schema-NativeContent", () { |
| 1341 unittest.test("to-json--from-json", () { |
| 1342 var o = buildNativeContent(); |
| 1343 var od = new api.NativeContent.fromJson(o.toJson()); |
| 1344 checkNativeContent(od); |
| 1345 }); |
| 1346 }); |
| 1347 |
| 1348 |
| 1349 unittest.group("obj-schema-PlatformContext", () { |
| 1350 unittest.test("to-json--from-json", () { |
| 1351 var o = buildPlatformContext(); |
| 1352 var od = new api.PlatformContext.fromJson(o.toJson()); |
| 1353 checkPlatformContext(od); |
| 1354 }); |
| 1355 }); |
| 1356 |
| 1357 |
| 1358 unittest.group("obj-schema-Reason", () { |
| 1359 unittest.test("to-json--from-json", () { |
| 1360 var o = buildReason(); |
| 1361 var od = new api.Reason.fromJson(o.toJson()); |
| 1362 checkReason(od); |
| 1363 }); |
| 1364 }); |
| 1365 |
| 1366 |
| 1367 unittest.group("obj-schema-RemoveDealAssociationRequest", () { |
| 1368 unittest.test("to-json--from-json", () { |
| 1369 var o = buildRemoveDealAssociationRequest(); |
| 1370 var od = new api.RemoveDealAssociationRequest.fromJson(o.toJson()); |
| 1371 checkRemoveDealAssociationRequest(od); |
| 1372 }); |
| 1373 }); |
| 1374 |
| 1375 |
| 1376 unittest.group("obj-schema-SecurityContext", () { |
| 1377 unittest.test("to-json--from-json", () { |
| 1378 var o = buildSecurityContext(); |
| 1379 var od = new api.SecurityContext.fromJson(o.toJson()); |
| 1380 checkSecurityContext(od); |
| 1381 }); |
| 1382 }); |
| 1383 |
| 1384 |
| 1385 unittest.group("obj-schema-ServingContext", () { |
| 1386 unittest.test("to-json--from-json", () { |
| 1387 var o = buildServingContext(); |
| 1388 var od = new api.ServingContext.fromJson(o.toJson()); |
| 1389 checkServingContext(od); |
| 1390 }); |
| 1391 }); |
| 1392 |
| 1393 |
| 1394 unittest.group("obj-schema-ServingRestriction", () { |
| 1395 unittest.test("to-json--from-json", () { |
| 1396 var o = buildServingRestriction(); |
| 1397 var od = new api.ServingRestriction.fromJson(o.toJson()); |
| 1398 checkServingRestriction(od); |
| 1399 }); |
| 1400 }); |
| 1401 |
| 1402 |
| 1403 unittest.group("obj-schema-StopWatchingCreativeRequest", () { |
| 1404 unittest.test("to-json--from-json", () { |
| 1405 var o = buildStopWatchingCreativeRequest(); |
| 1406 var od = new api.StopWatchingCreativeRequest.fromJson(o.toJson()); |
| 1407 checkStopWatchingCreativeRequest(od); |
| 1408 }); |
| 1409 }); |
| 1410 |
| 1411 |
| 1412 unittest.group("obj-schema-VideoContent", () { |
| 1413 unittest.test("to-json--from-json", () { |
| 1414 var o = buildVideoContent(); |
| 1415 var od = new api.VideoContent.fromJson(o.toJson()); |
| 1416 checkVideoContent(od); |
| 1417 }); |
| 1418 }); |
| 1419 |
| 1420 |
| 1421 unittest.group("obj-schema-WatchCreativeRequest", () { |
| 1422 unittest.test("to-json--from-json", () { |
| 1423 var o = buildWatchCreativeRequest(); |
| 1424 var od = new api.WatchCreativeRequest.fromJson(o.toJson()); |
| 1425 checkWatchCreativeRequest(od); |
| 1426 }); |
| 1427 }); |
| 1428 |
| 1429 |
| 293 unittest.group("resource-AccountsClientsResourceApi", () { | 1430 unittest.group("resource-AccountsClientsResourceApi", () { |
| 294 unittest.test("method--create", () { | 1431 unittest.test("method--create", () { |
| 295 | 1432 |
| 296 var mock = new HttpServerMock(); | 1433 var mock = new HttpServerMock(); |
| 297 api.AccountsClientsResourceApi res = new api.Adexchangebuyer2Api(mock).acc
ounts.clients; | 1434 api.AccountsClientsResourceApi res = new api.Adexchangebuyer2Api(mock).acc
ounts.clients; |
| 298 var arg_request = buildClient(); | 1435 var arg_request = buildClient(); |
| 299 var arg_accountId = "foo"; | 1436 var arg_accountId = "foo"; |
| 300 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1437 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 301 var obj = new api.Client.fromJson(json); | 1438 var obj = new api.Client.fromJson(json); |
| 302 checkClient(obj); | 1439 checkClient(obj); |
| 303 | 1440 |
| 304 var path = (req.url).path; | 1441 var path = (req.url).path; |
| 305 var pathOffset = 0; | 1442 var pathOffset = 0; |
| 306 var index; | 1443 var index; |
| 1444 var subPart; |
| 1445 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1446 pathOffset += 1; |
| 1447 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 1448 pathOffset += 17; |
| 1449 index = path.indexOf("/clients", pathOffset); |
| 1450 unittest.expect(index >= 0, unittest.isTrue); |
| 1451 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1452 pathOffset = index; |
| 1453 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 1454 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/clients")); |
| 1455 pathOffset += 8; |
| 1456 |
| 1457 var query = (req.url).query; |
| 1458 var queryOffset = 0; |
| 1459 var queryMap = {}; |
| 1460 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1461 parseBool(n) { |
| 1462 if (n == "true") return true; |
| 1463 if (n == "false") return false; |
| 1464 if (n == null) return null; |
| 1465 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1466 } |
| 1467 if (query.length > 0) { |
| 1468 for (var part in query.split("&")) { |
| 1469 var keyvalue = part.split("="); |
| 1470 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1471 } |
| 1472 } |
| 1473 |
| 1474 |
| 1475 var h = { |
| 1476 "content-type" : "application/json; charset=utf-8", |
| 1477 }; |
| 1478 var resp = convert.JSON.encode(buildClient()); |
| 1479 return new async.Future.value(stringResponse(200, h, resp)); |
| 1480 }), true); |
| 1481 res.create(arg_request, arg_accountId).then(unittest.expectAsync(((api.Cli
ent response) { |
| 1482 checkClient(response); |
| 1483 }))); |
| 1484 }); |
| 1485 |
| 1486 unittest.test("method--get", () { |
| 1487 |
| 1488 var mock = new HttpServerMock(); |
| 1489 api.AccountsClientsResourceApi res = new api.Adexchangebuyer2Api(mock).acc
ounts.clients; |
| 1490 var arg_accountId = "foo"; |
| 1491 var arg_clientAccountId = "foo"; |
| 1492 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1493 var path = (req.url).path; |
| 1494 var pathOffset = 0; |
| 1495 var index; |
| 1496 var subPart; |
| 1497 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1498 pathOffset += 1; |
| 1499 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 1500 pathOffset += 17; |
| 1501 index = path.indexOf("/clients/", pathOffset); |
| 1502 unittest.expect(index >= 0, unittest.isTrue); |
| 1503 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1504 pathOffset = index; |
| 1505 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 1506 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); |
| 1507 pathOffset += 9; |
| 1508 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1509 pathOffset = path.length; |
| 1510 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); |
| 1511 |
| 1512 var query = (req.url).query; |
| 1513 var queryOffset = 0; |
| 1514 var queryMap = {}; |
| 1515 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1516 parseBool(n) { |
| 1517 if (n == "true") return true; |
| 1518 if (n == "false") return false; |
| 1519 if (n == null) return null; |
| 1520 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1521 } |
| 1522 if (query.length > 0) { |
| 1523 for (var part in query.split("&")) { |
| 1524 var keyvalue = part.split("="); |
| 1525 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1526 } |
| 1527 } |
| 1528 |
| 1529 |
| 1530 var h = { |
| 1531 "content-type" : "application/json; charset=utf-8", |
| 1532 }; |
| 1533 var resp = convert.JSON.encode(buildClient()); |
| 1534 return new async.Future.value(stringResponse(200, h, resp)); |
| 1535 }), true); |
| 1536 res.get(arg_accountId, arg_clientAccountId).then(unittest.expectAsync(((ap
i.Client response) { |
| 1537 checkClient(response); |
| 1538 }))); |
| 1539 }); |
| 1540 |
| 1541 unittest.test("method--list", () { |
| 1542 |
| 1543 var mock = new HttpServerMock(); |
| 1544 api.AccountsClientsResourceApi res = new api.Adexchangebuyer2Api(mock).acc
ounts.clients; |
| 1545 var arg_accountId = "foo"; |
| 1546 var arg_pageToken = "foo"; |
| 1547 var arg_pageSize = 42; |
| 1548 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1549 var path = (req.url).path; |
| 1550 var pathOffset = 0; |
| 1551 var index; |
| 1552 var subPart; |
| 1553 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1554 pathOffset += 1; |
| 1555 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 1556 pathOffset += 17; |
| 1557 index = path.indexOf("/clients", pathOffset); |
| 1558 unittest.expect(index >= 0, unittest.isTrue); |
| 1559 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1560 pathOffset = index; |
| 1561 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 1562 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/clients")); |
| 1563 pathOffset += 8; |
| 1564 |
| 1565 var query = (req.url).query; |
| 1566 var queryOffset = 0; |
| 1567 var queryMap = {}; |
| 1568 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1569 parseBool(n) { |
| 1570 if (n == "true") return true; |
| 1571 if (n == "false") return false; |
| 1572 if (n == null) return null; |
| 1573 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1574 } |
| 1575 if (query.length > 0) { |
| 1576 for (var part in query.split("&")) { |
| 1577 var keyvalue = part.split("="); |
| 1578 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1579 } |
| 1580 } |
| 1581 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1582 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1583 |
| 1584 |
| 1585 var h = { |
| 1586 "content-type" : "application/json; charset=utf-8", |
| 1587 }; |
| 1588 var resp = convert.JSON.encode(buildListClientsResponse()); |
| 1589 return new async.Future.value(stringResponse(200, h, resp)); |
| 1590 }), true); |
| 1591 res.list(arg_accountId, pageToken: arg_pageToken, pageSize: arg_pageSize).
then(unittest.expectAsync(((api.ListClientsResponse response) { |
| 1592 checkListClientsResponse(response); |
| 1593 }))); |
| 1594 }); |
| 1595 |
| 1596 unittest.test("method--update", () { |
| 1597 |
| 1598 var mock = new HttpServerMock(); |
| 1599 api.AccountsClientsResourceApi res = new api.Adexchangebuyer2Api(mock).acc
ounts.clients; |
| 1600 var arg_request = buildClient(); |
| 1601 var arg_accountId = "foo"; |
| 1602 var arg_clientAccountId = "foo"; |
| 1603 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1604 var obj = new api.Client.fromJson(json); |
| 1605 checkClient(obj); |
| 1606 |
| 1607 var path = (req.url).path; |
| 1608 var pathOffset = 0; |
| 1609 var index; |
| 1610 var subPart; |
| 1611 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1612 pathOffset += 1; |
| 1613 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 1614 pathOffset += 17; |
| 1615 index = path.indexOf("/clients/", pathOffset); |
| 1616 unittest.expect(index >= 0, unittest.isTrue); |
| 1617 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1618 pathOffset = index; |
| 1619 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 1620 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); |
| 1621 pathOffset += 9; |
| 1622 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1623 pathOffset = path.length; |
| 1624 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); |
| 1625 |
| 1626 var query = (req.url).query; |
| 1627 var queryOffset = 0; |
| 1628 var queryMap = {}; |
| 1629 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1630 parseBool(n) { |
| 1631 if (n == "true") return true; |
| 1632 if (n == "false") return false; |
| 1633 if (n == null) return null; |
| 1634 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1635 } |
| 1636 if (query.length > 0) { |
| 1637 for (var part in query.split("&")) { |
| 1638 var keyvalue = part.split("="); |
| 1639 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1640 } |
| 1641 } |
| 1642 |
| 1643 |
| 1644 var h = { |
| 1645 "content-type" : "application/json; charset=utf-8", |
| 1646 }; |
| 1647 var resp = convert.JSON.encode(buildClient()); |
| 1648 return new async.Future.value(stringResponse(200, h, resp)); |
| 1649 }), true); |
| 1650 res.update(arg_request, arg_accountId, arg_clientAccountId).then(unittest.
expectAsync(((api.Client response) { |
| 1651 checkClient(response); |
| 1652 }))); |
| 1653 }); |
| 1654 |
| 1655 }); |
| 1656 |
| 1657 |
| 1658 unittest.group("resource-AccountsClientsInvitationsResourceApi", () { |
| 1659 unittest.test("method--create", () { |
| 1660 |
| 1661 var mock = new HttpServerMock(); |
| 1662 api.AccountsClientsInvitationsResourceApi res = new api.Adexchangebuyer2Ap
i(mock).accounts.clients.invitations; |
| 1663 var arg_request = buildClientUserInvitation(); |
| 1664 var arg_accountId = "foo"; |
| 1665 var arg_clientAccountId = "foo"; |
| 1666 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1667 var obj = new api.ClientUserInvitation.fromJson(json); |
| 1668 checkClientUserInvitation(obj); |
| 1669 |
| 1670 var path = (req.url).path; |
| 1671 var pathOffset = 0; |
| 1672 var index; |
| 1673 var subPart; |
| 1674 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1675 pathOffset += 1; |
| 1676 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 1677 pathOffset += 17; |
| 1678 index = path.indexOf("/clients/", pathOffset); |
| 1679 unittest.expect(index >= 0, unittest.isTrue); |
| 1680 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1681 pathOffset = index; |
| 1682 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 1683 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); |
| 1684 pathOffset += 9; |
| 1685 index = path.indexOf("/invitations", pathOffset); |
| 1686 unittest.expect(index >= 0, unittest.isTrue); |
| 1687 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1688 pathOffset = index; |
| 1689 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); |
| 1690 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/invitations")); |
| 1691 pathOffset += 12; |
| 1692 |
| 1693 var query = (req.url).query; |
| 1694 var queryOffset = 0; |
| 1695 var queryMap = {}; |
| 1696 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1697 parseBool(n) { |
| 1698 if (n == "true") return true; |
| 1699 if (n == "false") return false; |
| 1700 if (n == null) return null; |
| 1701 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1702 } |
| 1703 if (query.length > 0) { |
| 1704 for (var part in query.split("&")) { |
| 1705 var keyvalue = part.split("="); |
| 1706 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1707 } |
| 1708 } |
| 1709 |
| 1710 |
| 1711 var h = { |
| 1712 "content-type" : "application/json; charset=utf-8", |
| 1713 }; |
| 1714 var resp = convert.JSON.encode(buildClientUserInvitation()); |
| 1715 return new async.Future.value(stringResponse(200, h, resp)); |
| 1716 }), true); |
| 1717 res.create(arg_request, arg_accountId, arg_clientAccountId).then(unittest.
expectAsync(((api.ClientUserInvitation response) { |
| 1718 checkClientUserInvitation(response); |
| 1719 }))); |
| 1720 }); |
| 1721 |
| 1722 unittest.test("method--get", () { |
| 1723 |
| 1724 var mock = new HttpServerMock(); |
| 1725 api.AccountsClientsInvitationsResourceApi res = new api.Adexchangebuyer2Ap
i(mock).accounts.clients.invitations; |
| 1726 var arg_accountId = "foo"; |
| 1727 var arg_clientAccountId = "foo"; |
| 1728 var arg_invitationId = "foo"; |
| 1729 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1730 var path = (req.url).path; |
| 1731 var pathOffset = 0; |
| 1732 var index; |
| 1733 var subPart; |
| 1734 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1735 pathOffset += 1; |
| 1736 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 1737 pathOffset += 17; |
| 1738 index = path.indexOf("/clients/", pathOffset); |
| 1739 unittest.expect(index >= 0, unittest.isTrue); |
| 1740 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1741 pathOffset = index; |
| 1742 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 1743 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); |
| 1744 pathOffset += 9; |
| 1745 index = path.indexOf("/invitations/", pathOffset); |
| 1746 unittest.expect(index >= 0, unittest.isTrue); |
| 1747 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1748 pathOffset = index; |
| 1749 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); |
| 1750 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/invitations/")); |
| 1751 pathOffset += 13; |
| 1752 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1753 pathOffset = path.length; |
| 1754 unittest.expect(subPart, unittest.equals("$arg_invitationId")); |
| 1755 |
| 1756 var query = (req.url).query; |
| 1757 var queryOffset = 0; |
| 1758 var queryMap = {}; |
| 1759 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1760 parseBool(n) { |
| 1761 if (n == "true") return true; |
| 1762 if (n == "false") return false; |
| 1763 if (n == null) return null; |
| 1764 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1765 } |
| 1766 if (query.length > 0) { |
| 1767 for (var part in query.split("&")) { |
| 1768 var keyvalue = part.split("="); |
| 1769 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1770 } |
| 1771 } |
| 1772 |
| 1773 |
| 1774 var h = { |
| 1775 "content-type" : "application/json; charset=utf-8", |
| 1776 }; |
| 1777 var resp = convert.JSON.encode(buildClientUserInvitation()); |
| 1778 return new async.Future.value(stringResponse(200, h, resp)); |
| 1779 }), true); |
| 1780 res.get(arg_accountId, arg_clientAccountId, arg_invitationId).then(unittes
t.expectAsync(((api.ClientUserInvitation response) { |
| 1781 checkClientUserInvitation(response); |
| 1782 }))); |
| 1783 }); |
| 1784 |
| 1785 unittest.test("method--list", () { |
| 1786 |
| 1787 var mock = new HttpServerMock(); |
| 1788 api.AccountsClientsInvitationsResourceApi res = new api.Adexchangebuyer2Ap
i(mock).accounts.clients.invitations; |
| 1789 var arg_accountId = "foo"; |
| 1790 var arg_clientAccountId = "foo"; |
| 1791 var arg_pageToken = "foo"; |
| 1792 var arg_pageSize = 42; |
| 1793 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1794 var path = (req.url).path; |
| 1795 var pathOffset = 0; |
| 1796 var index; |
| 1797 var subPart; |
| 1798 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1799 pathOffset += 1; |
| 1800 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 1801 pathOffset += 17; |
| 1802 index = path.indexOf("/clients/", pathOffset); |
| 1803 unittest.expect(index >= 0, unittest.isTrue); |
| 1804 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1805 pathOffset = index; |
| 1806 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 1807 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); |
| 1808 pathOffset += 9; |
| 1809 index = path.indexOf("/invitations", pathOffset); |
| 1810 unittest.expect(index >= 0, unittest.isTrue); |
| 1811 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1812 pathOffset = index; |
| 1813 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); |
| 1814 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/invitations")); |
| 1815 pathOffset += 12; |
| 1816 |
| 1817 var query = (req.url).query; |
| 1818 var queryOffset = 0; |
| 1819 var queryMap = {}; |
| 1820 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1821 parseBool(n) { |
| 1822 if (n == "true") return true; |
| 1823 if (n == "false") return false; |
| 1824 if (n == null) return null; |
| 1825 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1826 } |
| 1827 if (query.length > 0) { |
| 1828 for (var part in query.split("&")) { |
| 1829 var keyvalue = part.split("="); |
| 1830 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1831 } |
| 1832 } |
| 1833 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1834 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 1835 |
| 1836 |
| 1837 var h = { |
| 1838 "content-type" : "application/json; charset=utf-8", |
| 1839 }; |
| 1840 var resp = convert.JSON.encode(buildListClientUserInvitationsResponse())
; |
| 1841 return new async.Future.value(stringResponse(200, h, resp)); |
| 1842 }), true); |
| 1843 res.list(arg_accountId, arg_clientAccountId, pageToken: arg_pageToken, pag
eSize: arg_pageSize).then(unittest.expectAsync(((api.ListClientUserInvitationsRe
sponse response) { |
| 1844 checkListClientUserInvitationsResponse(response); |
| 1845 }))); |
| 1846 }); |
| 1847 |
| 1848 }); |
| 1849 |
| 1850 |
| 1851 unittest.group("resource-AccountsClientsUsersResourceApi", () { |
| 1852 unittest.test("method--get", () { |
| 1853 |
| 1854 var mock = new HttpServerMock(); |
| 1855 api.AccountsClientsUsersResourceApi res = new api.Adexchangebuyer2Api(mock
).accounts.clients.users; |
| 1856 var arg_accountId = "foo"; |
| 1857 var arg_clientAccountId = "foo"; |
| 1858 var arg_userId = "foo"; |
| 1859 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1860 var path = (req.url).path; |
| 1861 var pathOffset = 0; |
| 1862 var index; |
| 1863 var subPart; |
| 1864 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 1865 pathOffset += 1; |
| 1866 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 1867 pathOffset += 17; |
| 1868 index = path.indexOf("/clients/", pathOffset); |
| 1869 unittest.expect(index >= 0, unittest.isTrue); |
| 1870 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1871 pathOffset = index; |
| 1872 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 1873 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); |
| 1874 pathOffset += 9; |
| 1875 index = path.indexOf("/users/", pathOffset); |
| 1876 unittest.expect(index >= 0, unittest.isTrue); |
| 1877 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1878 pathOffset = index; |
| 1879 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); |
| 1880 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/users/")); |
| 1881 pathOffset += 7; |
| 1882 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 1883 pathOffset = path.length; |
| 1884 unittest.expect(subPart, unittest.equals("$arg_userId")); |
| 1885 |
| 1886 var query = (req.url).query; |
| 1887 var queryOffset = 0; |
| 1888 var queryMap = {}; |
| 1889 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 1890 parseBool(n) { |
| 1891 if (n == "true") return true; |
| 1892 if (n == "false") return false; |
| 1893 if (n == null) return null; |
| 1894 throw new core.ArgumentError("Invalid boolean: $n"); |
| 1895 } |
| 1896 if (query.length > 0) { |
| 1897 for (var part in query.split("&")) { |
| 1898 var keyvalue = part.split("="); |
| 1899 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 1900 } |
| 1901 } |
| 1902 |
| 1903 |
| 1904 var h = { |
| 1905 "content-type" : "application/json; charset=utf-8", |
| 1906 }; |
| 1907 var resp = convert.JSON.encode(buildClientUser()); |
| 1908 return new async.Future.value(stringResponse(200, h, resp)); |
| 1909 }), true); |
| 1910 res.get(arg_accountId, arg_clientAccountId, arg_userId).then(unittest.expe
ctAsync(((api.ClientUser response) { |
| 1911 checkClientUser(response); |
| 1912 }))); |
| 1913 }); |
| 1914 |
| 1915 unittest.test("method--list", () { |
| 1916 |
| 1917 var mock = new HttpServerMock(); |
| 1918 api.AccountsClientsUsersResourceApi res = new api.Adexchangebuyer2Api(mock
).accounts.clients.users; |
| 1919 var arg_accountId = "foo"; |
| 1920 var arg_clientAccountId = "foo"; |
| 1921 var arg_pageToken = "foo"; |
| 1922 var arg_pageSize = 42; |
| 1923 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1924 var path = (req.url).path; |
| 1925 var pathOffset = 0; |
| 1926 var index; |
| 307 var subPart; | 1927 var subPart; |
| 308 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1928 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 309 pathOffset += 1; | 1929 pathOffset += 1; |
| 310 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); | 1930 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 311 pathOffset += 17; | 1931 pathOffset += 17; |
| 312 index = path.indexOf("/clients", pathOffset); | 1932 index = path.indexOf("/clients/", pathOffset); |
| 313 unittest.expect(index >= 0, unittest.isTrue); | 1933 unittest.expect(index >= 0, unittest.isTrue); |
| 314 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 1934 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 315 pathOffset = index; | 1935 pathOffset = index; |
| 316 unittest.expect(subPart, unittest.equals("$arg_accountId")); | 1936 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 317 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/clients")); | 1937 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); |
| 318 pathOffset += 8; | 1938 pathOffset += 9; |
| 1939 index = path.indexOf("/users", pathOffset); |
| 1940 unittest.expect(index >= 0, unittest.isTrue); |
| 1941 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 1942 pathOffset = index; |
| 1943 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); |
| 1944 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/users")); |
| 1945 pathOffset += 6; |
| 319 | 1946 |
| 320 var query = (req.url).query; | 1947 var query = (req.url).query; |
| 321 var queryOffset = 0; | 1948 var queryOffset = 0; |
| 322 var queryMap = {}; | 1949 var queryMap = {}; |
| 323 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 1950 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 324 parseBool(n) { | 1951 parseBool(n) { |
| 325 if (n == "true") return true; | 1952 if (n == "true") return true; |
| 326 if (n == "false") return false; | 1953 if (n == "false") return false; |
| 327 if (n == null) return null; | 1954 if (n == null) return null; |
| 328 throw new core.ArgumentError("Invalid boolean: $n"); | 1955 throw new core.ArgumentError("Invalid boolean: $n"); |
| 329 } | 1956 } |
| 330 if (query.length > 0) { | 1957 if (query.length > 0) { |
| 331 for (var part in query.split("&")) { | 1958 for (var part in query.split("&")) { |
| 332 var keyvalue = part.split("="); | 1959 var keyvalue = part.split("="); |
| 333 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 1960 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 334 } | 1961 } |
| 335 } | 1962 } |
| 1963 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 1964 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 336 | 1965 |
| 337 | 1966 |
| 338 var h = { | 1967 var h = { |
| 339 "content-type" : "application/json; charset=utf-8", | 1968 "content-type" : "application/json; charset=utf-8", |
| 340 }; | 1969 }; |
| 341 var resp = convert.JSON.encode(buildClient()); | 1970 var resp = convert.JSON.encode(buildListClientUsersResponse()); |
| 342 return new async.Future.value(stringResponse(200, h, resp)); | 1971 return new async.Future.value(stringResponse(200, h, resp)); |
| 343 }), true); | 1972 }), true); |
| 344 res.create(arg_request, arg_accountId).then(unittest.expectAsync(((api.Cli
ent response) { | 1973 res.list(arg_accountId, arg_clientAccountId, pageToken: arg_pageToken, pag
eSize: arg_pageSize).then(unittest.expectAsync(((api.ListClientUsersResponse res
ponse) { |
| 345 checkClient(response); | 1974 checkListClientUsersResponse(response); |
| 346 }))); | 1975 }))); |
| 347 }); | 1976 }); |
| 348 | 1977 |
| 349 unittest.test("method--get", () { | 1978 unittest.test("method--update", () { |
| 350 | 1979 |
| 351 var mock = new HttpServerMock(); | 1980 var mock = new HttpServerMock(); |
| 352 api.AccountsClientsResourceApi res = new api.Adexchangebuyer2Api(mock).acc
ounts.clients; | 1981 api.AccountsClientsUsersResourceApi res = new api.Adexchangebuyer2Api(mock
).accounts.clients.users; |
| 1982 var arg_request = buildClientUser(); |
| 353 var arg_accountId = "foo"; | 1983 var arg_accountId = "foo"; |
| 354 var arg_clientAccountId = "foo"; | 1984 var arg_clientAccountId = "foo"; |
| 1985 var arg_userId = "foo"; |
| 355 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 1986 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 1987 var obj = new api.ClientUser.fromJson(json); |
| 1988 checkClientUser(obj); |
| 1989 |
| 356 var path = (req.url).path; | 1990 var path = (req.url).path; |
| 357 var pathOffset = 0; | 1991 var pathOffset = 0; |
| 358 var index; | 1992 var index; |
| 359 var subPart; | 1993 var subPart; |
| 360 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 1994 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 361 pathOffset += 1; | 1995 pathOffset += 1; |
| 362 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); | 1996 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 363 pathOffset += 17; | 1997 pathOffset += 17; |
| 364 index = path.indexOf("/clients/", pathOffset); | 1998 index = path.indexOf("/clients/", pathOffset); |
| 365 unittest.expect(index >= 0, unittest.isTrue); | 1999 unittest.expect(index >= 0, unittest.isTrue); |
| 366 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2000 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 367 pathOffset = index; | 2001 pathOffset = index; |
| 368 unittest.expect(subPart, unittest.equals("$arg_accountId")); | 2002 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 369 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); | 2003 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); |
| 370 pathOffset += 9; | 2004 pathOffset += 9; |
| 2005 index = path.indexOf("/users/", pathOffset); |
| 2006 unittest.expect(index >= 0, unittest.isTrue); |
| 2007 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2008 pathOffset = index; |
| 2009 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); |
| 2010 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/users/")); |
| 2011 pathOffset += 7; |
| 371 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2012 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 372 pathOffset = path.length; | 2013 pathOffset = path.length; |
| 373 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); | 2014 unittest.expect(subPart, unittest.equals("$arg_userId")); |
| 374 | 2015 |
| 375 var query = (req.url).query; | 2016 var query = (req.url).query; |
| 376 var queryOffset = 0; | 2017 var queryOffset = 0; |
| 377 var queryMap = {}; | 2018 var queryMap = {}; |
| 378 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2019 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 379 parseBool(n) { | 2020 parseBool(n) { |
| 380 if (n == "true") return true; | 2021 if (n == "true") return true; |
| 381 if (n == "false") return false; | 2022 if (n == "false") return false; |
| 382 if (n == null) return null; | 2023 if (n == null) return null; |
| 383 throw new core.ArgumentError("Invalid boolean: $n"); | 2024 throw new core.ArgumentError("Invalid boolean: $n"); |
| 384 } | 2025 } |
| 385 if (query.length > 0) { | 2026 if (query.length > 0) { |
| 386 for (var part in query.split("&")) { | 2027 for (var part in query.split("&")) { |
| 387 var keyvalue = part.split("="); | 2028 var keyvalue = part.split("="); |
| 388 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2029 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 389 } | 2030 } |
| 390 } | 2031 } |
| 391 | 2032 |
| 392 | 2033 |
| 393 var h = { | 2034 var h = { |
| 394 "content-type" : "application/json; charset=utf-8", | 2035 "content-type" : "application/json; charset=utf-8", |
| 395 }; | 2036 }; |
| 396 var resp = convert.JSON.encode(buildClient()); | 2037 var resp = convert.JSON.encode(buildClientUser()); |
| 397 return new async.Future.value(stringResponse(200, h, resp)); | 2038 return new async.Future.value(stringResponse(200, h, resp)); |
| 398 }), true); | 2039 }), true); |
| 399 res.get(arg_accountId, arg_clientAccountId).then(unittest.expectAsync(((ap
i.Client response) { | 2040 res.update(arg_request, arg_accountId, arg_clientAccountId, arg_userId).th
en(unittest.expectAsync(((api.ClientUser response) { |
| 400 checkClient(response); | 2041 checkClientUser(response); |
| 401 }))); | 2042 }))); |
| 402 }); | 2043 }); |
| 403 | 2044 |
| 404 unittest.test("method--list", () { | 2045 }); |
| 2046 |
| 2047 |
| 2048 unittest.group("resource-AccountsCreativesResourceApi", () { |
| 2049 unittest.test("method--create", () { |
| 405 | 2050 |
| 406 var mock = new HttpServerMock(); | 2051 var mock = new HttpServerMock(); |
| 407 api.AccountsClientsResourceApi res = new api.Adexchangebuyer2Api(mock).acc
ounts.clients; | 2052 api.AccountsCreativesResourceApi res = new api.Adexchangebuyer2Api(mock).a
ccounts.creatives; |
| 2053 var arg_request = buildCreative(); |
| 408 var arg_accountId = "foo"; | 2054 var arg_accountId = "foo"; |
| 409 var arg_pageSize = 42; | 2055 var arg_duplicateIdMode = "foo"; |
| 410 var arg_pageToken = "foo"; | |
| 411 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2056 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2057 var obj = new api.Creative.fromJson(json); |
| 2058 checkCreative(obj); |
| 2059 |
| 412 var path = (req.url).path; | 2060 var path = (req.url).path; |
| 413 var pathOffset = 0; | 2061 var pathOffset = 0; |
| 414 var index; | 2062 var index; |
| 415 var subPart; | 2063 var subPart; |
| 416 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2064 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 417 pathOffset += 1; | 2065 pathOffset += 1; |
| 418 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); | 2066 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 419 pathOffset += 17; | 2067 pathOffset += 17; |
| 420 index = path.indexOf("/clients", pathOffset); | 2068 index = path.indexOf("/creatives", pathOffset); |
| 421 unittest.expect(index >= 0, unittest.isTrue); | 2069 unittest.expect(index >= 0, unittest.isTrue); |
| 422 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2070 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 423 pathOffset = index; | 2071 pathOffset = index; |
| 424 unittest.expect(subPart, unittest.equals("$arg_accountId")); | 2072 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 425 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/clients")); | 2073 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/creatives")); |
| 426 pathOffset += 8; | 2074 pathOffset += 10; |
| 427 | 2075 |
| 428 var query = (req.url).query; | 2076 var query = (req.url).query; |
| 429 var queryOffset = 0; | 2077 var queryOffset = 0; |
| 430 var queryMap = {}; | 2078 var queryMap = {}; |
| 431 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2079 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 432 parseBool(n) { | 2080 parseBool(n) { |
| 433 if (n == "true") return true; | 2081 if (n == "true") return true; |
| 434 if (n == "false") return false; | 2082 if (n == "false") return false; |
| 435 if (n == null) return null; | 2083 if (n == null) return null; |
| 436 throw new core.ArgumentError("Invalid boolean: $n"); | 2084 throw new core.ArgumentError("Invalid boolean: $n"); |
| 437 } | 2085 } |
| 438 if (query.length > 0) { | 2086 if (query.length > 0) { |
| 439 for (var part in query.split("&")) { | 2087 for (var part in query.split("&")) { |
| 440 var keyvalue = part.split("="); | 2088 var keyvalue = part.split("="); |
| 441 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2089 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 442 } | 2090 } |
| 443 } | 2091 } |
| 444 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 2092 unittest.expect(queryMap["duplicateIdMode"].first, unittest.equals(arg_d
uplicateIdMode)); |
| 445 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 446 | 2093 |
| 447 | 2094 |
| 448 var h = { | 2095 var h = { |
| 449 "content-type" : "application/json; charset=utf-8", | 2096 "content-type" : "application/json; charset=utf-8", |
| 450 }; | 2097 }; |
| 451 var resp = convert.JSON.encode(buildListClientsResponse()); | 2098 var resp = convert.JSON.encode(buildCreative()); |
| 452 return new async.Future.value(stringResponse(200, h, resp)); | 2099 return new async.Future.value(stringResponse(200, h, resp)); |
| 453 }), true); | 2100 }), true); |
| 454 res.list(arg_accountId, pageSize: arg_pageSize, pageToken: arg_pageToken).
then(unittest.expectAsync(((api.ListClientsResponse response) { | 2101 res.create(arg_request, arg_accountId, duplicateIdMode: arg_duplicateIdMod
e).then(unittest.expectAsync(((api.Creative response) { |
| 455 checkListClientsResponse(response); | 2102 checkCreative(response); |
| 456 }))); | 2103 }))); |
| 457 }); | 2104 }); |
| 458 | 2105 |
| 459 unittest.test("method--update", () { | 2106 unittest.test("method--get", () { |
| 460 | 2107 |
| 461 var mock = new HttpServerMock(); | 2108 var mock = new HttpServerMock(); |
| 462 api.AccountsClientsResourceApi res = new api.Adexchangebuyer2Api(mock).acc
ounts.clients; | 2109 api.AccountsCreativesResourceApi res = new api.Adexchangebuyer2Api(mock).a
ccounts.creatives; |
| 463 var arg_request = buildClient(); | |
| 464 var arg_accountId = "foo"; | 2110 var arg_accountId = "foo"; |
| 465 var arg_clientAccountId = "foo"; | 2111 var arg_creativeId = "foo"; |
| 466 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2112 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 467 var obj = new api.Client.fromJson(json); | |
| 468 checkClient(obj); | |
| 469 | |
| 470 var path = (req.url).path; | 2113 var path = (req.url).path; |
| 471 var pathOffset = 0; | 2114 var pathOffset = 0; |
| 472 var index; | 2115 var index; |
| 473 var subPart; | 2116 var subPart; |
| 474 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2117 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 475 pathOffset += 1; | 2118 pathOffset += 1; |
| 476 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); | 2119 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 477 pathOffset += 17; | 2120 pathOffset += 17; |
| 478 index = path.indexOf("/clients/", pathOffset); | 2121 index = path.indexOf("/creatives/", pathOffset); |
| 479 unittest.expect(index >= 0, unittest.isTrue); | 2122 unittest.expect(index >= 0, unittest.isTrue); |
| 480 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2123 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 481 pathOffset = index; | 2124 pathOffset = index; |
| 482 unittest.expect(subPart, unittest.equals("$arg_accountId")); | 2125 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 483 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); | 2126 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/creatives/")); |
| 484 pathOffset += 9; | 2127 pathOffset += 11; |
| 485 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2128 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 486 pathOffset = path.length; | 2129 pathOffset = path.length; |
| 487 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); | 2130 unittest.expect(subPart, unittest.equals("$arg_creativeId")); |
| 488 | 2131 |
| 489 var query = (req.url).query; | 2132 var query = (req.url).query; |
| 490 var queryOffset = 0; | 2133 var queryOffset = 0; |
| 491 var queryMap = {}; | 2134 var queryMap = {}; |
| 492 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2135 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 493 parseBool(n) { | 2136 parseBool(n) { |
| 494 if (n == "true") return true; | 2137 if (n == "true") return true; |
| 495 if (n == "false") return false; | 2138 if (n == "false") return false; |
| 496 if (n == null) return null; | 2139 if (n == null) return null; |
| 497 throw new core.ArgumentError("Invalid boolean: $n"); | 2140 throw new core.ArgumentError("Invalid boolean: $n"); |
| 498 } | 2141 } |
| 499 if (query.length > 0) { | 2142 if (query.length > 0) { |
| 500 for (var part in query.split("&")) { | 2143 for (var part in query.split("&")) { |
| 501 var keyvalue = part.split("="); | 2144 var keyvalue = part.split("="); |
| 502 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2145 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 503 } | 2146 } |
| 504 } | 2147 } |
| 505 | 2148 |
| 506 | 2149 |
| 507 var h = { | 2150 var h = { |
| 508 "content-type" : "application/json; charset=utf-8", | 2151 "content-type" : "application/json; charset=utf-8", |
| 509 }; | 2152 }; |
| 510 var resp = convert.JSON.encode(buildClient()); | 2153 var resp = convert.JSON.encode(buildCreative()); |
| 511 return new async.Future.value(stringResponse(200, h, resp)); | 2154 return new async.Future.value(stringResponse(200, h, resp)); |
| 512 }), true); | 2155 }), true); |
| 513 res.update(arg_request, arg_accountId, arg_clientAccountId).then(unittest.
expectAsync(((api.Client response) { | 2156 res.get(arg_accountId, arg_creativeId).then(unittest.expectAsync(((api.Cre
ative response) { |
| 514 checkClient(response); | 2157 checkCreative(response); |
| 515 }))); | 2158 }))); |
| 516 }); | 2159 }); |
| 517 | 2160 |
| 518 }); | 2161 unittest.test("method--list", () { |
| 2162 |
| 2163 var mock = new HttpServerMock(); |
| 2164 api.AccountsCreativesResourceApi res = new api.Adexchangebuyer2Api(mock).a
ccounts.creatives; |
| 2165 var arg_accountId = "foo"; |
| 2166 var arg_pageToken = "foo"; |
| 2167 var arg_pageSize = 42; |
| 2168 var arg_query = "foo"; |
| 2169 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2170 var path = (req.url).path; |
| 2171 var pathOffset = 0; |
| 2172 var index; |
| 2173 var subPart; |
| 2174 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2175 pathOffset += 1; |
| 2176 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 2177 pathOffset += 17; |
| 2178 index = path.indexOf("/creatives", pathOffset); |
| 2179 unittest.expect(index >= 0, unittest.isTrue); |
| 2180 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2181 pathOffset = index; |
| 2182 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 2183 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/creatives")); |
| 2184 pathOffset += 10; |
| 2185 |
| 2186 var query = (req.url).query; |
| 2187 var queryOffset = 0; |
| 2188 var queryMap = {}; |
| 2189 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2190 parseBool(n) { |
| 2191 if (n == "true") return true; |
| 2192 if (n == "false") return false; |
| 2193 if (n == null) return null; |
| 2194 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2195 } |
| 2196 if (query.length > 0) { |
| 2197 for (var part in query.split("&")) { |
| 2198 var keyvalue = part.split("="); |
| 2199 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2200 } |
| 2201 } |
| 2202 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2203 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2204 unittest.expect(queryMap["query"].first, unittest.equals(arg_query)); |
| 519 | 2205 |
| 520 | 2206 |
| 521 unittest.group("resource-AccountsClientsInvitationsResourceApi", () { | 2207 var h = { |
| 522 unittest.test("method--create", () { | 2208 "content-type" : "application/json; charset=utf-8", |
| 2209 }; |
| 2210 var resp = convert.JSON.encode(buildListCreativesResponse()); |
| 2211 return new async.Future.value(stringResponse(200, h, resp)); |
| 2212 }), true); |
| 2213 res.list(arg_accountId, pageToken: arg_pageToken, pageSize: arg_pageSize,
query: arg_query).then(unittest.expectAsync(((api.ListCreativesResponse response
) { |
| 2214 checkListCreativesResponse(response); |
| 2215 }))); |
| 2216 }); |
| 2217 |
| 2218 unittest.test("method--stopWatching", () { |
| 523 | 2219 |
| 524 var mock = new HttpServerMock(); | 2220 var mock = new HttpServerMock(); |
| 525 api.AccountsClientsInvitationsResourceApi res = new api.Adexchangebuyer2Ap
i(mock).accounts.clients.invitations; | 2221 api.AccountsCreativesResourceApi res = new api.Adexchangebuyer2Api(mock).a
ccounts.creatives; |
| 526 var arg_request = buildClientUserInvitation(); | 2222 var arg_request = buildStopWatchingCreativeRequest(); |
| 527 var arg_accountId = "foo"; | 2223 var arg_accountId = "foo"; |
| 528 var arg_clientAccountId = "foo"; | 2224 var arg_creativeId = "foo"; |
| 529 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2225 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 530 var obj = new api.ClientUserInvitation.fromJson(json); | 2226 var obj = new api.StopWatchingCreativeRequest.fromJson(json); |
| 531 checkClientUserInvitation(obj); | 2227 checkStopWatchingCreativeRequest(obj); |
| 532 | 2228 |
| 533 var path = (req.url).path; | 2229 var path = (req.url).path; |
| 534 var pathOffset = 0; | 2230 var pathOffset = 0; |
| 535 var index; | 2231 var index; |
| 536 var subPart; | 2232 var subPart; |
| 537 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2233 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 538 pathOffset += 1; | 2234 pathOffset += 1; |
| 539 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); | 2235 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 540 pathOffset += 17; | 2236 pathOffset += 17; |
| 541 index = path.indexOf("/clients/", pathOffset); | 2237 index = path.indexOf("/creatives/", pathOffset); |
| 542 unittest.expect(index >= 0, unittest.isTrue); | 2238 unittest.expect(index >= 0, unittest.isTrue); |
| 543 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2239 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 544 pathOffset = index; | 2240 pathOffset = index; |
| 545 unittest.expect(subPart, unittest.equals("$arg_accountId")); | 2241 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 546 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); | 2242 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/creatives/")); |
| 547 pathOffset += 9; | 2243 pathOffset += 11; |
| 548 index = path.indexOf("/invitations", pathOffset); | 2244 index = path.indexOf(":stopWatching", pathOffset); |
| 549 unittest.expect(index >= 0, unittest.isTrue); | 2245 unittest.expect(index >= 0, unittest.isTrue); |
| 550 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2246 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 551 pathOffset = index; | 2247 pathOffset = index; |
| 552 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); | 2248 unittest.expect(subPart, unittest.equals("$arg_creativeId")); |
| 553 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/invitations")); | 2249 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals(":stopWatching")); |
| 554 pathOffset += 12; | 2250 pathOffset += 13; |
| 555 | 2251 |
| 556 var query = (req.url).query; | 2252 var query = (req.url).query; |
| 557 var queryOffset = 0; | 2253 var queryOffset = 0; |
| 558 var queryMap = {}; | 2254 var queryMap = {}; |
| 559 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2255 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 560 parseBool(n) { | 2256 parseBool(n) { |
| 561 if (n == "true") return true; | 2257 if (n == "true") return true; |
| 562 if (n == "false") return false; | 2258 if (n == "false") return false; |
| 563 if (n == null) return null; | 2259 if (n == null) return null; |
| 564 throw new core.ArgumentError("Invalid boolean: $n"); | 2260 throw new core.ArgumentError("Invalid boolean: $n"); |
| 565 } | 2261 } |
| 566 if (query.length > 0) { | 2262 if (query.length > 0) { |
| 567 for (var part in query.split("&")) { | 2263 for (var part in query.split("&")) { |
| 568 var keyvalue = part.split("="); | 2264 var keyvalue = part.split("="); |
| 569 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2265 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 570 } | 2266 } |
| 571 } | 2267 } |
| 572 | 2268 |
| 573 | 2269 |
| 574 var h = { | 2270 var h = { |
| 575 "content-type" : "application/json; charset=utf-8", | 2271 "content-type" : "application/json; charset=utf-8", |
| 576 }; | 2272 }; |
| 577 var resp = convert.JSON.encode(buildClientUserInvitation()); | 2273 var resp = convert.JSON.encode(buildEmpty()); |
| 578 return new async.Future.value(stringResponse(200, h, resp)); | 2274 return new async.Future.value(stringResponse(200, h, resp)); |
| 579 }), true); | 2275 }), true); |
| 580 res.create(arg_request, arg_accountId, arg_clientAccountId).then(unittest.
expectAsync(((api.ClientUserInvitation response) { | 2276 res.stopWatching(arg_request, arg_accountId, arg_creativeId).then(unittest
.expectAsync(((api.Empty response) { |
| 581 checkClientUserInvitation(response); | 2277 checkEmpty(response); |
| 582 }))); | 2278 }))); |
| 583 }); | 2279 }); |
| 584 | 2280 |
| 585 unittest.test("method--get", () { | 2281 unittest.test("method--update", () { |
| 586 | 2282 |
| 587 var mock = new HttpServerMock(); | 2283 var mock = new HttpServerMock(); |
| 588 api.AccountsClientsInvitationsResourceApi res = new api.Adexchangebuyer2Ap
i(mock).accounts.clients.invitations; | 2284 api.AccountsCreativesResourceApi res = new api.Adexchangebuyer2Api(mock).a
ccounts.creatives; |
| 2285 var arg_request = buildCreative(); |
| 589 var arg_accountId = "foo"; | 2286 var arg_accountId = "foo"; |
| 590 var arg_clientAccountId = "foo"; | 2287 var arg_creativeId = "foo"; |
| 591 var arg_invitationId = "foo"; | |
| 592 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2288 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2289 var obj = new api.Creative.fromJson(json); |
| 2290 checkCreative(obj); |
| 2291 |
| 593 var path = (req.url).path; | 2292 var path = (req.url).path; |
| 594 var pathOffset = 0; | 2293 var pathOffset = 0; |
| 595 var index; | 2294 var index; |
| 596 var subPart; | 2295 var subPart; |
| 597 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2296 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 598 pathOffset += 1; | 2297 pathOffset += 1; |
| 599 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); | 2298 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 600 pathOffset += 17; | 2299 pathOffset += 17; |
| 601 index = path.indexOf("/clients/", pathOffset); | 2300 index = path.indexOf("/creatives/", pathOffset); |
| 602 unittest.expect(index >= 0, unittest.isTrue); | 2301 unittest.expect(index >= 0, unittest.isTrue); |
| 603 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2302 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 604 pathOffset = index; | 2303 pathOffset = index; |
| 605 unittest.expect(subPart, unittest.equals("$arg_accountId")); | 2304 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 606 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); | 2305 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/creatives/")); |
| 607 pathOffset += 9; | 2306 pathOffset += 11; |
| 608 index = path.indexOf("/invitations/", pathOffset); | |
| 609 unittest.expect(index >= 0, unittest.isTrue); | |
| 610 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | |
| 611 pathOffset = index; | |
| 612 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); | |
| 613 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/invitations/")); | |
| 614 pathOffset += 13; | |
| 615 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | 2307 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 616 pathOffset = path.length; | 2308 pathOffset = path.length; |
| 617 unittest.expect(subPart, unittest.equals("$arg_invitationId")); | 2309 unittest.expect(subPart, unittest.equals("$arg_creativeId")); |
| 618 | 2310 |
| 619 var query = (req.url).query; | 2311 var query = (req.url).query; |
| 620 var queryOffset = 0; | 2312 var queryOffset = 0; |
| 621 var queryMap = {}; | 2313 var queryMap = {}; |
| 622 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2314 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 623 parseBool(n) { | 2315 parseBool(n) { |
| 624 if (n == "true") return true; | 2316 if (n == "true") return true; |
| 625 if (n == "false") return false; | 2317 if (n == "false") return false; |
| 626 if (n == null) return null; | 2318 if (n == null) return null; |
| 627 throw new core.ArgumentError("Invalid boolean: $n"); | 2319 throw new core.ArgumentError("Invalid boolean: $n"); |
| 628 } | 2320 } |
| 629 if (query.length > 0) { | 2321 if (query.length > 0) { |
| 630 for (var part in query.split("&")) { | 2322 for (var part in query.split("&")) { |
| 631 var keyvalue = part.split("="); | 2323 var keyvalue = part.split("="); |
| 632 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2324 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 633 } | 2325 } |
| 634 } | 2326 } |
| 635 | 2327 |
| 636 | 2328 |
| 637 var h = { | 2329 var h = { |
| 638 "content-type" : "application/json; charset=utf-8", | 2330 "content-type" : "application/json; charset=utf-8", |
| 639 }; | 2331 }; |
| 640 var resp = convert.JSON.encode(buildClientUserInvitation()); | 2332 var resp = convert.JSON.encode(buildCreative()); |
| 641 return new async.Future.value(stringResponse(200, h, resp)); | 2333 return new async.Future.value(stringResponse(200, h, resp)); |
| 642 }), true); | 2334 }), true); |
| 643 res.get(arg_accountId, arg_clientAccountId, arg_invitationId).then(unittes
t.expectAsync(((api.ClientUserInvitation response) { | 2335 res.update(arg_request, arg_accountId, arg_creativeId).then(unittest.expec
tAsync(((api.Creative response) { |
| 644 checkClientUserInvitation(response); | 2336 checkCreative(response); |
| 645 }))); | 2337 }))); |
| 646 }); | 2338 }); |
| 647 | 2339 |
| 648 unittest.test("method--list", () { | 2340 unittest.test("method--watch", () { |
| 649 | 2341 |
| 650 var mock = new HttpServerMock(); | 2342 var mock = new HttpServerMock(); |
| 651 api.AccountsClientsInvitationsResourceApi res = new api.Adexchangebuyer2Ap
i(mock).accounts.clients.invitations; | 2343 api.AccountsCreativesResourceApi res = new api.Adexchangebuyer2Api(mock).a
ccounts.creatives; |
| 2344 var arg_request = buildWatchCreativeRequest(); |
| 652 var arg_accountId = "foo"; | 2345 var arg_accountId = "foo"; |
| 653 var arg_clientAccountId = "foo"; | 2346 var arg_creativeId = "foo"; |
| 654 var arg_pageToken = "foo"; | |
| 655 var arg_pageSize = 42; | |
| 656 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2347 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2348 var obj = new api.WatchCreativeRequest.fromJson(json); |
| 2349 checkWatchCreativeRequest(obj); |
| 2350 |
| 657 var path = (req.url).path; | 2351 var path = (req.url).path; |
| 658 var pathOffset = 0; | 2352 var pathOffset = 0; |
| 659 var index; | 2353 var index; |
| 660 var subPart; | 2354 var subPart; |
| 661 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2355 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 662 pathOffset += 1; | 2356 pathOffset += 1; |
| 663 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); | 2357 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 664 pathOffset += 17; | 2358 pathOffset += 17; |
| 665 index = path.indexOf("/clients/", pathOffset); | 2359 index = path.indexOf("/creatives/", pathOffset); |
| 666 unittest.expect(index >= 0, unittest.isTrue); | 2360 unittest.expect(index >= 0, unittest.isTrue); |
| 667 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2361 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 668 pathOffset = index; | 2362 pathOffset = index; |
| 669 unittest.expect(subPart, unittest.equals("$arg_accountId")); | 2363 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 670 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); | 2364 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/creatives/")); |
| 671 pathOffset += 9; | 2365 pathOffset += 11; |
| 672 index = path.indexOf("/invitations", pathOffset); | 2366 index = path.indexOf(":watch", pathOffset); |
| 673 unittest.expect(index >= 0, unittest.isTrue); | 2367 unittest.expect(index >= 0, unittest.isTrue); |
| 674 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2368 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 675 pathOffset = index; | 2369 pathOffset = index; |
| 676 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); | 2370 unittest.expect(subPart, unittest.equals("$arg_creativeId")); |
| 677 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/invitations")); | 2371 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als(":watch")); |
| 678 pathOffset += 12; | 2372 pathOffset += 6; |
| 679 | 2373 |
| 680 var query = (req.url).query; | 2374 var query = (req.url).query; |
| 681 var queryOffset = 0; | 2375 var queryOffset = 0; |
| 682 var queryMap = {}; | 2376 var queryMap = {}; |
| 683 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2377 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 684 parseBool(n) { | 2378 parseBool(n) { |
| 685 if (n == "true") return true; | 2379 if (n == "true") return true; |
| 686 if (n == "false") return false; | 2380 if (n == "false") return false; |
| 687 if (n == null) return null; | 2381 if (n == null) return null; |
| 688 throw new core.ArgumentError("Invalid boolean: $n"); | 2382 throw new core.ArgumentError("Invalid boolean: $n"); |
| 689 } | 2383 } |
| 690 if (query.length > 0) { | 2384 if (query.length > 0) { |
| 691 for (var part in query.split("&")) { | 2385 for (var part in query.split("&")) { |
| 692 var keyvalue = part.split("="); | 2386 var keyvalue = part.split("="); |
| 693 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2387 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 694 } | 2388 } |
| 695 } | 2389 } |
| 696 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | |
| 697 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | |
| 698 | 2390 |
| 699 | 2391 |
| 700 var h = { | 2392 var h = { |
| 701 "content-type" : "application/json; charset=utf-8", | 2393 "content-type" : "application/json; charset=utf-8", |
| 702 }; | 2394 }; |
| 703 var resp = convert.JSON.encode(buildListClientUserInvitationsResponse())
; | 2395 var resp = convert.JSON.encode(buildEmpty()); |
| 704 return new async.Future.value(stringResponse(200, h, resp)); | 2396 return new async.Future.value(stringResponse(200, h, resp)); |
| 705 }), true); | 2397 }), true); |
| 706 res.list(arg_accountId, arg_clientAccountId, pageToken: arg_pageToken, pag
eSize: arg_pageSize).then(unittest.expectAsync(((api.ListClientUserInvitationsRe
sponse response) { | 2398 res.watch(arg_request, arg_accountId, arg_creativeId).then(unittest.expect
Async(((api.Empty response) { |
| 707 checkListClientUserInvitationsResponse(response); | 2399 checkEmpty(response); |
| 708 }))); | 2400 }))); |
| 709 }); | 2401 }); |
| 710 | 2402 |
| 711 }); | 2403 }); |
| 712 | 2404 |
| 713 | 2405 |
| 714 unittest.group("resource-AccountsClientsUsersResourceApi", () { | 2406 unittest.group("resource-AccountsCreativesDealAssociationsResourceApi", () { |
| 715 unittest.test("method--get", () { | 2407 unittest.test("method--add", () { |
| 716 | 2408 |
| 717 var mock = new HttpServerMock(); | 2409 var mock = new HttpServerMock(); |
| 718 api.AccountsClientsUsersResourceApi res = new api.Adexchangebuyer2Api(mock
).accounts.clients.users; | 2410 api.AccountsCreativesDealAssociationsResourceApi res = new api.Adexchangeb
uyer2Api(mock).accounts.creatives.dealAssociations; |
| 2411 var arg_request = buildAddDealAssociationRequest(); |
| 719 var arg_accountId = "foo"; | 2412 var arg_accountId = "foo"; |
| 720 var arg_clientAccountId = "foo"; | 2413 var arg_creativeId = "foo"; |
| 721 var arg_userId = "foo"; | |
| 722 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2414 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2415 var obj = new api.AddDealAssociationRequest.fromJson(json); |
| 2416 checkAddDealAssociationRequest(obj); |
| 2417 |
| 723 var path = (req.url).path; | 2418 var path = (req.url).path; |
| 724 var pathOffset = 0; | 2419 var pathOffset = 0; |
| 725 var index; | 2420 var index; |
| 726 var subPart; | 2421 var subPart; |
| 727 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2422 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 728 pathOffset += 1; | 2423 pathOffset += 1; |
| 729 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); | 2424 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 730 pathOffset += 17; | 2425 pathOffset += 17; |
| 731 index = path.indexOf("/clients/", pathOffset); | 2426 index = path.indexOf("/creatives/", pathOffset); |
| 732 unittest.expect(index >= 0, unittest.isTrue); | 2427 unittest.expect(index >= 0, unittest.isTrue); |
| 733 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2428 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 734 pathOffset = index; | 2429 pathOffset = index; |
| 735 unittest.expect(subPart, unittest.equals("$arg_accountId")); | 2430 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 736 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); | 2431 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/creatives/")); |
| 737 pathOffset += 9; | 2432 pathOffset += 11; |
| 738 index = path.indexOf("/users/", pathOffset); | 2433 index = path.indexOf("/dealAssociations:add", pathOffset); |
| 739 unittest.expect(index >= 0, unittest.isTrue); | 2434 unittest.expect(index >= 0, unittest.isTrue); |
| 740 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2435 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 741 pathOffset = index; | 2436 pathOffset = index; |
| 742 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); | 2437 unittest.expect(subPart, unittest.equals("$arg_creativeId")); |
| 743 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/users/")); | 2438 unittest.expect(path.substring(pathOffset, pathOffset + 21), unittest.eq
uals("/dealAssociations:add")); |
| 744 pathOffset += 7; | 2439 pathOffset += 21; |
| 745 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 746 pathOffset = path.length; | |
| 747 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
| 748 | 2440 |
| 749 var query = (req.url).query; | 2441 var query = (req.url).query; |
| 750 var queryOffset = 0; | 2442 var queryOffset = 0; |
| 751 var queryMap = {}; | 2443 var queryMap = {}; |
| 752 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2444 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 753 parseBool(n) { | 2445 parseBool(n) { |
| 754 if (n == "true") return true; | 2446 if (n == "true") return true; |
| 755 if (n == "false") return false; | 2447 if (n == "false") return false; |
| 756 if (n == null) return null; | 2448 if (n == null) return null; |
| 757 throw new core.ArgumentError("Invalid boolean: $n"); | 2449 throw new core.ArgumentError("Invalid boolean: $n"); |
| 758 } | 2450 } |
| 759 if (query.length > 0) { | 2451 if (query.length > 0) { |
| 760 for (var part in query.split("&")) { | 2452 for (var part in query.split("&")) { |
| 761 var keyvalue = part.split("="); | 2453 var keyvalue = part.split("="); |
| 762 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2454 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 763 } | 2455 } |
| 764 } | 2456 } |
| 765 | 2457 |
| 766 | 2458 |
| 767 var h = { | 2459 var h = { |
| 768 "content-type" : "application/json; charset=utf-8", | 2460 "content-type" : "application/json; charset=utf-8", |
| 769 }; | 2461 }; |
| 770 var resp = convert.JSON.encode(buildClientUser()); | 2462 var resp = convert.JSON.encode(buildEmpty()); |
| 771 return new async.Future.value(stringResponse(200, h, resp)); | 2463 return new async.Future.value(stringResponse(200, h, resp)); |
| 772 }), true); | 2464 }), true); |
| 773 res.get(arg_accountId, arg_clientAccountId, arg_userId).then(unittest.expe
ctAsync(((api.ClientUser response) { | 2465 res.add(arg_request, arg_accountId, arg_creativeId).then(unittest.expectAs
ync(((api.Empty response) { |
| 774 checkClientUser(response); | 2466 checkEmpty(response); |
| 775 }))); | 2467 }))); |
| 776 }); | 2468 }); |
| 777 | 2469 |
| 778 unittest.test("method--list", () { | 2470 unittest.test("method--list", () { |
| 779 | 2471 |
| 780 var mock = new HttpServerMock(); | 2472 var mock = new HttpServerMock(); |
| 781 api.AccountsClientsUsersResourceApi res = new api.Adexchangebuyer2Api(mock
).accounts.clients.users; | 2473 api.AccountsCreativesDealAssociationsResourceApi res = new api.Adexchangeb
uyer2Api(mock).accounts.creatives.dealAssociations; |
| 782 var arg_accountId = "foo"; | 2474 var arg_accountId = "foo"; |
| 783 var arg_clientAccountId = "foo"; | 2475 var arg_creativeId = "foo"; |
| 784 var arg_pageToken = "foo"; | 2476 var arg_pageToken = "foo"; |
| 785 var arg_pageSize = 42; | 2477 var arg_pageSize = 42; |
| 2478 var arg_query = "foo"; |
| 786 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2479 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 787 var path = (req.url).path; | 2480 var path = (req.url).path; |
| 788 var pathOffset = 0; | 2481 var pathOffset = 0; |
| 789 var index; | 2482 var index; |
| 790 var subPart; | 2483 var subPart; |
| 791 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2484 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 792 pathOffset += 1; | 2485 pathOffset += 1; |
| 793 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); | 2486 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 794 pathOffset += 17; | 2487 pathOffset += 17; |
| 795 index = path.indexOf("/clients/", pathOffset); | 2488 index = path.indexOf("/creatives/", pathOffset); |
| 796 unittest.expect(index >= 0, unittest.isTrue); | 2489 unittest.expect(index >= 0, unittest.isTrue); |
| 797 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2490 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 798 pathOffset = index; | 2491 pathOffset = index; |
| 799 unittest.expect(subPart, unittest.equals("$arg_accountId")); | 2492 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 800 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); | 2493 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/creatives/")); |
| 801 pathOffset += 9; | 2494 pathOffset += 11; |
| 802 index = path.indexOf("/users", pathOffset); | 2495 index = path.indexOf("/dealAssociations", pathOffset); |
| 803 unittest.expect(index >= 0, unittest.isTrue); | 2496 unittest.expect(index >= 0, unittest.isTrue); |
| 804 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2497 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 805 pathOffset = index; | 2498 pathOffset = index; |
| 806 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); | 2499 unittest.expect(subPart, unittest.equals("$arg_creativeId")); |
| 807 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/users")); | 2500 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/dealAssociations")); |
| 808 pathOffset += 6; | 2501 pathOffset += 17; |
| 809 | 2502 |
| 810 var query = (req.url).query; | 2503 var query = (req.url).query; |
| 811 var queryOffset = 0; | 2504 var queryOffset = 0; |
| 812 var queryMap = {}; | 2505 var queryMap = {}; |
| 813 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2506 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 814 parseBool(n) { | 2507 parseBool(n) { |
| 815 if (n == "true") return true; | 2508 if (n == "true") return true; |
| 816 if (n == "false") return false; | 2509 if (n == "false") return false; |
| 817 if (n == null) return null; | 2510 if (n == null) return null; |
| 818 throw new core.ArgumentError("Invalid boolean: $n"); | 2511 throw new core.ArgumentError("Invalid boolean: $n"); |
| 819 } | 2512 } |
| 820 if (query.length > 0) { | 2513 if (query.length > 0) { |
| 821 for (var part in query.split("&")) { | 2514 for (var part in query.split("&")) { |
| 822 var keyvalue = part.split("="); | 2515 var keyvalue = part.split("="); |
| 823 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2516 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 824 } | 2517 } |
| 825 } | 2518 } |
| 826 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); | 2519 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 827 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); | 2520 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2521 unittest.expect(queryMap["query"].first, unittest.equals(arg_query)); |
| 828 | 2522 |
| 829 | 2523 |
| 830 var h = { | 2524 var h = { |
| 831 "content-type" : "application/json; charset=utf-8", | 2525 "content-type" : "application/json; charset=utf-8", |
| 832 }; | 2526 }; |
| 833 var resp = convert.JSON.encode(buildListClientUsersResponse()); | 2527 var resp = convert.JSON.encode(buildListDealAssociationsResponse()); |
| 834 return new async.Future.value(stringResponse(200, h, resp)); | 2528 return new async.Future.value(stringResponse(200, h, resp)); |
| 835 }), true); | 2529 }), true); |
| 836 res.list(arg_accountId, arg_clientAccountId, pageToken: arg_pageToken, pag
eSize: arg_pageSize).then(unittest.expectAsync(((api.ListClientUsersResponse res
ponse) { | 2530 res.list(arg_accountId, arg_creativeId, pageToken: arg_pageToken, pageSize
: arg_pageSize, query: arg_query).then(unittest.expectAsync(((api.ListDealAssoci
ationsResponse response) { |
| 837 checkListClientUsersResponse(response); | 2531 checkListDealAssociationsResponse(response); |
| 838 }))); | 2532 }))); |
| 839 }); | 2533 }); |
| 840 | 2534 |
| 841 unittest.test("method--update", () { | 2535 unittest.test("method--remove", () { |
| 842 | 2536 |
| 843 var mock = new HttpServerMock(); | 2537 var mock = new HttpServerMock(); |
| 844 api.AccountsClientsUsersResourceApi res = new api.Adexchangebuyer2Api(mock
).accounts.clients.users; | 2538 api.AccountsCreativesDealAssociationsResourceApi res = new api.Adexchangeb
uyer2Api(mock).accounts.creatives.dealAssociations; |
| 845 var arg_request = buildClientUser(); | 2539 var arg_request = buildRemoveDealAssociationRequest(); |
| 846 var arg_accountId = "foo"; | 2540 var arg_accountId = "foo"; |
| 847 var arg_clientAccountId = "foo"; | 2541 var arg_creativeId = "foo"; |
| 848 var arg_userId = "foo"; | |
| 849 mock.register(unittest.expectAsync((http.BaseRequest req, json) { | 2542 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 850 var obj = new api.ClientUser.fromJson(json); | 2543 var obj = new api.RemoveDealAssociationRequest.fromJson(json); |
| 851 checkClientUser(obj); | 2544 checkRemoveDealAssociationRequest(obj); |
| 852 | 2545 |
| 853 var path = (req.url).path; | 2546 var path = (req.url).path; |
| 854 var pathOffset = 0; | 2547 var pathOffset = 0; |
| 855 var index; | 2548 var index; |
| 856 var subPart; | 2549 var subPart; |
| 857 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); | 2550 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 858 pathOffset += 1; | 2551 pathOffset += 1; |
| 859 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); | 2552 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("v2beta1/accounts/")); |
| 860 pathOffset += 17; | 2553 pathOffset += 17; |
| 861 index = path.indexOf("/clients/", pathOffset); | 2554 index = path.indexOf("/creatives/", pathOffset); |
| 862 unittest.expect(index >= 0, unittest.isTrue); | 2555 unittest.expect(index >= 0, unittest.isTrue); |
| 863 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2556 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 864 pathOffset = index; | 2557 pathOffset = index; |
| 865 unittest.expect(subPart, unittest.equals("$arg_accountId")); | 2558 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 866 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/clients/")); | 2559 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/creatives/")); |
| 867 pathOffset += 9; | 2560 pathOffset += 11; |
| 868 index = path.indexOf("/users/", pathOffset); | 2561 index = path.indexOf("/dealAssociations:remove", pathOffset); |
| 869 unittest.expect(index >= 0, unittest.isTrue); | 2562 unittest.expect(index >= 0, unittest.isTrue); |
| 870 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); | 2563 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 871 pathOffset = index; | 2564 pathOffset = index; |
| 872 unittest.expect(subPart, unittest.equals("$arg_clientAccountId")); | 2565 unittest.expect(subPart, unittest.equals("$arg_creativeId")); |
| 873 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/users/")); | 2566 unittest.expect(path.substring(pathOffset, pathOffset + 24), unittest.eq
uals("/dealAssociations:remove")); |
| 874 pathOffset += 7; | 2567 pathOffset += 24; |
| 875 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); | |
| 876 pathOffset = path.length; | |
| 877 unittest.expect(subPart, unittest.equals("$arg_userId")); | |
| 878 | 2568 |
| 879 var query = (req.url).query; | 2569 var query = (req.url).query; |
| 880 var queryOffset = 0; | 2570 var queryOffset = 0; |
| 881 var queryMap = {}; | 2571 var queryMap = {}; |
| 882 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); | 2572 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 883 parseBool(n) { | 2573 parseBool(n) { |
| 884 if (n == "true") return true; | 2574 if (n == "true") return true; |
| 885 if (n == "false") return false; | 2575 if (n == "false") return false; |
| 886 if (n == null) return null; | 2576 if (n == null) return null; |
| 887 throw new core.ArgumentError("Invalid boolean: $n"); | 2577 throw new core.ArgumentError("Invalid boolean: $n"); |
| 888 } | 2578 } |
| 889 if (query.length > 0) { | 2579 if (query.length > 0) { |
| 890 for (var part in query.split("&")) { | 2580 for (var part in query.split("&")) { |
| 891 var keyvalue = part.split("="); | 2581 var keyvalue = part.split("="); |
| 892 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); | 2582 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 893 } | 2583 } |
| 894 } | 2584 } |
| 895 | 2585 |
| 896 | 2586 |
| 897 var h = { | 2587 var h = { |
| 898 "content-type" : "application/json; charset=utf-8", | 2588 "content-type" : "application/json; charset=utf-8", |
| 899 }; | 2589 }; |
| 900 var resp = convert.JSON.encode(buildClientUser()); | 2590 var resp = convert.JSON.encode(buildEmpty()); |
| 901 return new async.Future.value(stringResponse(200, h, resp)); | 2591 return new async.Future.value(stringResponse(200, h, resp)); |
| 902 }), true); | 2592 }), true); |
| 903 res.update(arg_request, arg_accountId, arg_clientAccountId, arg_userId).th
en(unittest.expectAsync(((api.ClientUser response) { | 2593 res.remove(arg_request, arg_accountId, arg_creativeId).then(unittest.expec
tAsync(((api.Empty response) { |
| 904 checkClientUser(response); | 2594 checkEmpty(response); |
| 905 }))); | 2595 }))); |
| 906 }); | 2596 }); |
| 907 | 2597 |
| 908 }); | 2598 }); |
| 909 | 2599 |
| 910 | 2600 |
| 911 } | 2601 } |
| 912 | 2602 |
| OLD | NEW |