OLD | NEW |
(Empty) | |
| 1 library googleapis.analytics.v3.test; |
| 2 |
| 3 import "dart:core" as core; |
| 4 import "dart:collection" as collection; |
| 5 import "dart:async" as async; |
| 6 import "dart:convert" as convert; |
| 7 |
| 8 import 'package:http/http.dart' as http; |
| 9 import 'package:http/testing.dart' as http_testing; |
| 10 import 'package:unittest/unittest.dart' as unittest; |
| 11 import 'package:googleapis/common/common.dart' as common; |
| 12 import 'package:googleapis/src/common_internal.dart' as common_internal; |
| 13 import '../common/common_internal_test.dart' as common_test; |
| 14 |
| 15 import 'package:googleapis/analytics/v3.dart' as api; |
| 16 |
| 17 |
| 18 |
| 19 core.int buildCounterAccountChildLink = 0; |
| 20 buildAccountChildLink() { |
| 21 var o = new api.AccountChildLink(); |
| 22 buildCounterAccountChildLink++; |
| 23 if (buildCounterAccountChildLink < 3) { |
| 24 o.href = "foo"; |
| 25 o.type = "foo"; |
| 26 } |
| 27 buildCounterAccountChildLink--; |
| 28 return o; |
| 29 } |
| 30 |
| 31 checkAccountChildLink(api.AccountChildLink o) { |
| 32 buildCounterAccountChildLink++; |
| 33 if (buildCounterAccountChildLink < 3) { |
| 34 unittest.expect(o.href, unittest.equals('foo')); |
| 35 unittest.expect(o.type, unittest.equals('foo')); |
| 36 } |
| 37 buildCounterAccountChildLink--; |
| 38 } |
| 39 |
| 40 buildUnnamed581() { |
| 41 var o = new core.List<core.String>(); |
| 42 o.add("foo"); |
| 43 o.add("foo"); |
| 44 return o; |
| 45 } |
| 46 |
| 47 checkUnnamed581(core.List<core.String> o) { |
| 48 unittest.expect(o, unittest.hasLength(2)); |
| 49 unittest.expect(o[0], unittest.equals('foo')); |
| 50 unittest.expect(o[1], unittest.equals('foo')); |
| 51 } |
| 52 |
| 53 core.int buildCounterAccountPermissions = 0; |
| 54 buildAccountPermissions() { |
| 55 var o = new api.AccountPermissions(); |
| 56 buildCounterAccountPermissions++; |
| 57 if (buildCounterAccountPermissions < 3) { |
| 58 o.effective = buildUnnamed581(); |
| 59 } |
| 60 buildCounterAccountPermissions--; |
| 61 return o; |
| 62 } |
| 63 |
| 64 checkAccountPermissions(api.AccountPermissions o) { |
| 65 buildCounterAccountPermissions++; |
| 66 if (buildCounterAccountPermissions < 3) { |
| 67 checkUnnamed581(o.effective); |
| 68 } |
| 69 buildCounterAccountPermissions--; |
| 70 } |
| 71 |
| 72 core.int buildCounterAccount = 0; |
| 73 buildAccount() { |
| 74 var o = new api.Account(); |
| 75 buildCounterAccount++; |
| 76 if (buildCounterAccount < 3) { |
| 77 o.childLink = buildAccountChildLink(); |
| 78 o.created = core.DateTime.parse("2002-02-27T14:01:02"); |
| 79 o.id = "foo"; |
| 80 o.kind = "foo"; |
| 81 o.name = "foo"; |
| 82 o.permissions = buildAccountPermissions(); |
| 83 o.selfLink = "foo"; |
| 84 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
| 85 } |
| 86 buildCounterAccount--; |
| 87 return o; |
| 88 } |
| 89 |
| 90 checkAccount(api.Account o) { |
| 91 buildCounterAccount++; |
| 92 if (buildCounterAccount < 3) { |
| 93 checkAccountChildLink(o.childLink); |
| 94 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 95 unittest.expect(o.id, unittest.equals('foo')); |
| 96 unittest.expect(o.kind, unittest.equals('foo')); |
| 97 unittest.expect(o.name, unittest.equals('foo')); |
| 98 checkAccountPermissions(o.permissions); |
| 99 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 100 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 101 } |
| 102 buildCounterAccount--; |
| 103 } |
| 104 |
| 105 core.int buildCounterAccountRef = 0; |
| 106 buildAccountRef() { |
| 107 var o = new api.AccountRef(); |
| 108 buildCounterAccountRef++; |
| 109 if (buildCounterAccountRef < 3) { |
| 110 o.href = "foo"; |
| 111 o.id = "foo"; |
| 112 o.kind = "foo"; |
| 113 o.name = "foo"; |
| 114 } |
| 115 buildCounterAccountRef--; |
| 116 return o; |
| 117 } |
| 118 |
| 119 checkAccountRef(api.AccountRef o) { |
| 120 buildCounterAccountRef++; |
| 121 if (buildCounterAccountRef < 3) { |
| 122 unittest.expect(o.href, unittest.equals('foo')); |
| 123 unittest.expect(o.id, unittest.equals('foo')); |
| 124 unittest.expect(o.kind, unittest.equals('foo')); |
| 125 unittest.expect(o.name, unittest.equals('foo')); |
| 126 } |
| 127 buildCounterAccountRef--; |
| 128 } |
| 129 |
| 130 buildUnnamed582() { |
| 131 var o = new core.List<api.AccountSummary>(); |
| 132 o.add(buildAccountSummary()); |
| 133 o.add(buildAccountSummary()); |
| 134 return o; |
| 135 } |
| 136 |
| 137 checkUnnamed582(core.List<api.AccountSummary> o) { |
| 138 unittest.expect(o, unittest.hasLength(2)); |
| 139 checkAccountSummary(o[0]); |
| 140 checkAccountSummary(o[1]); |
| 141 } |
| 142 |
| 143 core.int buildCounterAccountSummaries = 0; |
| 144 buildAccountSummaries() { |
| 145 var o = new api.AccountSummaries(); |
| 146 buildCounterAccountSummaries++; |
| 147 if (buildCounterAccountSummaries < 3) { |
| 148 o.items = buildUnnamed582(); |
| 149 o.itemsPerPage = 42; |
| 150 o.kind = "foo"; |
| 151 o.nextLink = "foo"; |
| 152 o.previousLink = "foo"; |
| 153 o.startIndex = 42; |
| 154 o.totalResults = 42; |
| 155 o.username = "foo"; |
| 156 } |
| 157 buildCounterAccountSummaries--; |
| 158 return o; |
| 159 } |
| 160 |
| 161 checkAccountSummaries(api.AccountSummaries o) { |
| 162 buildCounterAccountSummaries++; |
| 163 if (buildCounterAccountSummaries < 3) { |
| 164 checkUnnamed582(o.items); |
| 165 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 166 unittest.expect(o.kind, unittest.equals('foo')); |
| 167 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 168 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 169 unittest.expect(o.startIndex, unittest.equals(42)); |
| 170 unittest.expect(o.totalResults, unittest.equals(42)); |
| 171 unittest.expect(o.username, unittest.equals('foo')); |
| 172 } |
| 173 buildCounterAccountSummaries--; |
| 174 } |
| 175 |
| 176 buildUnnamed583() { |
| 177 var o = new core.List<api.WebPropertySummary>(); |
| 178 o.add(buildWebPropertySummary()); |
| 179 o.add(buildWebPropertySummary()); |
| 180 return o; |
| 181 } |
| 182 |
| 183 checkUnnamed583(core.List<api.WebPropertySummary> o) { |
| 184 unittest.expect(o, unittest.hasLength(2)); |
| 185 checkWebPropertySummary(o[0]); |
| 186 checkWebPropertySummary(o[1]); |
| 187 } |
| 188 |
| 189 core.int buildCounterAccountSummary = 0; |
| 190 buildAccountSummary() { |
| 191 var o = new api.AccountSummary(); |
| 192 buildCounterAccountSummary++; |
| 193 if (buildCounterAccountSummary < 3) { |
| 194 o.id = "foo"; |
| 195 o.kind = "foo"; |
| 196 o.name = "foo"; |
| 197 o.webProperties = buildUnnamed583(); |
| 198 } |
| 199 buildCounterAccountSummary--; |
| 200 return o; |
| 201 } |
| 202 |
| 203 checkAccountSummary(api.AccountSummary o) { |
| 204 buildCounterAccountSummary++; |
| 205 if (buildCounterAccountSummary < 3) { |
| 206 unittest.expect(o.id, unittest.equals('foo')); |
| 207 unittest.expect(o.kind, unittest.equals('foo')); |
| 208 unittest.expect(o.name, unittest.equals('foo')); |
| 209 checkUnnamed583(o.webProperties); |
| 210 } |
| 211 buildCounterAccountSummary--; |
| 212 } |
| 213 |
| 214 core.int buildCounterAccountTicket = 0; |
| 215 buildAccountTicket() { |
| 216 var o = new api.AccountTicket(); |
| 217 buildCounterAccountTicket++; |
| 218 if (buildCounterAccountTicket < 3) { |
| 219 o.account = buildAccount(); |
| 220 o.id = "foo"; |
| 221 o.kind = "foo"; |
| 222 o.profile = buildProfile(); |
| 223 o.redirectUri = "foo"; |
| 224 o.webproperty = buildWebproperty(); |
| 225 } |
| 226 buildCounterAccountTicket--; |
| 227 return o; |
| 228 } |
| 229 |
| 230 checkAccountTicket(api.AccountTicket o) { |
| 231 buildCounterAccountTicket++; |
| 232 if (buildCounterAccountTicket < 3) { |
| 233 checkAccount(o.account); |
| 234 unittest.expect(o.id, unittest.equals('foo')); |
| 235 unittest.expect(o.kind, unittest.equals('foo')); |
| 236 checkProfile(o.profile); |
| 237 unittest.expect(o.redirectUri, unittest.equals('foo')); |
| 238 checkWebproperty(o.webproperty); |
| 239 } |
| 240 buildCounterAccountTicket--; |
| 241 } |
| 242 |
| 243 buildUnnamed584() { |
| 244 var o = new core.List<api.Account>(); |
| 245 o.add(buildAccount()); |
| 246 o.add(buildAccount()); |
| 247 return o; |
| 248 } |
| 249 |
| 250 checkUnnamed584(core.List<api.Account> o) { |
| 251 unittest.expect(o, unittest.hasLength(2)); |
| 252 checkAccount(o[0]); |
| 253 checkAccount(o[1]); |
| 254 } |
| 255 |
| 256 core.int buildCounterAccounts = 0; |
| 257 buildAccounts() { |
| 258 var o = new api.Accounts(); |
| 259 buildCounterAccounts++; |
| 260 if (buildCounterAccounts < 3) { |
| 261 o.items = buildUnnamed584(); |
| 262 o.itemsPerPage = 42; |
| 263 o.kind = "foo"; |
| 264 o.nextLink = "foo"; |
| 265 o.previousLink = "foo"; |
| 266 o.startIndex = 42; |
| 267 o.totalResults = 42; |
| 268 o.username = "foo"; |
| 269 } |
| 270 buildCounterAccounts--; |
| 271 return o; |
| 272 } |
| 273 |
| 274 checkAccounts(api.Accounts o) { |
| 275 buildCounterAccounts++; |
| 276 if (buildCounterAccounts < 3) { |
| 277 checkUnnamed584(o.items); |
| 278 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 279 unittest.expect(o.kind, unittest.equals('foo')); |
| 280 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 281 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 282 unittest.expect(o.startIndex, unittest.equals(42)); |
| 283 unittest.expect(o.totalResults, unittest.equals(42)); |
| 284 unittest.expect(o.username, unittest.equals('foo')); |
| 285 } |
| 286 buildCounterAccounts--; |
| 287 } |
| 288 |
| 289 core.int buildCounterAdWordsAccount = 0; |
| 290 buildAdWordsAccount() { |
| 291 var o = new api.AdWordsAccount(); |
| 292 buildCounterAdWordsAccount++; |
| 293 if (buildCounterAdWordsAccount < 3) { |
| 294 o.autoTaggingEnabled = true; |
| 295 o.customerId = "foo"; |
| 296 o.kind = "foo"; |
| 297 } |
| 298 buildCounterAdWordsAccount--; |
| 299 return o; |
| 300 } |
| 301 |
| 302 checkAdWordsAccount(api.AdWordsAccount o) { |
| 303 buildCounterAdWordsAccount++; |
| 304 if (buildCounterAdWordsAccount < 3) { |
| 305 unittest.expect(o.autoTaggingEnabled, unittest.isTrue); |
| 306 unittest.expect(o.customerId, unittest.equals('foo')); |
| 307 unittest.expect(o.kind, unittest.equals('foo')); |
| 308 } |
| 309 buildCounterAdWordsAccount--; |
| 310 } |
| 311 |
| 312 buildUnnamed585() { |
| 313 var o = new core.List<core.String>(); |
| 314 o.add("foo"); |
| 315 o.add("foo"); |
| 316 return o; |
| 317 } |
| 318 |
| 319 checkUnnamed585(core.List<core.String> o) { |
| 320 unittest.expect(o, unittest.hasLength(2)); |
| 321 unittest.expect(o[0], unittest.equals('foo')); |
| 322 unittest.expect(o[1], unittest.equals('foo')); |
| 323 } |
| 324 |
| 325 core.int buildCounterAnalyticsDataimportDeleteUploadDataRequest = 0; |
| 326 buildAnalyticsDataimportDeleteUploadDataRequest() { |
| 327 var o = new api.AnalyticsDataimportDeleteUploadDataRequest(); |
| 328 buildCounterAnalyticsDataimportDeleteUploadDataRequest++; |
| 329 if (buildCounterAnalyticsDataimportDeleteUploadDataRequest < 3) { |
| 330 o.customDataImportUids = buildUnnamed585(); |
| 331 } |
| 332 buildCounterAnalyticsDataimportDeleteUploadDataRequest--; |
| 333 return o; |
| 334 } |
| 335 |
| 336 checkAnalyticsDataimportDeleteUploadDataRequest(api.AnalyticsDataimportDeleteUpl
oadDataRequest o) { |
| 337 buildCounterAnalyticsDataimportDeleteUploadDataRequest++; |
| 338 if (buildCounterAnalyticsDataimportDeleteUploadDataRequest < 3) { |
| 339 checkUnnamed585(o.customDataImportUids); |
| 340 } |
| 341 buildCounterAnalyticsDataimportDeleteUploadDataRequest--; |
| 342 } |
| 343 |
| 344 buildUnnamed586() { |
| 345 var o = new core.Map<core.String, core.String>(); |
| 346 o["x"] = "foo"; |
| 347 o["y"] = "foo"; |
| 348 return o; |
| 349 } |
| 350 |
| 351 checkUnnamed586(core.Map<core.String, core.String> o) { |
| 352 unittest.expect(o, unittest.hasLength(2)); |
| 353 unittest.expect(o["x"], unittest.equals('foo')); |
| 354 unittest.expect(o["y"], unittest.equals('foo')); |
| 355 } |
| 356 |
| 357 core.int buildCounterColumn = 0; |
| 358 buildColumn() { |
| 359 var o = new api.Column(); |
| 360 buildCounterColumn++; |
| 361 if (buildCounterColumn < 3) { |
| 362 o.attributes = buildUnnamed586(); |
| 363 o.id = "foo"; |
| 364 o.kind = "foo"; |
| 365 } |
| 366 buildCounterColumn--; |
| 367 return o; |
| 368 } |
| 369 |
| 370 checkColumn(api.Column o) { |
| 371 buildCounterColumn++; |
| 372 if (buildCounterColumn < 3) { |
| 373 checkUnnamed586(o.attributes); |
| 374 unittest.expect(o.id, unittest.equals('foo')); |
| 375 unittest.expect(o.kind, unittest.equals('foo')); |
| 376 } |
| 377 buildCounterColumn--; |
| 378 } |
| 379 |
| 380 buildUnnamed587() { |
| 381 var o = new core.List<core.String>(); |
| 382 o.add("foo"); |
| 383 o.add("foo"); |
| 384 return o; |
| 385 } |
| 386 |
| 387 checkUnnamed587(core.List<core.String> o) { |
| 388 unittest.expect(o, unittest.hasLength(2)); |
| 389 unittest.expect(o[0], unittest.equals('foo')); |
| 390 unittest.expect(o[1], unittest.equals('foo')); |
| 391 } |
| 392 |
| 393 buildUnnamed588() { |
| 394 var o = new core.List<api.Column>(); |
| 395 o.add(buildColumn()); |
| 396 o.add(buildColumn()); |
| 397 return o; |
| 398 } |
| 399 |
| 400 checkUnnamed588(core.List<api.Column> o) { |
| 401 unittest.expect(o, unittest.hasLength(2)); |
| 402 checkColumn(o[0]); |
| 403 checkColumn(o[1]); |
| 404 } |
| 405 |
| 406 core.int buildCounterColumns = 0; |
| 407 buildColumns() { |
| 408 var o = new api.Columns(); |
| 409 buildCounterColumns++; |
| 410 if (buildCounterColumns < 3) { |
| 411 o.attributeNames = buildUnnamed587(); |
| 412 o.etag = "foo"; |
| 413 o.items = buildUnnamed588(); |
| 414 o.kind = "foo"; |
| 415 o.totalResults = 42; |
| 416 } |
| 417 buildCounterColumns--; |
| 418 return o; |
| 419 } |
| 420 |
| 421 checkColumns(api.Columns o) { |
| 422 buildCounterColumns++; |
| 423 if (buildCounterColumns < 3) { |
| 424 checkUnnamed587(o.attributeNames); |
| 425 unittest.expect(o.etag, unittest.equals('foo')); |
| 426 checkUnnamed588(o.items); |
| 427 unittest.expect(o.kind, unittest.equals('foo')); |
| 428 unittest.expect(o.totalResults, unittest.equals(42)); |
| 429 } |
| 430 buildCounterColumns--; |
| 431 } |
| 432 |
| 433 core.int buildCounterCustomDataSourceChildLink = 0; |
| 434 buildCustomDataSourceChildLink() { |
| 435 var o = new api.CustomDataSourceChildLink(); |
| 436 buildCounterCustomDataSourceChildLink++; |
| 437 if (buildCounterCustomDataSourceChildLink < 3) { |
| 438 o.href = "foo"; |
| 439 o.type = "foo"; |
| 440 } |
| 441 buildCounterCustomDataSourceChildLink--; |
| 442 return o; |
| 443 } |
| 444 |
| 445 checkCustomDataSourceChildLink(api.CustomDataSourceChildLink o) { |
| 446 buildCounterCustomDataSourceChildLink++; |
| 447 if (buildCounterCustomDataSourceChildLink < 3) { |
| 448 unittest.expect(o.href, unittest.equals('foo')); |
| 449 unittest.expect(o.type, unittest.equals('foo')); |
| 450 } |
| 451 buildCounterCustomDataSourceChildLink--; |
| 452 } |
| 453 |
| 454 core.int buildCounterCustomDataSourceParentLink = 0; |
| 455 buildCustomDataSourceParentLink() { |
| 456 var o = new api.CustomDataSourceParentLink(); |
| 457 buildCounterCustomDataSourceParentLink++; |
| 458 if (buildCounterCustomDataSourceParentLink < 3) { |
| 459 o.href = "foo"; |
| 460 o.type = "foo"; |
| 461 } |
| 462 buildCounterCustomDataSourceParentLink--; |
| 463 return o; |
| 464 } |
| 465 |
| 466 checkCustomDataSourceParentLink(api.CustomDataSourceParentLink o) { |
| 467 buildCounterCustomDataSourceParentLink++; |
| 468 if (buildCounterCustomDataSourceParentLink < 3) { |
| 469 unittest.expect(o.href, unittest.equals('foo')); |
| 470 unittest.expect(o.type, unittest.equals('foo')); |
| 471 } |
| 472 buildCounterCustomDataSourceParentLink--; |
| 473 } |
| 474 |
| 475 buildUnnamed589() { |
| 476 var o = new core.List<core.String>(); |
| 477 o.add("foo"); |
| 478 o.add("foo"); |
| 479 return o; |
| 480 } |
| 481 |
| 482 checkUnnamed589(core.List<core.String> o) { |
| 483 unittest.expect(o, unittest.hasLength(2)); |
| 484 unittest.expect(o[0], unittest.equals('foo')); |
| 485 unittest.expect(o[1], unittest.equals('foo')); |
| 486 } |
| 487 |
| 488 core.int buildCounterCustomDataSource = 0; |
| 489 buildCustomDataSource() { |
| 490 var o = new api.CustomDataSource(); |
| 491 buildCounterCustomDataSource++; |
| 492 if (buildCounterCustomDataSource < 3) { |
| 493 o.accountId = "foo"; |
| 494 o.childLink = buildCustomDataSourceChildLink(); |
| 495 o.created = core.DateTime.parse("2002-02-27T14:01:02"); |
| 496 o.description = "foo"; |
| 497 o.id = "foo"; |
| 498 o.importBehavior = "foo"; |
| 499 o.kind = "foo"; |
| 500 o.name = "foo"; |
| 501 o.parentLink = buildCustomDataSourceParentLink(); |
| 502 o.profilesLinked = buildUnnamed589(); |
| 503 o.selfLink = "foo"; |
| 504 o.type = "foo"; |
| 505 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
| 506 o.uploadType = "foo"; |
| 507 o.webPropertyId = "foo"; |
| 508 } |
| 509 buildCounterCustomDataSource--; |
| 510 return o; |
| 511 } |
| 512 |
| 513 checkCustomDataSource(api.CustomDataSource o) { |
| 514 buildCounterCustomDataSource++; |
| 515 if (buildCounterCustomDataSource < 3) { |
| 516 unittest.expect(o.accountId, unittest.equals('foo')); |
| 517 checkCustomDataSourceChildLink(o.childLink); |
| 518 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 519 unittest.expect(o.description, unittest.equals('foo')); |
| 520 unittest.expect(o.id, unittest.equals('foo')); |
| 521 unittest.expect(o.importBehavior, unittest.equals('foo')); |
| 522 unittest.expect(o.kind, unittest.equals('foo')); |
| 523 unittest.expect(o.name, unittest.equals('foo')); |
| 524 checkCustomDataSourceParentLink(o.parentLink); |
| 525 checkUnnamed589(o.profilesLinked); |
| 526 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 527 unittest.expect(o.type, unittest.equals('foo')); |
| 528 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 529 unittest.expect(o.uploadType, unittest.equals('foo')); |
| 530 unittest.expect(o.webPropertyId, unittest.equals('foo')); |
| 531 } |
| 532 buildCounterCustomDataSource--; |
| 533 } |
| 534 |
| 535 buildUnnamed590() { |
| 536 var o = new core.List<api.CustomDataSource>(); |
| 537 o.add(buildCustomDataSource()); |
| 538 o.add(buildCustomDataSource()); |
| 539 return o; |
| 540 } |
| 541 |
| 542 checkUnnamed590(core.List<api.CustomDataSource> o) { |
| 543 unittest.expect(o, unittest.hasLength(2)); |
| 544 checkCustomDataSource(o[0]); |
| 545 checkCustomDataSource(o[1]); |
| 546 } |
| 547 |
| 548 core.int buildCounterCustomDataSources = 0; |
| 549 buildCustomDataSources() { |
| 550 var o = new api.CustomDataSources(); |
| 551 buildCounterCustomDataSources++; |
| 552 if (buildCounterCustomDataSources < 3) { |
| 553 o.items = buildUnnamed590(); |
| 554 o.itemsPerPage = 42; |
| 555 o.kind = "foo"; |
| 556 o.nextLink = "foo"; |
| 557 o.previousLink = "foo"; |
| 558 o.startIndex = 42; |
| 559 o.totalResults = 42; |
| 560 o.username = "foo"; |
| 561 } |
| 562 buildCounterCustomDataSources--; |
| 563 return o; |
| 564 } |
| 565 |
| 566 checkCustomDataSources(api.CustomDataSources o) { |
| 567 buildCounterCustomDataSources++; |
| 568 if (buildCounterCustomDataSources < 3) { |
| 569 checkUnnamed590(o.items); |
| 570 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 571 unittest.expect(o.kind, unittest.equals('foo')); |
| 572 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 573 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 574 unittest.expect(o.startIndex, unittest.equals(42)); |
| 575 unittest.expect(o.totalResults, unittest.equals(42)); |
| 576 unittest.expect(o.username, unittest.equals('foo')); |
| 577 } |
| 578 buildCounterCustomDataSources--; |
| 579 } |
| 580 |
| 581 core.int buildCounterDailyUploadParentLink = 0; |
| 582 buildDailyUploadParentLink() { |
| 583 var o = new api.DailyUploadParentLink(); |
| 584 buildCounterDailyUploadParentLink++; |
| 585 if (buildCounterDailyUploadParentLink < 3) { |
| 586 o.href = "foo"; |
| 587 o.type = "foo"; |
| 588 } |
| 589 buildCounterDailyUploadParentLink--; |
| 590 return o; |
| 591 } |
| 592 |
| 593 checkDailyUploadParentLink(api.DailyUploadParentLink o) { |
| 594 buildCounterDailyUploadParentLink++; |
| 595 if (buildCounterDailyUploadParentLink < 3) { |
| 596 unittest.expect(o.href, unittest.equals('foo')); |
| 597 unittest.expect(o.type, unittest.equals('foo')); |
| 598 } |
| 599 buildCounterDailyUploadParentLink--; |
| 600 } |
| 601 |
| 602 core.int buildCounterDailyUploadRecentChanges = 0; |
| 603 buildDailyUploadRecentChanges() { |
| 604 var o = new api.DailyUploadRecentChanges(); |
| 605 buildCounterDailyUploadRecentChanges++; |
| 606 if (buildCounterDailyUploadRecentChanges < 3) { |
| 607 o.change = "foo"; |
| 608 o.time = core.DateTime.parse("2002-02-27T14:01:02"); |
| 609 } |
| 610 buildCounterDailyUploadRecentChanges--; |
| 611 return o; |
| 612 } |
| 613 |
| 614 checkDailyUploadRecentChanges(api.DailyUploadRecentChanges o) { |
| 615 buildCounterDailyUploadRecentChanges++; |
| 616 if (buildCounterDailyUploadRecentChanges < 3) { |
| 617 unittest.expect(o.change, unittest.equals('foo')); |
| 618 unittest.expect(o.time, unittest.equals(core.DateTime.parse("2002-02-27T14:0
1:02"))); |
| 619 } |
| 620 buildCounterDailyUploadRecentChanges--; |
| 621 } |
| 622 |
| 623 buildUnnamed591() { |
| 624 var o = new core.List<api.DailyUploadRecentChanges>(); |
| 625 o.add(buildDailyUploadRecentChanges()); |
| 626 o.add(buildDailyUploadRecentChanges()); |
| 627 return o; |
| 628 } |
| 629 |
| 630 checkUnnamed591(core.List<api.DailyUploadRecentChanges> o) { |
| 631 unittest.expect(o, unittest.hasLength(2)); |
| 632 checkDailyUploadRecentChanges(o[0]); |
| 633 checkDailyUploadRecentChanges(o[1]); |
| 634 } |
| 635 |
| 636 core.int buildCounterDailyUpload = 0; |
| 637 buildDailyUpload() { |
| 638 var o = new api.DailyUpload(); |
| 639 buildCounterDailyUpload++; |
| 640 if (buildCounterDailyUpload < 3) { |
| 641 o.accountId = "foo"; |
| 642 o.appendCount = 42; |
| 643 o.createdTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 644 o.customDataSourceId = "foo"; |
| 645 o.date = "foo"; |
| 646 o.kind = "foo"; |
| 647 o.modifiedTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 648 o.parentLink = buildDailyUploadParentLink(); |
| 649 o.recentChanges = buildUnnamed591(); |
| 650 o.selfLink = "foo"; |
| 651 o.webPropertyId = "foo"; |
| 652 } |
| 653 buildCounterDailyUpload--; |
| 654 return o; |
| 655 } |
| 656 |
| 657 checkDailyUpload(api.DailyUpload o) { |
| 658 buildCounterDailyUpload++; |
| 659 if (buildCounterDailyUpload < 3) { |
| 660 unittest.expect(o.accountId, unittest.equals('foo')); |
| 661 unittest.expect(o.appendCount, unittest.equals(42)); |
| 662 unittest.expect(o.createdTime, unittest.equals(core.DateTime.parse("2002-02-
27T14:01:02"))); |
| 663 unittest.expect(o.customDataSourceId, unittest.equals('foo')); |
| 664 unittest.expect(o.date, unittest.equals('foo')); |
| 665 unittest.expect(o.kind, unittest.equals('foo')); |
| 666 unittest.expect(o.modifiedTime, unittest.equals(core.DateTime.parse("2002-02
-27T14:01:02"))); |
| 667 checkDailyUploadParentLink(o.parentLink); |
| 668 checkUnnamed591(o.recentChanges); |
| 669 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 670 unittest.expect(o.webPropertyId, unittest.equals('foo')); |
| 671 } |
| 672 buildCounterDailyUpload--; |
| 673 } |
| 674 |
| 675 core.int buildCounterDailyUploadAppend = 0; |
| 676 buildDailyUploadAppend() { |
| 677 var o = new api.DailyUploadAppend(); |
| 678 buildCounterDailyUploadAppend++; |
| 679 if (buildCounterDailyUploadAppend < 3) { |
| 680 o.accountId = "foo"; |
| 681 o.appendNumber = 42; |
| 682 o.customDataSourceId = "foo"; |
| 683 o.date = "foo"; |
| 684 o.kind = "foo"; |
| 685 o.nextAppendLink = "foo"; |
| 686 o.webPropertyId = "foo"; |
| 687 } |
| 688 buildCounterDailyUploadAppend--; |
| 689 return o; |
| 690 } |
| 691 |
| 692 checkDailyUploadAppend(api.DailyUploadAppend o) { |
| 693 buildCounterDailyUploadAppend++; |
| 694 if (buildCounterDailyUploadAppend < 3) { |
| 695 unittest.expect(o.accountId, unittest.equals('foo')); |
| 696 unittest.expect(o.appendNumber, unittest.equals(42)); |
| 697 unittest.expect(o.customDataSourceId, unittest.equals('foo')); |
| 698 unittest.expect(o.date, unittest.equals('foo')); |
| 699 unittest.expect(o.kind, unittest.equals('foo')); |
| 700 unittest.expect(o.nextAppendLink, unittest.equals('foo')); |
| 701 unittest.expect(o.webPropertyId, unittest.equals('foo')); |
| 702 } |
| 703 buildCounterDailyUploadAppend--; |
| 704 } |
| 705 |
| 706 buildUnnamed592() { |
| 707 var o = new core.List<api.DailyUpload>(); |
| 708 o.add(buildDailyUpload()); |
| 709 o.add(buildDailyUpload()); |
| 710 return o; |
| 711 } |
| 712 |
| 713 checkUnnamed592(core.List<api.DailyUpload> o) { |
| 714 unittest.expect(o, unittest.hasLength(2)); |
| 715 checkDailyUpload(o[0]); |
| 716 checkDailyUpload(o[1]); |
| 717 } |
| 718 |
| 719 core.int buildCounterDailyUploads = 0; |
| 720 buildDailyUploads() { |
| 721 var o = new api.DailyUploads(); |
| 722 buildCounterDailyUploads++; |
| 723 if (buildCounterDailyUploads < 3) { |
| 724 o.items = buildUnnamed592(); |
| 725 o.itemsPerPage = 42; |
| 726 o.kind = "foo"; |
| 727 o.nextLink = "foo"; |
| 728 o.previousLink = "foo"; |
| 729 o.startIndex = 42; |
| 730 o.totalResults = 42; |
| 731 o.username = "foo"; |
| 732 } |
| 733 buildCounterDailyUploads--; |
| 734 return o; |
| 735 } |
| 736 |
| 737 checkDailyUploads(api.DailyUploads o) { |
| 738 buildCounterDailyUploads++; |
| 739 if (buildCounterDailyUploads < 3) { |
| 740 checkUnnamed592(o.items); |
| 741 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 742 unittest.expect(o.kind, unittest.equals('foo')); |
| 743 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 744 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 745 unittest.expect(o.startIndex, unittest.equals(42)); |
| 746 unittest.expect(o.totalResults, unittest.equals(42)); |
| 747 unittest.expect(o.username, unittest.equals('foo')); |
| 748 } |
| 749 buildCounterDailyUploads--; |
| 750 } |
| 751 |
| 752 buildUnnamed593() { |
| 753 var o = new core.List<api.AdWordsAccount>(); |
| 754 o.add(buildAdWordsAccount()); |
| 755 o.add(buildAdWordsAccount()); |
| 756 return o; |
| 757 } |
| 758 |
| 759 checkUnnamed593(core.List<api.AdWordsAccount> o) { |
| 760 unittest.expect(o, unittest.hasLength(2)); |
| 761 checkAdWordsAccount(o[0]); |
| 762 checkAdWordsAccount(o[1]); |
| 763 } |
| 764 |
| 765 core.int buildCounterEntityAdWordsLinkEntity = 0; |
| 766 buildEntityAdWordsLinkEntity() { |
| 767 var o = new api.EntityAdWordsLinkEntity(); |
| 768 buildCounterEntityAdWordsLinkEntity++; |
| 769 if (buildCounterEntityAdWordsLinkEntity < 3) { |
| 770 o.webPropertyRef = buildWebPropertyRef(); |
| 771 } |
| 772 buildCounterEntityAdWordsLinkEntity--; |
| 773 return o; |
| 774 } |
| 775 |
| 776 checkEntityAdWordsLinkEntity(api.EntityAdWordsLinkEntity o) { |
| 777 buildCounterEntityAdWordsLinkEntity++; |
| 778 if (buildCounterEntityAdWordsLinkEntity < 3) { |
| 779 checkWebPropertyRef(o.webPropertyRef); |
| 780 } |
| 781 buildCounterEntityAdWordsLinkEntity--; |
| 782 } |
| 783 |
| 784 buildUnnamed594() { |
| 785 var o = new core.List<core.String>(); |
| 786 o.add("foo"); |
| 787 o.add("foo"); |
| 788 return o; |
| 789 } |
| 790 |
| 791 checkUnnamed594(core.List<core.String> o) { |
| 792 unittest.expect(o, unittest.hasLength(2)); |
| 793 unittest.expect(o[0], unittest.equals('foo')); |
| 794 unittest.expect(o[1], unittest.equals('foo')); |
| 795 } |
| 796 |
| 797 core.int buildCounterEntityAdWordsLink = 0; |
| 798 buildEntityAdWordsLink() { |
| 799 var o = new api.EntityAdWordsLink(); |
| 800 buildCounterEntityAdWordsLink++; |
| 801 if (buildCounterEntityAdWordsLink < 3) { |
| 802 o.adWordsAccounts = buildUnnamed593(); |
| 803 o.entity = buildEntityAdWordsLinkEntity(); |
| 804 o.id = "foo"; |
| 805 o.kind = "foo"; |
| 806 o.name = "foo"; |
| 807 o.profileIds = buildUnnamed594(); |
| 808 o.selfLink = "foo"; |
| 809 } |
| 810 buildCounterEntityAdWordsLink--; |
| 811 return o; |
| 812 } |
| 813 |
| 814 checkEntityAdWordsLink(api.EntityAdWordsLink o) { |
| 815 buildCounterEntityAdWordsLink++; |
| 816 if (buildCounterEntityAdWordsLink < 3) { |
| 817 checkUnnamed593(o.adWordsAccounts); |
| 818 checkEntityAdWordsLinkEntity(o.entity); |
| 819 unittest.expect(o.id, unittest.equals('foo')); |
| 820 unittest.expect(o.kind, unittest.equals('foo')); |
| 821 unittest.expect(o.name, unittest.equals('foo')); |
| 822 checkUnnamed594(o.profileIds); |
| 823 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 824 } |
| 825 buildCounterEntityAdWordsLink--; |
| 826 } |
| 827 |
| 828 buildUnnamed595() { |
| 829 var o = new core.List<api.EntityAdWordsLink>(); |
| 830 o.add(buildEntityAdWordsLink()); |
| 831 o.add(buildEntityAdWordsLink()); |
| 832 return o; |
| 833 } |
| 834 |
| 835 checkUnnamed595(core.List<api.EntityAdWordsLink> o) { |
| 836 unittest.expect(o, unittest.hasLength(2)); |
| 837 checkEntityAdWordsLink(o[0]); |
| 838 checkEntityAdWordsLink(o[1]); |
| 839 } |
| 840 |
| 841 core.int buildCounterEntityAdWordsLinks = 0; |
| 842 buildEntityAdWordsLinks() { |
| 843 var o = new api.EntityAdWordsLinks(); |
| 844 buildCounterEntityAdWordsLinks++; |
| 845 if (buildCounterEntityAdWordsLinks < 3) { |
| 846 o.items = buildUnnamed595(); |
| 847 o.itemsPerPage = 42; |
| 848 o.kind = "foo"; |
| 849 o.nextLink = "foo"; |
| 850 o.previousLink = "foo"; |
| 851 o.startIndex = 42; |
| 852 o.totalResults = 42; |
| 853 } |
| 854 buildCounterEntityAdWordsLinks--; |
| 855 return o; |
| 856 } |
| 857 |
| 858 checkEntityAdWordsLinks(api.EntityAdWordsLinks o) { |
| 859 buildCounterEntityAdWordsLinks++; |
| 860 if (buildCounterEntityAdWordsLinks < 3) { |
| 861 checkUnnamed595(o.items); |
| 862 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 863 unittest.expect(o.kind, unittest.equals('foo')); |
| 864 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 865 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 866 unittest.expect(o.startIndex, unittest.equals(42)); |
| 867 unittest.expect(o.totalResults, unittest.equals(42)); |
| 868 } |
| 869 buildCounterEntityAdWordsLinks--; |
| 870 } |
| 871 |
| 872 core.int buildCounterEntityUserLinkEntity = 0; |
| 873 buildEntityUserLinkEntity() { |
| 874 var o = new api.EntityUserLinkEntity(); |
| 875 buildCounterEntityUserLinkEntity++; |
| 876 if (buildCounterEntityUserLinkEntity < 3) { |
| 877 o.accountRef = buildAccountRef(); |
| 878 o.profileRef = buildProfileRef(); |
| 879 o.webPropertyRef = buildWebPropertyRef(); |
| 880 } |
| 881 buildCounterEntityUserLinkEntity--; |
| 882 return o; |
| 883 } |
| 884 |
| 885 checkEntityUserLinkEntity(api.EntityUserLinkEntity o) { |
| 886 buildCounterEntityUserLinkEntity++; |
| 887 if (buildCounterEntityUserLinkEntity < 3) { |
| 888 checkAccountRef(o.accountRef); |
| 889 checkProfileRef(o.profileRef); |
| 890 checkWebPropertyRef(o.webPropertyRef); |
| 891 } |
| 892 buildCounterEntityUserLinkEntity--; |
| 893 } |
| 894 |
| 895 buildUnnamed596() { |
| 896 var o = new core.List<core.String>(); |
| 897 o.add("foo"); |
| 898 o.add("foo"); |
| 899 return o; |
| 900 } |
| 901 |
| 902 checkUnnamed596(core.List<core.String> o) { |
| 903 unittest.expect(o, unittest.hasLength(2)); |
| 904 unittest.expect(o[0], unittest.equals('foo')); |
| 905 unittest.expect(o[1], unittest.equals('foo')); |
| 906 } |
| 907 |
| 908 buildUnnamed597() { |
| 909 var o = new core.List<core.String>(); |
| 910 o.add("foo"); |
| 911 o.add("foo"); |
| 912 return o; |
| 913 } |
| 914 |
| 915 checkUnnamed597(core.List<core.String> o) { |
| 916 unittest.expect(o, unittest.hasLength(2)); |
| 917 unittest.expect(o[0], unittest.equals('foo')); |
| 918 unittest.expect(o[1], unittest.equals('foo')); |
| 919 } |
| 920 |
| 921 core.int buildCounterEntityUserLinkPermissions = 0; |
| 922 buildEntityUserLinkPermissions() { |
| 923 var o = new api.EntityUserLinkPermissions(); |
| 924 buildCounterEntityUserLinkPermissions++; |
| 925 if (buildCounterEntityUserLinkPermissions < 3) { |
| 926 o.effective = buildUnnamed596(); |
| 927 o.local = buildUnnamed597(); |
| 928 } |
| 929 buildCounterEntityUserLinkPermissions--; |
| 930 return o; |
| 931 } |
| 932 |
| 933 checkEntityUserLinkPermissions(api.EntityUserLinkPermissions o) { |
| 934 buildCounterEntityUserLinkPermissions++; |
| 935 if (buildCounterEntityUserLinkPermissions < 3) { |
| 936 checkUnnamed596(o.effective); |
| 937 checkUnnamed597(o.local); |
| 938 } |
| 939 buildCounterEntityUserLinkPermissions--; |
| 940 } |
| 941 |
| 942 core.int buildCounterEntityUserLink = 0; |
| 943 buildEntityUserLink() { |
| 944 var o = new api.EntityUserLink(); |
| 945 buildCounterEntityUserLink++; |
| 946 if (buildCounterEntityUserLink < 3) { |
| 947 o.entity = buildEntityUserLinkEntity(); |
| 948 o.id = "foo"; |
| 949 o.kind = "foo"; |
| 950 o.permissions = buildEntityUserLinkPermissions(); |
| 951 o.selfLink = "foo"; |
| 952 o.userRef = buildUserRef(); |
| 953 } |
| 954 buildCounterEntityUserLink--; |
| 955 return o; |
| 956 } |
| 957 |
| 958 checkEntityUserLink(api.EntityUserLink o) { |
| 959 buildCounterEntityUserLink++; |
| 960 if (buildCounterEntityUserLink < 3) { |
| 961 checkEntityUserLinkEntity(o.entity); |
| 962 unittest.expect(o.id, unittest.equals('foo')); |
| 963 unittest.expect(o.kind, unittest.equals('foo')); |
| 964 checkEntityUserLinkPermissions(o.permissions); |
| 965 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 966 checkUserRef(o.userRef); |
| 967 } |
| 968 buildCounterEntityUserLink--; |
| 969 } |
| 970 |
| 971 buildUnnamed598() { |
| 972 var o = new core.List<api.EntityUserLink>(); |
| 973 o.add(buildEntityUserLink()); |
| 974 o.add(buildEntityUserLink()); |
| 975 return o; |
| 976 } |
| 977 |
| 978 checkUnnamed598(core.List<api.EntityUserLink> o) { |
| 979 unittest.expect(o, unittest.hasLength(2)); |
| 980 checkEntityUserLink(o[0]); |
| 981 checkEntityUserLink(o[1]); |
| 982 } |
| 983 |
| 984 core.int buildCounterEntityUserLinks = 0; |
| 985 buildEntityUserLinks() { |
| 986 var o = new api.EntityUserLinks(); |
| 987 buildCounterEntityUserLinks++; |
| 988 if (buildCounterEntityUserLinks < 3) { |
| 989 o.items = buildUnnamed598(); |
| 990 o.itemsPerPage = 42; |
| 991 o.kind = "foo"; |
| 992 o.nextLink = "foo"; |
| 993 o.previousLink = "foo"; |
| 994 o.startIndex = 42; |
| 995 o.totalResults = 42; |
| 996 } |
| 997 buildCounterEntityUserLinks--; |
| 998 return o; |
| 999 } |
| 1000 |
| 1001 checkEntityUserLinks(api.EntityUserLinks o) { |
| 1002 buildCounterEntityUserLinks++; |
| 1003 if (buildCounterEntityUserLinks < 3) { |
| 1004 checkUnnamed598(o.items); |
| 1005 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 1006 unittest.expect(o.kind, unittest.equals('foo')); |
| 1007 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 1008 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 1009 unittest.expect(o.startIndex, unittest.equals(42)); |
| 1010 unittest.expect(o.totalResults, unittest.equals(42)); |
| 1011 } |
| 1012 buildCounterEntityUserLinks--; |
| 1013 } |
| 1014 |
| 1015 core.int buildCounterExperimentParentLink = 0; |
| 1016 buildExperimentParentLink() { |
| 1017 var o = new api.ExperimentParentLink(); |
| 1018 buildCounterExperimentParentLink++; |
| 1019 if (buildCounterExperimentParentLink < 3) { |
| 1020 o.href = "foo"; |
| 1021 o.type = "foo"; |
| 1022 } |
| 1023 buildCounterExperimentParentLink--; |
| 1024 return o; |
| 1025 } |
| 1026 |
| 1027 checkExperimentParentLink(api.ExperimentParentLink o) { |
| 1028 buildCounterExperimentParentLink++; |
| 1029 if (buildCounterExperimentParentLink < 3) { |
| 1030 unittest.expect(o.href, unittest.equals('foo')); |
| 1031 unittest.expect(o.type, unittest.equals('foo')); |
| 1032 } |
| 1033 buildCounterExperimentParentLink--; |
| 1034 } |
| 1035 |
| 1036 core.int buildCounterExperimentVariations = 0; |
| 1037 buildExperimentVariations() { |
| 1038 var o = new api.ExperimentVariations(); |
| 1039 buildCounterExperimentVariations++; |
| 1040 if (buildCounterExperimentVariations < 3) { |
| 1041 o.name = "foo"; |
| 1042 o.status = "foo"; |
| 1043 o.url = "foo"; |
| 1044 o.weight = 42.0; |
| 1045 o.won = true; |
| 1046 } |
| 1047 buildCounterExperimentVariations--; |
| 1048 return o; |
| 1049 } |
| 1050 |
| 1051 checkExperimentVariations(api.ExperimentVariations o) { |
| 1052 buildCounterExperimentVariations++; |
| 1053 if (buildCounterExperimentVariations < 3) { |
| 1054 unittest.expect(o.name, unittest.equals('foo')); |
| 1055 unittest.expect(o.status, unittest.equals('foo')); |
| 1056 unittest.expect(o.url, unittest.equals('foo')); |
| 1057 unittest.expect(o.weight, unittest.equals(42.0)); |
| 1058 unittest.expect(o.won, unittest.isTrue); |
| 1059 } |
| 1060 buildCounterExperimentVariations--; |
| 1061 } |
| 1062 |
| 1063 buildUnnamed599() { |
| 1064 var o = new core.List<api.ExperimentVariations>(); |
| 1065 o.add(buildExperimentVariations()); |
| 1066 o.add(buildExperimentVariations()); |
| 1067 return o; |
| 1068 } |
| 1069 |
| 1070 checkUnnamed599(core.List<api.ExperimentVariations> o) { |
| 1071 unittest.expect(o, unittest.hasLength(2)); |
| 1072 checkExperimentVariations(o[0]); |
| 1073 checkExperimentVariations(o[1]); |
| 1074 } |
| 1075 |
| 1076 core.int buildCounterExperiment = 0; |
| 1077 buildExperiment() { |
| 1078 var o = new api.Experiment(); |
| 1079 buildCounterExperiment++; |
| 1080 if (buildCounterExperiment < 3) { |
| 1081 o.accountId = "foo"; |
| 1082 o.created = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1083 o.description = "foo"; |
| 1084 o.editableInGaUi = true; |
| 1085 o.endTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1086 o.equalWeighting = true; |
| 1087 o.id = "foo"; |
| 1088 o.internalWebPropertyId = "foo"; |
| 1089 o.kind = "foo"; |
| 1090 o.minimumExperimentLengthInDays = 42; |
| 1091 o.name = "foo"; |
| 1092 o.objectiveMetric = "foo"; |
| 1093 o.optimizationType = "foo"; |
| 1094 o.parentLink = buildExperimentParentLink(); |
| 1095 o.profileId = "foo"; |
| 1096 o.reasonExperimentEnded = "foo"; |
| 1097 o.rewriteVariationUrlsAsOriginal = true; |
| 1098 o.selfLink = "foo"; |
| 1099 o.servingFramework = "foo"; |
| 1100 o.snippet = "foo"; |
| 1101 o.startTime = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1102 o.status = "foo"; |
| 1103 o.trafficCoverage = 42.0; |
| 1104 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1105 o.variations = buildUnnamed599(); |
| 1106 o.webPropertyId = "foo"; |
| 1107 o.winnerConfidenceLevel = 42.0; |
| 1108 o.winnerFound = true; |
| 1109 } |
| 1110 buildCounterExperiment--; |
| 1111 return o; |
| 1112 } |
| 1113 |
| 1114 checkExperiment(api.Experiment o) { |
| 1115 buildCounterExperiment++; |
| 1116 if (buildCounterExperiment < 3) { |
| 1117 unittest.expect(o.accountId, unittest.equals('foo')); |
| 1118 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 1119 unittest.expect(o.description, unittest.equals('foo')); |
| 1120 unittest.expect(o.editableInGaUi, unittest.isTrue); |
| 1121 unittest.expect(o.endTime, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 1122 unittest.expect(o.equalWeighting, unittest.isTrue); |
| 1123 unittest.expect(o.id, unittest.equals('foo')); |
| 1124 unittest.expect(o.internalWebPropertyId, unittest.equals('foo')); |
| 1125 unittest.expect(o.kind, unittest.equals('foo')); |
| 1126 unittest.expect(o.minimumExperimentLengthInDays, unittest.equals(42)); |
| 1127 unittest.expect(o.name, unittest.equals('foo')); |
| 1128 unittest.expect(o.objectiveMetric, unittest.equals('foo')); |
| 1129 unittest.expect(o.optimizationType, unittest.equals('foo')); |
| 1130 checkExperimentParentLink(o.parentLink); |
| 1131 unittest.expect(o.profileId, unittest.equals('foo')); |
| 1132 unittest.expect(o.reasonExperimentEnded, unittest.equals('foo')); |
| 1133 unittest.expect(o.rewriteVariationUrlsAsOriginal, unittest.isTrue); |
| 1134 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 1135 unittest.expect(o.servingFramework, unittest.equals('foo')); |
| 1136 unittest.expect(o.snippet, unittest.equals('foo')); |
| 1137 unittest.expect(o.startTime, unittest.equals(core.DateTime.parse("2002-02-27
T14:01:02"))); |
| 1138 unittest.expect(o.status, unittest.equals('foo')); |
| 1139 unittest.expect(o.trafficCoverage, unittest.equals(42.0)); |
| 1140 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 1141 checkUnnamed599(o.variations); |
| 1142 unittest.expect(o.webPropertyId, unittest.equals('foo')); |
| 1143 unittest.expect(o.winnerConfidenceLevel, unittest.equals(42.0)); |
| 1144 unittest.expect(o.winnerFound, unittest.isTrue); |
| 1145 } |
| 1146 buildCounterExperiment--; |
| 1147 } |
| 1148 |
| 1149 buildUnnamed600() { |
| 1150 var o = new core.List<api.Experiment>(); |
| 1151 o.add(buildExperiment()); |
| 1152 o.add(buildExperiment()); |
| 1153 return o; |
| 1154 } |
| 1155 |
| 1156 checkUnnamed600(core.List<api.Experiment> o) { |
| 1157 unittest.expect(o, unittest.hasLength(2)); |
| 1158 checkExperiment(o[0]); |
| 1159 checkExperiment(o[1]); |
| 1160 } |
| 1161 |
| 1162 core.int buildCounterExperiments = 0; |
| 1163 buildExperiments() { |
| 1164 var o = new api.Experiments(); |
| 1165 buildCounterExperiments++; |
| 1166 if (buildCounterExperiments < 3) { |
| 1167 o.items = buildUnnamed600(); |
| 1168 o.itemsPerPage = 42; |
| 1169 o.kind = "foo"; |
| 1170 o.nextLink = "foo"; |
| 1171 o.previousLink = "foo"; |
| 1172 o.startIndex = 42; |
| 1173 o.totalResults = 42; |
| 1174 o.username = "foo"; |
| 1175 } |
| 1176 buildCounterExperiments--; |
| 1177 return o; |
| 1178 } |
| 1179 |
| 1180 checkExperiments(api.Experiments o) { |
| 1181 buildCounterExperiments++; |
| 1182 if (buildCounterExperiments < 3) { |
| 1183 checkUnnamed600(o.items); |
| 1184 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 1185 unittest.expect(o.kind, unittest.equals('foo')); |
| 1186 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 1187 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 1188 unittest.expect(o.startIndex, unittest.equals(42)); |
| 1189 unittest.expect(o.totalResults, unittest.equals(42)); |
| 1190 unittest.expect(o.username, unittest.equals('foo')); |
| 1191 } |
| 1192 buildCounterExperiments--; |
| 1193 } |
| 1194 |
| 1195 core.int buildCounterFilterAdvancedDetails = 0; |
| 1196 buildFilterAdvancedDetails() { |
| 1197 var o = new api.FilterAdvancedDetails(); |
| 1198 buildCounterFilterAdvancedDetails++; |
| 1199 if (buildCounterFilterAdvancedDetails < 3) { |
| 1200 o.caseSensitive = true; |
| 1201 o.extractA = "foo"; |
| 1202 o.extractB = "foo"; |
| 1203 o.fieldA = "foo"; |
| 1204 o.fieldARequired = true; |
| 1205 o.fieldB = "foo"; |
| 1206 o.fieldBRequired = true; |
| 1207 o.outputConstructor = "foo"; |
| 1208 o.outputToField = "foo"; |
| 1209 o.overrideOutputField = true; |
| 1210 } |
| 1211 buildCounterFilterAdvancedDetails--; |
| 1212 return o; |
| 1213 } |
| 1214 |
| 1215 checkFilterAdvancedDetails(api.FilterAdvancedDetails o) { |
| 1216 buildCounterFilterAdvancedDetails++; |
| 1217 if (buildCounterFilterAdvancedDetails < 3) { |
| 1218 unittest.expect(o.caseSensitive, unittest.isTrue); |
| 1219 unittest.expect(o.extractA, unittest.equals('foo')); |
| 1220 unittest.expect(o.extractB, unittest.equals('foo')); |
| 1221 unittest.expect(o.fieldA, unittest.equals('foo')); |
| 1222 unittest.expect(o.fieldARequired, unittest.isTrue); |
| 1223 unittest.expect(o.fieldB, unittest.equals('foo')); |
| 1224 unittest.expect(o.fieldBRequired, unittest.isTrue); |
| 1225 unittest.expect(o.outputConstructor, unittest.equals('foo')); |
| 1226 unittest.expect(o.outputToField, unittest.equals('foo')); |
| 1227 unittest.expect(o.overrideOutputField, unittest.isTrue); |
| 1228 } |
| 1229 buildCounterFilterAdvancedDetails--; |
| 1230 } |
| 1231 |
| 1232 core.int buildCounterFilterLowercaseDetails = 0; |
| 1233 buildFilterLowercaseDetails() { |
| 1234 var o = new api.FilterLowercaseDetails(); |
| 1235 buildCounterFilterLowercaseDetails++; |
| 1236 if (buildCounterFilterLowercaseDetails < 3) { |
| 1237 o.field = "foo"; |
| 1238 } |
| 1239 buildCounterFilterLowercaseDetails--; |
| 1240 return o; |
| 1241 } |
| 1242 |
| 1243 checkFilterLowercaseDetails(api.FilterLowercaseDetails o) { |
| 1244 buildCounterFilterLowercaseDetails++; |
| 1245 if (buildCounterFilterLowercaseDetails < 3) { |
| 1246 unittest.expect(o.field, unittest.equals('foo')); |
| 1247 } |
| 1248 buildCounterFilterLowercaseDetails--; |
| 1249 } |
| 1250 |
| 1251 core.int buildCounterFilterParentLink = 0; |
| 1252 buildFilterParentLink() { |
| 1253 var o = new api.FilterParentLink(); |
| 1254 buildCounterFilterParentLink++; |
| 1255 if (buildCounterFilterParentLink < 3) { |
| 1256 o.href = "foo"; |
| 1257 o.type = "foo"; |
| 1258 } |
| 1259 buildCounterFilterParentLink--; |
| 1260 return o; |
| 1261 } |
| 1262 |
| 1263 checkFilterParentLink(api.FilterParentLink o) { |
| 1264 buildCounterFilterParentLink++; |
| 1265 if (buildCounterFilterParentLink < 3) { |
| 1266 unittest.expect(o.href, unittest.equals('foo')); |
| 1267 unittest.expect(o.type, unittest.equals('foo')); |
| 1268 } |
| 1269 buildCounterFilterParentLink--; |
| 1270 } |
| 1271 |
| 1272 core.int buildCounterFilterSearchAndReplaceDetails = 0; |
| 1273 buildFilterSearchAndReplaceDetails() { |
| 1274 var o = new api.FilterSearchAndReplaceDetails(); |
| 1275 buildCounterFilterSearchAndReplaceDetails++; |
| 1276 if (buildCounterFilterSearchAndReplaceDetails < 3) { |
| 1277 o.caseSensitive = true; |
| 1278 o.field = "foo"; |
| 1279 o.replaceString = "foo"; |
| 1280 o.searchString = "foo"; |
| 1281 } |
| 1282 buildCounterFilterSearchAndReplaceDetails--; |
| 1283 return o; |
| 1284 } |
| 1285 |
| 1286 checkFilterSearchAndReplaceDetails(api.FilterSearchAndReplaceDetails o) { |
| 1287 buildCounterFilterSearchAndReplaceDetails++; |
| 1288 if (buildCounterFilterSearchAndReplaceDetails < 3) { |
| 1289 unittest.expect(o.caseSensitive, unittest.isTrue); |
| 1290 unittest.expect(o.field, unittest.equals('foo')); |
| 1291 unittest.expect(o.replaceString, unittest.equals('foo')); |
| 1292 unittest.expect(o.searchString, unittest.equals('foo')); |
| 1293 } |
| 1294 buildCounterFilterSearchAndReplaceDetails--; |
| 1295 } |
| 1296 |
| 1297 core.int buildCounterFilterUppercaseDetails = 0; |
| 1298 buildFilterUppercaseDetails() { |
| 1299 var o = new api.FilterUppercaseDetails(); |
| 1300 buildCounterFilterUppercaseDetails++; |
| 1301 if (buildCounterFilterUppercaseDetails < 3) { |
| 1302 o.field = "foo"; |
| 1303 } |
| 1304 buildCounterFilterUppercaseDetails--; |
| 1305 return o; |
| 1306 } |
| 1307 |
| 1308 checkFilterUppercaseDetails(api.FilterUppercaseDetails o) { |
| 1309 buildCounterFilterUppercaseDetails++; |
| 1310 if (buildCounterFilterUppercaseDetails < 3) { |
| 1311 unittest.expect(o.field, unittest.equals('foo')); |
| 1312 } |
| 1313 buildCounterFilterUppercaseDetails--; |
| 1314 } |
| 1315 |
| 1316 core.int buildCounterFilter = 0; |
| 1317 buildFilter() { |
| 1318 var o = new api.Filter(); |
| 1319 buildCounterFilter++; |
| 1320 if (buildCounterFilter < 3) { |
| 1321 o.accountId = "foo"; |
| 1322 o.advancedDetails = buildFilterAdvancedDetails(); |
| 1323 o.created = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1324 o.excludeDetails = buildFilterExpression(); |
| 1325 o.id = "foo"; |
| 1326 o.includeDetails = buildFilterExpression(); |
| 1327 o.kind = "foo"; |
| 1328 o.lowercaseDetails = buildFilterLowercaseDetails(); |
| 1329 o.name = "foo"; |
| 1330 o.parentLink = buildFilterParentLink(); |
| 1331 o.searchAndReplaceDetails = buildFilterSearchAndReplaceDetails(); |
| 1332 o.selfLink = "foo"; |
| 1333 o.type = "foo"; |
| 1334 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1335 o.uppercaseDetails = buildFilterUppercaseDetails(); |
| 1336 } |
| 1337 buildCounterFilter--; |
| 1338 return o; |
| 1339 } |
| 1340 |
| 1341 checkFilter(api.Filter o) { |
| 1342 buildCounterFilter++; |
| 1343 if (buildCounterFilter < 3) { |
| 1344 unittest.expect(o.accountId, unittest.equals('foo')); |
| 1345 checkFilterAdvancedDetails(o.advancedDetails); |
| 1346 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 1347 checkFilterExpression(o.excludeDetails); |
| 1348 unittest.expect(o.id, unittest.equals('foo')); |
| 1349 checkFilterExpression(o.includeDetails); |
| 1350 unittest.expect(o.kind, unittest.equals('foo')); |
| 1351 checkFilterLowercaseDetails(o.lowercaseDetails); |
| 1352 unittest.expect(o.name, unittest.equals('foo')); |
| 1353 checkFilterParentLink(o.parentLink); |
| 1354 checkFilterSearchAndReplaceDetails(o.searchAndReplaceDetails); |
| 1355 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 1356 unittest.expect(o.type, unittest.equals('foo')); |
| 1357 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 1358 checkFilterUppercaseDetails(o.uppercaseDetails); |
| 1359 } |
| 1360 buildCounterFilter--; |
| 1361 } |
| 1362 |
| 1363 core.int buildCounterFilterExpression = 0; |
| 1364 buildFilterExpression() { |
| 1365 var o = new api.FilterExpression(); |
| 1366 buildCounterFilterExpression++; |
| 1367 if (buildCounterFilterExpression < 3) { |
| 1368 o.caseSensitive = true; |
| 1369 o.expressionValue = "foo"; |
| 1370 o.field = "foo"; |
| 1371 o.kind = "foo"; |
| 1372 o.matchType = "foo"; |
| 1373 } |
| 1374 buildCounterFilterExpression--; |
| 1375 return o; |
| 1376 } |
| 1377 |
| 1378 checkFilterExpression(api.FilterExpression o) { |
| 1379 buildCounterFilterExpression++; |
| 1380 if (buildCounterFilterExpression < 3) { |
| 1381 unittest.expect(o.caseSensitive, unittest.isTrue); |
| 1382 unittest.expect(o.expressionValue, unittest.equals('foo')); |
| 1383 unittest.expect(o.field, unittest.equals('foo')); |
| 1384 unittest.expect(o.kind, unittest.equals('foo')); |
| 1385 unittest.expect(o.matchType, unittest.equals('foo')); |
| 1386 } |
| 1387 buildCounterFilterExpression--; |
| 1388 } |
| 1389 |
| 1390 core.int buildCounterFilterRef = 0; |
| 1391 buildFilterRef() { |
| 1392 var o = new api.FilterRef(); |
| 1393 buildCounterFilterRef++; |
| 1394 if (buildCounterFilterRef < 3) { |
| 1395 o.accountId = "foo"; |
| 1396 o.href = "foo"; |
| 1397 o.id = "foo"; |
| 1398 o.kind = "foo"; |
| 1399 o.name = "foo"; |
| 1400 } |
| 1401 buildCounterFilterRef--; |
| 1402 return o; |
| 1403 } |
| 1404 |
| 1405 checkFilterRef(api.FilterRef o) { |
| 1406 buildCounterFilterRef++; |
| 1407 if (buildCounterFilterRef < 3) { |
| 1408 unittest.expect(o.accountId, unittest.equals('foo')); |
| 1409 unittest.expect(o.href, unittest.equals('foo')); |
| 1410 unittest.expect(o.id, unittest.equals('foo')); |
| 1411 unittest.expect(o.kind, unittest.equals('foo')); |
| 1412 unittest.expect(o.name, unittest.equals('foo')); |
| 1413 } |
| 1414 buildCounterFilterRef--; |
| 1415 } |
| 1416 |
| 1417 buildUnnamed601() { |
| 1418 var o = new core.List<api.Filter>(); |
| 1419 o.add(buildFilter()); |
| 1420 o.add(buildFilter()); |
| 1421 return o; |
| 1422 } |
| 1423 |
| 1424 checkUnnamed601(core.List<api.Filter> o) { |
| 1425 unittest.expect(o, unittest.hasLength(2)); |
| 1426 checkFilter(o[0]); |
| 1427 checkFilter(o[1]); |
| 1428 } |
| 1429 |
| 1430 core.int buildCounterFilters = 0; |
| 1431 buildFilters() { |
| 1432 var o = new api.Filters(); |
| 1433 buildCounterFilters++; |
| 1434 if (buildCounterFilters < 3) { |
| 1435 o.items = buildUnnamed601(); |
| 1436 o.itemsPerPage = 42; |
| 1437 o.kind = "foo"; |
| 1438 o.nextLink = "foo"; |
| 1439 o.previousLink = "foo"; |
| 1440 o.startIndex = 42; |
| 1441 o.totalResults = 42; |
| 1442 o.username = "foo"; |
| 1443 } |
| 1444 buildCounterFilters--; |
| 1445 return o; |
| 1446 } |
| 1447 |
| 1448 checkFilters(api.Filters o) { |
| 1449 buildCounterFilters++; |
| 1450 if (buildCounterFilters < 3) { |
| 1451 checkUnnamed601(o.items); |
| 1452 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 1453 unittest.expect(o.kind, unittest.equals('foo')); |
| 1454 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 1455 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 1456 unittest.expect(o.startIndex, unittest.equals(42)); |
| 1457 unittest.expect(o.totalResults, unittest.equals(42)); |
| 1458 unittest.expect(o.username, unittest.equals('foo')); |
| 1459 } |
| 1460 buildCounterFilters--; |
| 1461 } |
| 1462 |
| 1463 core.int buildCounterGaDataColumnHeaders = 0; |
| 1464 buildGaDataColumnHeaders() { |
| 1465 var o = new api.GaDataColumnHeaders(); |
| 1466 buildCounterGaDataColumnHeaders++; |
| 1467 if (buildCounterGaDataColumnHeaders < 3) { |
| 1468 o.columnType = "foo"; |
| 1469 o.dataType = "foo"; |
| 1470 o.name = "foo"; |
| 1471 } |
| 1472 buildCounterGaDataColumnHeaders--; |
| 1473 return o; |
| 1474 } |
| 1475 |
| 1476 checkGaDataColumnHeaders(api.GaDataColumnHeaders o) { |
| 1477 buildCounterGaDataColumnHeaders++; |
| 1478 if (buildCounterGaDataColumnHeaders < 3) { |
| 1479 unittest.expect(o.columnType, unittest.equals('foo')); |
| 1480 unittest.expect(o.dataType, unittest.equals('foo')); |
| 1481 unittest.expect(o.name, unittest.equals('foo')); |
| 1482 } |
| 1483 buildCounterGaDataColumnHeaders--; |
| 1484 } |
| 1485 |
| 1486 buildUnnamed602() { |
| 1487 var o = new core.List<api.GaDataColumnHeaders>(); |
| 1488 o.add(buildGaDataColumnHeaders()); |
| 1489 o.add(buildGaDataColumnHeaders()); |
| 1490 return o; |
| 1491 } |
| 1492 |
| 1493 checkUnnamed602(core.List<api.GaDataColumnHeaders> o) { |
| 1494 unittest.expect(o, unittest.hasLength(2)); |
| 1495 checkGaDataColumnHeaders(o[0]); |
| 1496 checkGaDataColumnHeaders(o[1]); |
| 1497 } |
| 1498 |
| 1499 core.int buildCounterGaDataDataTableCols = 0; |
| 1500 buildGaDataDataTableCols() { |
| 1501 var o = new api.GaDataDataTableCols(); |
| 1502 buildCounterGaDataDataTableCols++; |
| 1503 if (buildCounterGaDataDataTableCols < 3) { |
| 1504 o.id = "foo"; |
| 1505 o.label = "foo"; |
| 1506 o.type = "foo"; |
| 1507 } |
| 1508 buildCounterGaDataDataTableCols--; |
| 1509 return o; |
| 1510 } |
| 1511 |
| 1512 checkGaDataDataTableCols(api.GaDataDataTableCols o) { |
| 1513 buildCounterGaDataDataTableCols++; |
| 1514 if (buildCounterGaDataDataTableCols < 3) { |
| 1515 unittest.expect(o.id, unittest.equals('foo')); |
| 1516 unittest.expect(o.label, unittest.equals('foo')); |
| 1517 unittest.expect(o.type, unittest.equals('foo')); |
| 1518 } |
| 1519 buildCounterGaDataDataTableCols--; |
| 1520 } |
| 1521 |
| 1522 buildUnnamed603() { |
| 1523 var o = new core.List<api.GaDataDataTableCols>(); |
| 1524 o.add(buildGaDataDataTableCols()); |
| 1525 o.add(buildGaDataDataTableCols()); |
| 1526 return o; |
| 1527 } |
| 1528 |
| 1529 checkUnnamed603(core.List<api.GaDataDataTableCols> o) { |
| 1530 unittest.expect(o, unittest.hasLength(2)); |
| 1531 checkGaDataDataTableCols(o[0]); |
| 1532 checkGaDataDataTableCols(o[1]); |
| 1533 } |
| 1534 |
| 1535 core.int buildCounterGaDataDataTableRowsC = 0; |
| 1536 buildGaDataDataTableRowsC() { |
| 1537 var o = new api.GaDataDataTableRowsC(); |
| 1538 buildCounterGaDataDataTableRowsC++; |
| 1539 if (buildCounterGaDataDataTableRowsC < 3) { |
| 1540 o.v = "foo"; |
| 1541 } |
| 1542 buildCounterGaDataDataTableRowsC--; |
| 1543 return o; |
| 1544 } |
| 1545 |
| 1546 checkGaDataDataTableRowsC(api.GaDataDataTableRowsC o) { |
| 1547 buildCounterGaDataDataTableRowsC++; |
| 1548 if (buildCounterGaDataDataTableRowsC < 3) { |
| 1549 unittest.expect(o.v, unittest.equals('foo')); |
| 1550 } |
| 1551 buildCounterGaDataDataTableRowsC--; |
| 1552 } |
| 1553 |
| 1554 buildUnnamed604() { |
| 1555 var o = new core.List<api.GaDataDataTableRowsC>(); |
| 1556 o.add(buildGaDataDataTableRowsC()); |
| 1557 o.add(buildGaDataDataTableRowsC()); |
| 1558 return o; |
| 1559 } |
| 1560 |
| 1561 checkUnnamed604(core.List<api.GaDataDataTableRowsC> o) { |
| 1562 unittest.expect(o, unittest.hasLength(2)); |
| 1563 checkGaDataDataTableRowsC(o[0]); |
| 1564 checkGaDataDataTableRowsC(o[1]); |
| 1565 } |
| 1566 |
| 1567 core.int buildCounterGaDataDataTableRows = 0; |
| 1568 buildGaDataDataTableRows() { |
| 1569 var o = new api.GaDataDataTableRows(); |
| 1570 buildCounterGaDataDataTableRows++; |
| 1571 if (buildCounterGaDataDataTableRows < 3) { |
| 1572 o.c = buildUnnamed604(); |
| 1573 } |
| 1574 buildCounterGaDataDataTableRows--; |
| 1575 return o; |
| 1576 } |
| 1577 |
| 1578 checkGaDataDataTableRows(api.GaDataDataTableRows o) { |
| 1579 buildCounterGaDataDataTableRows++; |
| 1580 if (buildCounterGaDataDataTableRows < 3) { |
| 1581 checkUnnamed604(o.c); |
| 1582 } |
| 1583 buildCounterGaDataDataTableRows--; |
| 1584 } |
| 1585 |
| 1586 buildUnnamed605() { |
| 1587 var o = new core.List<api.GaDataDataTableRows>(); |
| 1588 o.add(buildGaDataDataTableRows()); |
| 1589 o.add(buildGaDataDataTableRows()); |
| 1590 return o; |
| 1591 } |
| 1592 |
| 1593 checkUnnamed605(core.List<api.GaDataDataTableRows> o) { |
| 1594 unittest.expect(o, unittest.hasLength(2)); |
| 1595 checkGaDataDataTableRows(o[0]); |
| 1596 checkGaDataDataTableRows(o[1]); |
| 1597 } |
| 1598 |
| 1599 core.int buildCounterGaDataDataTable = 0; |
| 1600 buildGaDataDataTable() { |
| 1601 var o = new api.GaDataDataTable(); |
| 1602 buildCounterGaDataDataTable++; |
| 1603 if (buildCounterGaDataDataTable < 3) { |
| 1604 o.cols = buildUnnamed603(); |
| 1605 o.rows = buildUnnamed605(); |
| 1606 } |
| 1607 buildCounterGaDataDataTable--; |
| 1608 return o; |
| 1609 } |
| 1610 |
| 1611 checkGaDataDataTable(api.GaDataDataTable o) { |
| 1612 buildCounterGaDataDataTable++; |
| 1613 if (buildCounterGaDataDataTable < 3) { |
| 1614 checkUnnamed603(o.cols); |
| 1615 checkUnnamed605(o.rows); |
| 1616 } |
| 1617 buildCounterGaDataDataTable--; |
| 1618 } |
| 1619 |
| 1620 core.int buildCounterGaDataProfileInfo = 0; |
| 1621 buildGaDataProfileInfo() { |
| 1622 var o = new api.GaDataProfileInfo(); |
| 1623 buildCounterGaDataProfileInfo++; |
| 1624 if (buildCounterGaDataProfileInfo < 3) { |
| 1625 o.accountId = "foo"; |
| 1626 o.internalWebPropertyId = "foo"; |
| 1627 o.profileId = "foo"; |
| 1628 o.profileName = "foo"; |
| 1629 o.tableId = "foo"; |
| 1630 o.webPropertyId = "foo"; |
| 1631 } |
| 1632 buildCounterGaDataProfileInfo--; |
| 1633 return o; |
| 1634 } |
| 1635 |
| 1636 checkGaDataProfileInfo(api.GaDataProfileInfo o) { |
| 1637 buildCounterGaDataProfileInfo++; |
| 1638 if (buildCounterGaDataProfileInfo < 3) { |
| 1639 unittest.expect(o.accountId, unittest.equals('foo')); |
| 1640 unittest.expect(o.internalWebPropertyId, unittest.equals('foo')); |
| 1641 unittest.expect(o.profileId, unittest.equals('foo')); |
| 1642 unittest.expect(o.profileName, unittest.equals('foo')); |
| 1643 unittest.expect(o.tableId, unittest.equals('foo')); |
| 1644 unittest.expect(o.webPropertyId, unittest.equals('foo')); |
| 1645 } |
| 1646 buildCounterGaDataProfileInfo--; |
| 1647 } |
| 1648 |
| 1649 buildUnnamed606() { |
| 1650 var o = new core.List<core.String>(); |
| 1651 o.add("foo"); |
| 1652 o.add("foo"); |
| 1653 return o; |
| 1654 } |
| 1655 |
| 1656 checkUnnamed606(core.List<core.String> o) { |
| 1657 unittest.expect(o, unittest.hasLength(2)); |
| 1658 unittest.expect(o[0], unittest.equals('foo')); |
| 1659 unittest.expect(o[1], unittest.equals('foo')); |
| 1660 } |
| 1661 |
| 1662 buildUnnamed607() { |
| 1663 var o = new core.List<core.String>(); |
| 1664 o.add("foo"); |
| 1665 o.add("foo"); |
| 1666 return o; |
| 1667 } |
| 1668 |
| 1669 checkUnnamed607(core.List<core.String> o) { |
| 1670 unittest.expect(o, unittest.hasLength(2)); |
| 1671 unittest.expect(o[0], unittest.equals('foo')); |
| 1672 unittest.expect(o[1], unittest.equals('foo')); |
| 1673 } |
| 1674 |
| 1675 core.int buildCounterGaDataQuery = 0; |
| 1676 buildGaDataQuery() { |
| 1677 var o = new api.GaDataQuery(); |
| 1678 buildCounterGaDataQuery++; |
| 1679 if (buildCounterGaDataQuery < 3) { |
| 1680 o.dimensions = "foo"; |
| 1681 o.end_date = "foo"; |
| 1682 o.filters = "foo"; |
| 1683 o.ids = "foo"; |
| 1684 o.max_results = 42; |
| 1685 o.metrics = buildUnnamed606(); |
| 1686 o.samplingLevel = "foo"; |
| 1687 o.segment = "foo"; |
| 1688 o.sort = buildUnnamed607(); |
| 1689 o.start_date = "foo"; |
| 1690 o.start_index = 42; |
| 1691 } |
| 1692 buildCounterGaDataQuery--; |
| 1693 return o; |
| 1694 } |
| 1695 |
| 1696 checkGaDataQuery(api.GaDataQuery o) { |
| 1697 buildCounterGaDataQuery++; |
| 1698 if (buildCounterGaDataQuery < 3) { |
| 1699 unittest.expect(o.dimensions, unittest.equals('foo')); |
| 1700 unittest.expect(o.end_date, unittest.equals('foo')); |
| 1701 unittest.expect(o.filters, unittest.equals('foo')); |
| 1702 unittest.expect(o.ids, unittest.equals('foo')); |
| 1703 unittest.expect(o.max_results, unittest.equals(42)); |
| 1704 checkUnnamed606(o.metrics); |
| 1705 unittest.expect(o.samplingLevel, unittest.equals('foo')); |
| 1706 unittest.expect(o.segment, unittest.equals('foo')); |
| 1707 checkUnnamed607(o.sort); |
| 1708 unittest.expect(o.start_date, unittest.equals('foo')); |
| 1709 unittest.expect(o.start_index, unittest.equals(42)); |
| 1710 } |
| 1711 buildCounterGaDataQuery--; |
| 1712 } |
| 1713 |
| 1714 buildUnnamed608() { |
| 1715 var o = new core.List<core.String>(); |
| 1716 o.add("foo"); |
| 1717 o.add("foo"); |
| 1718 return o; |
| 1719 } |
| 1720 |
| 1721 checkUnnamed608(core.List<core.String> o) { |
| 1722 unittest.expect(o, unittest.hasLength(2)); |
| 1723 unittest.expect(o[0], unittest.equals('foo')); |
| 1724 unittest.expect(o[1], unittest.equals('foo')); |
| 1725 } |
| 1726 |
| 1727 buildUnnamed609() { |
| 1728 var o = new core.List<core.List<core.String>>(); |
| 1729 o.add(buildUnnamed608()); |
| 1730 o.add(buildUnnamed608()); |
| 1731 return o; |
| 1732 } |
| 1733 |
| 1734 checkUnnamed609(core.List<core.List<core.String>> o) { |
| 1735 unittest.expect(o, unittest.hasLength(2)); |
| 1736 checkUnnamed608(o[0]); |
| 1737 checkUnnamed608(o[1]); |
| 1738 } |
| 1739 |
| 1740 buildUnnamed610() { |
| 1741 var o = new core.Map<core.String, core.String>(); |
| 1742 o["x"] = "foo"; |
| 1743 o["y"] = "foo"; |
| 1744 return o; |
| 1745 } |
| 1746 |
| 1747 checkUnnamed610(core.Map<core.String, core.String> o) { |
| 1748 unittest.expect(o, unittest.hasLength(2)); |
| 1749 unittest.expect(o["x"], unittest.equals('foo')); |
| 1750 unittest.expect(o["y"], unittest.equals('foo')); |
| 1751 } |
| 1752 |
| 1753 core.int buildCounterGaData = 0; |
| 1754 buildGaData() { |
| 1755 var o = new api.GaData(); |
| 1756 buildCounterGaData++; |
| 1757 if (buildCounterGaData < 3) { |
| 1758 o.columnHeaders = buildUnnamed602(); |
| 1759 o.containsSampledData = true; |
| 1760 o.dataTable = buildGaDataDataTable(); |
| 1761 o.id = "foo"; |
| 1762 o.itemsPerPage = 42; |
| 1763 o.kind = "foo"; |
| 1764 o.nextLink = "foo"; |
| 1765 o.previousLink = "foo"; |
| 1766 o.profileInfo = buildGaDataProfileInfo(); |
| 1767 o.query = buildGaDataQuery(); |
| 1768 o.rows = buildUnnamed609(); |
| 1769 o.sampleSize = "foo"; |
| 1770 o.sampleSpace = "foo"; |
| 1771 o.selfLink = "foo"; |
| 1772 o.totalResults = 42; |
| 1773 o.totalsForAllResults = buildUnnamed610(); |
| 1774 } |
| 1775 buildCounterGaData--; |
| 1776 return o; |
| 1777 } |
| 1778 |
| 1779 checkGaData(api.GaData o) { |
| 1780 buildCounterGaData++; |
| 1781 if (buildCounterGaData < 3) { |
| 1782 checkUnnamed602(o.columnHeaders); |
| 1783 unittest.expect(o.containsSampledData, unittest.isTrue); |
| 1784 checkGaDataDataTable(o.dataTable); |
| 1785 unittest.expect(o.id, unittest.equals('foo')); |
| 1786 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 1787 unittest.expect(o.kind, unittest.equals('foo')); |
| 1788 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 1789 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 1790 checkGaDataProfileInfo(o.profileInfo); |
| 1791 checkGaDataQuery(o.query); |
| 1792 checkUnnamed609(o.rows); |
| 1793 unittest.expect(o.sampleSize, unittest.equals('foo')); |
| 1794 unittest.expect(o.sampleSpace, unittest.equals('foo')); |
| 1795 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 1796 unittest.expect(o.totalResults, unittest.equals(42)); |
| 1797 checkUnnamed610(o.totalsForAllResults); |
| 1798 } |
| 1799 buildCounterGaData--; |
| 1800 } |
| 1801 |
| 1802 core.int buildCounterGoalEventDetailsEventConditions = 0; |
| 1803 buildGoalEventDetailsEventConditions() { |
| 1804 var o = new api.GoalEventDetailsEventConditions(); |
| 1805 buildCounterGoalEventDetailsEventConditions++; |
| 1806 if (buildCounterGoalEventDetailsEventConditions < 3) { |
| 1807 o.comparisonType = "foo"; |
| 1808 o.comparisonValue = "foo"; |
| 1809 o.expression = "foo"; |
| 1810 o.matchType = "foo"; |
| 1811 o.type = "foo"; |
| 1812 } |
| 1813 buildCounterGoalEventDetailsEventConditions--; |
| 1814 return o; |
| 1815 } |
| 1816 |
| 1817 checkGoalEventDetailsEventConditions(api.GoalEventDetailsEventConditions o) { |
| 1818 buildCounterGoalEventDetailsEventConditions++; |
| 1819 if (buildCounterGoalEventDetailsEventConditions < 3) { |
| 1820 unittest.expect(o.comparisonType, unittest.equals('foo')); |
| 1821 unittest.expect(o.comparisonValue, unittest.equals('foo')); |
| 1822 unittest.expect(o.expression, unittest.equals('foo')); |
| 1823 unittest.expect(o.matchType, unittest.equals('foo')); |
| 1824 unittest.expect(o.type, unittest.equals('foo')); |
| 1825 } |
| 1826 buildCounterGoalEventDetailsEventConditions--; |
| 1827 } |
| 1828 |
| 1829 buildUnnamed611() { |
| 1830 var o = new core.List<api.GoalEventDetailsEventConditions>(); |
| 1831 o.add(buildGoalEventDetailsEventConditions()); |
| 1832 o.add(buildGoalEventDetailsEventConditions()); |
| 1833 return o; |
| 1834 } |
| 1835 |
| 1836 checkUnnamed611(core.List<api.GoalEventDetailsEventConditions> o) { |
| 1837 unittest.expect(o, unittest.hasLength(2)); |
| 1838 checkGoalEventDetailsEventConditions(o[0]); |
| 1839 checkGoalEventDetailsEventConditions(o[1]); |
| 1840 } |
| 1841 |
| 1842 core.int buildCounterGoalEventDetails = 0; |
| 1843 buildGoalEventDetails() { |
| 1844 var o = new api.GoalEventDetails(); |
| 1845 buildCounterGoalEventDetails++; |
| 1846 if (buildCounterGoalEventDetails < 3) { |
| 1847 o.eventConditions = buildUnnamed611(); |
| 1848 o.useEventValue = true; |
| 1849 } |
| 1850 buildCounterGoalEventDetails--; |
| 1851 return o; |
| 1852 } |
| 1853 |
| 1854 checkGoalEventDetails(api.GoalEventDetails o) { |
| 1855 buildCounterGoalEventDetails++; |
| 1856 if (buildCounterGoalEventDetails < 3) { |
| 1857 checkUnnamed611(o.eventConditions); |
| 1858 unittest.expect(o.useEventValue, unittest.isTrue); |
| 1859 } |
| 1860 buildCounterGoalEventDetails--; |
| 1861 } |
| 1862 |
| 1863 core.int buildCounterGoalParentLink = 0; |
| 1864 buildGoalParentLink() { |
| 1865 var o = new api.GoalParentLink(); |
| 1866 buildCounterGoalParentLink++; |
| 1867 if (buildCounterGoalParentLink < 3) { |
| 1868 o.href = "foo"; |
| 1869 o.type = "foo"; |
| 1870 } |
| 1871 buildCounterGoalParentLink--; |
| 1872 return o; |
| 1873 } |
| 1874 |
| 1875 checkGoalParentLink(api.GoalParentLink o) { |
| 1876 buildCounterGoalParentLink++; |
| 1877 if (buildCounterGoalParentLink < 3) { |
| 1878 unittest.expect(o.href, unittest.equals('foo')); |
| 1879 unittest.expect(o.type, unittest.equals('foo')); |
| 1880 } |
| 1881 buildCounterGoalParentLink--; |
| 1882 } |
| 1883 |
| 1884 core.int buildCounterGoalUrlDestinationDetailsSteps = 0; |
| 1885 buildGoalUrlDestinationDetailsSteps() { |
| 1886 var o = new api.GoalUrlDestinationDetailsSteps(); |
| 1887 buildCounterGoalUrlDestinationDetailsSteps++; |
| 1888 if (buildCounterGoalUrlDestinationDetailsSteps < 3) { |
| 1889 o.name = "foo"; |
| 1890 o.number = 42; |
| 1891 o.url = "foo"; |
| 1892 } |
| 1893 buildCounterGoalUrlDestinationDetailsSteps--; |
| 1894 return o; |
| 1895 } |
| 1896 |
| 1897 checkGoalUrlDestinationDetailsSteps(api.GoalUrlDestinationDetailsSteps o) { |
| 1898 buildCounterGoalUrlDestinationDetailsSteps++; |
| 1899 if (buildCounterGoalUrlDestinationDetailsSteps < 3) { |
| 1900 unittest.expect(o.name, unittest.equals('foo')); |
| 1901 unittest.expect(o.number, unittest.equals(42)); |
| 1902 unittest.expect(o.url, unittest.equals('foo')); |
| 1903 } |
| 1904 buildCounterGoalUrlDestinationDetailsSteps--; |
| 1905 } |
| 1906 |
| 1907 buildUnnamed612() { |
| 1908 var o = new core.List<api.GoalUrlDestinationDetailsSteps>(); |
| 1909 o.add(buildGoalUrlDestinationDetailsSteps()); |
| 1910 o.add(buildGoalUrlDestinationDetailsSteps()); |
| 1911 return o; |
| 1912 } |
| 1913 |
| 1914 checkUnnamed612(core.List<api.GoalUrlDestinationDetailsSteps> o) { |
| 1915 unittest.expect(o, unittest.hasLength(2)); |
| 1916 checkGoalUrlDestinationDetailsSteps(o[0]); |
| 1917 checkGoalUrlDestinationDetailsSteps(o[1]); |
| 1918 } |
| 1919 |
| 1920 core.int buildCounterGoalUrlDestinationDetails = 0; |
| 1921 buildGoalUrlDestinationDetails() { |
| 1922 var o = new api.GoalUrlDestinationDetails(); |
| 1923 buildCounterGoalUrlDestinationDetails++; |
| 1924 if (buildCounterGoalUrlDestinationDetails < 3) { |
| 1925 o.caseSensitive = true; |
| 1926 o.firstStepRequired = true; |
| 1927 o.matchType = "foo"; |
| 1928 o.steps = buildUnnamed612(); |
| 1929 o.url = "foo"; |
| 1930 } |
| 1931 buildCounterGoalUrlDestinationDetails--; |
| 1932 return o; |
| 1933 } |
| 1934 |
| 1935 checkGoalUrlDestinationDetails(api.GoalUrlDestinationDetails o) { |
| 1936 buildCounterGoalUrlDestinationDetails++; |
| 1937 if (buildCounterGoalUrlDestinationDetails < 3) { |
| 1938 unittest.expect(o.caseSensitive, unittest.isTrue); |
| 1939 unittest.expect(o.firstStepRequired, unittest.isTrue); |
| 1940 unittest.expect(o.matchType, unittest.equals('foo')); |
| 1941 checkUnnamed612(o.steps); |
| 1942 unittest.expect(o.url, unittest.equals('foo')); |
| 1943 } |
| 1944 buildCounterGoalUrlDestinationDetails--; |
| 1945 } |
| 1946 |
| 1947 core.int buildCounterGoalVisitNumPagesDetails = 0; |
| 1948 buildGoalVisitNumPagesDetails() { |
| 1949 var o = new api.GoalVisitNumPagesDetails(); |
| 1950 buildCounterGoalVisitNumPagesDetails++; |
| 1951 if (buildCounterGoalVisitNumPagesDetails < 3) { |
| 1952 o.comparisonType = "foo"; |
| 1953 o.comparisonValue = "foo"; |
| 1954 } |
| 1955 buildCounterGoalVisitNumPagesDetails--; |
| 1956 return o; |
| 1957 } |
| 1958 |
| 1959 checkGoalVisitNumPagesDetails(api.GoalVisitNumPagesDetails o) { |
| 1960 buildCounterGoalVisitNumPagesDetails++; |
| 1961 if (buildCounterGoalVisitNumPagesDetails < 3) { |
| 1962 unittest.expect(o.comparisonType, unittest.equals('foo')); |
| 1963 unittest.expect(o.comparisonValue, unittest.equals('foo')); |
| 1964 } |
| 1965 buildCounterGoalVisitNumPagesDetails--; |
| 1966 } |
| 1967 |
| 1968 core.int buildCounterGoalVisitTimeOnSiteDetails = 0; |
| 1969 buildGoalVisitTimeOnSiteDetails() { |
| 1970 var o = new api.GoalVisitTimeOnSiteDetails(); |
| 1971 buildCounterGoalVisitTimeOnSiteDetails++; |
| 1972 if (buildCounterGoalVisitTimeOnSiteDetails < 3) { |
| 1973 o.comparisonType = "foo"; |
| 1974 o.comparisonValue = "foo"; |
| 1975 } |
| 1976 buildCounterGoalVisitTimeOnSiteDetails--; |
| 1977 return o; |
| 1978 } |
| 1979 |
| 1980 checkGoalVisitTimeOnSiteDetails(api.GoalVisitTimeOnSiteDetails o) { |
| 1981 buildCounterGoalVisitTimeOnSiteDetails++; |
| 1982 if (buildCounterGoalVisitTimeOnSiteDetails < 3) { |
| 1983 unittest.expect(o.comparisonType, unittest.equals('foo')); |
| 1984 unittest.expect(o.comparisonValue, unittest.equals('foo')); |
| 1985 } |
| 1986 buildCounterGoalVisitTimeOnSiteDetails--; |
| 1987 } |
| 1988 |
| 1989 core.int buildCounterGoal = 0; |
| 1990 buildGoal() { |
| 1991 var o = new api.Goal(); |
| 1992 buildCounterGoal++; |
| 1993 if (buildCounterGoal < 3) { |
| 1994 o.accountId = "foo"; |
| 1995 o.active = true; |
| 1996 o.created = core.DateTime.parse("2002-02-27T14:01:02"); |
| 1997 o.eventDetails = buildGoalEventDetails(); |
| 1998 o.id = "foo"; |
| 1999 o.internalWebPropertyId = "foo"; |
| 2000 o.kind = "foo"; |
| 2001 o.name = "foo"; |
| 2002 o.parentLink = buildGoalParentLink(); |
| 2003 o.profileId = "foo"; |
| 2004 o.selfLink = "foo"; |
| 2005 o.type = "foo"; |
| 2006 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
| 2007 o.urlDestinationDetails = buildGoalUrlDestinationDetails(); |
| 2008 o.value = 42.0; |
| 2009 o.visitNumPagesDetails = buildGoalVisitNumPagesDetails(); |
| 2010 o.visitTimeOnSiteDetails = buildGoalVisitTimeOnSiteDetails(); |
| 2011 o.webPropertyId = "foo"; |
| 2012 } |
| 2013 buildCounterGoal--; |
| 2014 return o; |
| 2015 } |
| 2016 |
| 2017 checkGoal(api.Goal o) { |
| 2018 buildCounterGoal++; |
| 2019 if (buildCounterGoal < 3) { |
| 2020 unittest.expect(o.accountId, unittest.equals('foo')); |
| 2021 unittest.expect(o.active, unittest.isTrue); |
| 2022 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 2023 checkGoalEventDetails(o.eventDetails); |
| 2024 unittest.expect(o.id, unittest.equals('foo')); |
| 2025 unittest.expect(o.internalWebPropertyId, unittest.equals('foo')); |
| 2026 unittest.expect(o.kind, unittest.equals('foo')); |
| 2027 unittest.expect(o.name, unittest.equals('foo')); |
| 2028 checkGoalParentLink(o.parentLink); |
| 2029 unittest.expect(o.profileId, unittest.equals('foo')); |
| 2030 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 2031 unittest.expect(o.type, unittest.equals('foo')); |
| 2032 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 2033 checkGoalUrlDestinationDetails(o.urlDestinationDetails); |
| 2034 unittest.expect(o.value, unittest.equals(42.0)); |
| 2035 checkGoalVisitNumPagesDetails(o.visitNumPagesDetails); |
| 2036 checkGoalVisitTimeOnSiteDetails(o.visitTimeOnSiteDetails); |
| 2037 unittest.expect(o.webPropertyId, unittest.equals('foo')); |
| 2038 } |
| 2039 buildCounterGoal--; |
| 2040 } |
| 2041 |
| 2042 buildUnnamed613() { |
| 2043 var o = new core.List<api.Goal>(); |
| 2044 o.add(buildGoal()); |
| 2045 o.add(buildGoal()); |
| 2046 return o; |
| 2047 } |
| 2048 |
| 2049 checkUnnamed613(core.List<api.Goal> o) { |
| 2050 unittest.expect(o, unittest.hasLength(2)); |
| 2051 checkGoal(o[0]); |
| 2052 checkGoal(o[1]); |
| 2053 } |
| 2054 |
| 2055 core.int buildCounterGoals = 0; |
| 2056 buildGoals() { |
| 2057 var o = new api.Goals(); |
| 2058 buildCounterGoals++; |
| 2059 if (buildCounterGoals < 3) { |
| 2060 o.items = buildUnnamed613(); |
| 2061 o.itemsPerPage = 42; |
| 2062 o.kind = "foo"; |
| 2063 o.nextLink = "foo"; |
| 2064 o.previousLink = "foo"; |
| 2065 o.startIndex = 42; |
| 2066 o.totalResults = 42; |
| 2067 o.username = "foo"; |
| 2068 } |
| 2069 buildCounterGoals--; |
| 2070 return o; |
| 2071 } |
| 2072 |
| 2073 checkGoals(api.Goals o) { |
| 2074 buildCounterGoals++; |
| 2075 if (buildCounterGoals < 3) { |
| 2076 checkUnnamed613(o.items); |
| 2077 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 2078 unittest.expect(o.kind, unittest.equals('foo')); |
| 2079 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 2080 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 2081 unittest.expect(o.startIndex, unittest.equals(42)); |
| 2082 unittest.expect(o.totalResults, unittest.equals(42)); |
| 2083 unittest.expect(o.username, unittest.equals('foo')); |
| 2084 } |
| 2085 buildCounterGoals--; |
| 2086 } |
| 2087 |
| 2088 core.int buildCounterMcfDataColumnHeaders = 0; |
| 2089 buildMcfDataColumnHeaders() { |
| 2090 var o = new api.McfDataColumnHeaders(); |
| 2091 buildCounterMcfDataColumnHeaders++; |
| 2092 if (buildCounterMcfDataColumnHeaders < 3) { |
| 2093 o.columnType = "foo"; |
| 2094 o.dataType = "foo"; |
| 2095 o.name = "foo"; |
| 2096 } |
| 2097 buildCounterMcfDataColumnHeaders--; |
| 2098 return o; |
| 2099 } |
| 2100 |
| 2101 checkMcfDataColumnHeaders(api.McfDataColumnHeaders o) { |
| 2102 buildCounterMcfDataColumnHeaders++; |
| 2103 if (buildCounterMcfDataColumnHeaders < 3) { |
| 2104 unittest.expect(o.columnType, unittest.equals('foo')); |
| 2105 unittest.expect(o.dataType, unittest.equals('foo')); |
| 2106 unittest.expect(o.name, unittest.equals('foo')); |
| 2107 } |
| 2108 buildCounterMcfDataColumnHeaders--; |
| 2109 } |
| 2110 |
| 2111 buildUnnamed614() { |
| 2112 var o = new core.List<api.McfDataColumnHeaders>(); |
| 2113 o.add(buildMcfDataColumnHeaders()); |
| 2114 o.add(buildMcfDataColumnHeaders()); |
| 2115 return o; |
| 2116 } |
| 2117 |
| 2118 checkUnnamed614(core.List<api.McfDataColumnHeaders> o) { |
| 2119 unittest.expect(o, unittest.hasLength(2)); |
| 2120 checkMcfDataColumnHeaders(o[0]); |
| 2121 checkMcfDataColumnHeaders(o[1]); |
| 2122 } |
| 2123 |
| 2124 core.int buildCounterMcfDataProfileInfo = 0; |
| 2125 buildMcfDataProfileInfo() { |
| 2126 var o = new api.McfDataProfileInfo(); |
| 2127 buildCounterMcfDataProfileInfo++; |
| 2128 if (buildCounterMcfDataProfileInfo < 3) { |
| 2129 o.accountId = "foo"; |
| 2130 o.internalWebPropertyId = "foo"; |
| 2131 o.profileId = "foo"; |
| 2132 o.profileName = "foo"; |
| 2133 o.tableId = "foo"; |
| 2134 o.webPropertyId = "foo"; |
| 2135 } |
| 2136 buildCounterMcfDataProfileInfo--; |
| 2137 return o; |
| 2138 } |
| 2139 |
| 2140 checkMcfDataProfileInfo(api.McfDataProfileInfo o) { |
| 2141 buildCounterMcfDataProfileInfo++; |
| 2142 if (buildCounterMcfDataProfileInfo < 3) { |
| 2143 unittest.expect(o.accountId, unittest.equals('foo')); |
| 2144 unittest.expect(o.internalWebPropertyId, unittest.equals('foo')); |
| 2145 unittest.expect(o.profileId, unittest.equals('foo')); |
| 2146 unittest.expect(o.profileName, unittest.equals('foo')); |
| 2147 unittest.expect(o.tableId, unittest.equals('foo')); |
| 2148 unittest.expect(o.webPropertyId, unittest.equals('foo')); |
| 2149 } |
| 2150 buildCounterMcfDataProfileInfo--; |
| 2151 } |
| 2152 |
| 2153 buildUnnamed615() { |
| 2154 var o = new core.List<core.String>(); |
| 2155 o.add("foo"); |
| 2156 o.add("foo"); |
| 2157 return o; |
| 2158 } |
| 2159 |
| 2160 checkUnnamed615(core.List<core.String> o) { |
| 2161 unittest.expect(o, unittest.hasLength(2)); |
| 2162 unittest.expect(o[0], unittest.equals('foo')); |
| 2163 unittest.expect(o[1], unittest.equals('foo')); |
| 2164 } |
| 2165 |
| 2166 buildUnnamed616() { |
| 2167 var o = new core.List<core.String>(); |
| 2168 o.add("foo"); |
| 2169 o.add("foo"); |
| 2170 return o; |
| 2171 } |
| 2172 |
| 2173 checkUnnamed616(core.List<core.String> o) { |
| 2174 unittest.expect(o, unittest.hasLength(2)); |
| 2175 unittest.expect(o[0], unittest.equals('foo')); |
| 2176 unittest.expect(o[1], unittest.equals('foo')); |
| 2177 } |
| 2178 |
| 2179 core.int buildCounterMcfDataQuery = 0; |
| 2180 buildMcfDataQuery() { |
| 2181 var o = new api.McfDataQuery(); |
| 2182 buildCounterMcfDataQuery++; |
| 2183 if (buildCounterMcfDataQuery < 3) { |
| 2184 o.dimensions = "foo"; |
| 2185 o.end_date = "foo"; |
| 2186 o.filters = "foo"; |
| 2187 o.ids = "foo"; |
| 2188 o.max_results = 42; |
| 2189 o.metrics = buildUnnamed615(); |
| 2190 o.samplingLevel = "foo"; |
| 2191 o.segment = "foo"; |
| 2192 o.sort = buildUnnamed616(); |
| 2193 o.start_date = "foo"; |
| 2194 o.start_index = 42; |
| 2195 } |
| 2196 buildCounterMcfDataQuery--; |
| 2197 return o; |
| 2198 } |
| 2199 |
| 2200 checkMcfDataQuery(api.McfDataQuery o) { |
| 2201 buildCounterMcfDataQuery++; |
| 2202 if (buildCounterMcfDataQuery < 3) { |
| 2203 unittest.expect(o.dimensions, unittest.equals('foo')); |
| 2204 unittest.expect(o.end_date, unittest.equals('foo')); |
| 2205 unittest.expect(o.filters, unittest.equals('foo')); |
| 2206 unittest.expect(o.ids, unittest.equals('foo')); |
| 2207 unittest.expect(o.max_results, unittest.equals(42)); |
| 2208 checkUnnamed615(o.metrics); |
| 2209 unittest.expect(o.samplingLevel, unittest.equals('foo')); |
| 2210 unittest.expect(o.segment, unittest.equals('foo')); |
| 2211 checkUnnamed616(o.sort); |
| 2212 unittest.expect(o.start_date, unittest.equals('foo')); |
| 2213 unittest.expect(o.start_index, unittest.equals(42)); |
| 2214 } |
| 2215 buildCounterMcfDataQuery--; |
| 2216 } |
| 2217 |
| 2218 core.int buildCounterMcfDataRowsConversionPathValue = 0; |
| 2219 buildMcfDataRowsConversionPathValue() { |
| 2220 var o = new api.McfDataRowsConversionPathValue(); |
| 2221 buildCounterMcfDataRowsConversionPathValue++; |
| 2222 if (buildCounterMcfDataRowsConversionPathValue < 3) { |
| 2223 o.interactionType = "foo"; |
| 2224 o.nodeValue = "foo"; |
| 2225 } |
| 2226 buildCounterMcfDataRowsConversionPathValue--; |
| 2227 return o; |
| 2228 } |
| 2229 |
| 2230 checkMcfDataRowsConversionPathValue(api.McfDataRowsConversionPathValue o) { |
| 2231 buildCounterMcfDataRowsConversionPathValue++; |
| 2232 if (buildCounterMcfDataRowsConversionPathValue < 3) { |
| 2233 unittest.expect(o.interactionType, unittest.equals('foo')); |
| 2234 unittest.expect(o.nodeValue, unittest.equals('foo')); |
| 2235 } |
| 2236 buildCounterMcfDataRowsConversionPathValue--; |
| 2237 } |
| 2238 |
| 2239 buildUnnamed617() { |
| 2240 var o = new core.List<api.McfDataRowsConversionPathValue>(); |
| 2241 o.add(buildMcfDataRowsConversionPathValue()); |
| 2242 o.add(buildMcfDataRowsConversionPathValue()); |
| 2243 return o; |
| 2244 } |
| 2245 |
| 2246 checkUnnamed617(core.List<api.McfDataRowsConversionPathValue> o) { |
| 2247 unittest.expect(o, unittest.hasLength(2)); |
| 2248 checkMcfDataRowsConversionPathValue(o[0]); |
| 2249 checkMcfDataRowsConversionPathValue(o[1]); |
| 2250 } |
| 2251 |
| 2252 core.int buildCounterMcfDataRows = 0; |
| 2253 buildMcfDataRows() { |
| 2254 var o = new api.McfDataRows(); |
| 2255 buildCounterMcfDataRows++; |
| 2256 if (buildCounterMcfDataRows < 3) { |
| 2257 o.conversionPathValue = buildUnnamed617(); |
| 2258 o.primitiveValue = "foo"; |
| 2259 } |
| 2260 buildCounterMcfDataRows--; |
| 2261 return o; |
| 2262 } |
| 2263 |
| 2264 checkMcfDataRows(api.McfDataRows o) { |
| 2265 buildCounterMcfDataRows++; |
| 2266 if (buildCounterMcfDataRows < 3) { |
| 2267 checkUnnamed617(o.conversionPathValue); |
| 2268 unittest.expect(o.primitiveValue, unittest.equals('foo')); |
| 2269 } |
| 2270 buildCounterMcfDataRows--; |
| 2271 } |
| 2272 |
| 2273 buildUnnamed618() { |
| 2274 var o = new core.List<api.McfDataRows>(); |
| 2275 o.add(buildMcfDataRows()); |
| 2276 o.add(buildMcfDataRows()); |
| 2277 return o; |
| 2278 } |
| 2279 |
| 2280 checkUnnamed618(core.List<api.McfDataRows> o) { |
| 2281 unittest.expect(o, unittest.hasLength(2)); |
| 2282 checkMcfDataRows(o[0]); |
| 2283 checkMcfDataRows(o[1]); |
| 2284 } |
| 2285 |
| 2286 buildUnnamed619() { |
| 2287 var o = new core.List<core.List<api.McfDataRows>>(); |
| 2288 o.add(buildUnnamed618()); |
| 2289 o.add(buildUnnamed618()); |
| 2290 return o; |
| 2291 } |
| 2292 |
| 2293 checkUnnamed619(core.List<core.List<api.McfDataRows>> o) { |
| 2294 unittest.expect(o, unittest.hasLength(2)); |
| 2295 checkUnnamed618(o[0]); |
| 2296 checkUnnamed618(o[1]); |
| 2297 } |
| 2298 |
| 2299 buildUnnamed620() { |
| 2300 var o = new core.Map<core.String, core.String>(); |
| 2301 o["x"] = "foo"; |
| 2302 o["y"] = "foo"; |
| 2303 return o; |
| 2304 } |
| 2305 |
| 2306 checkUnnamed620(core.Map<core.String, core.String> o) { |
| 2307 unittest.expect(o, unittest.hasLength(2)); |
| 2308 unittest.expect(o["x"], unittest.equals('foo')); |
| 2309 unittest.expect(o["y"], unittest.equals('foo')); |
| 2310 } |
| 2311 |
| 2312 core.int buildCounterMcfData = 0; |
| 2313 buildMcfData() { |
| 2314 var o = new api.McfData(); |
| 2315 buildCounterMcfData++; |
| 2316 if (buildCounterMcfData < 3) { |
| 2317 o.columnHeaders = buildUnnamed614(); |
| 2318 o.containsSampledData = true; |
| 2319 o.id = "foo"; |
| 2320 o.itemsPerPage = 42; |
| 2321 o.kind = "foo"; |
| 2322 o.nextLink = "foo"; |
| 2323 o.previousLink = "foo"; |
| 2324 o.profileInfo = buildMcfDataProfileInfo(); |
| 2325 o.query = buildMcfDataQuery(); |
| 2326 o.rows = buildUnnamed619(); |
| 2327 o.sampleSize = "foo"; |
| 2328 o.sampleSpace = "foo"; |
| 2329 o.selfLink = "foo"; |
| 2330 o.totalResults = 42; |
| 2331 o.totalsForAllResults = buildUnnamed620(); |
| 2332 } |
| 2333 buildCounterMcfData--; |
| 2334 return o; |
| 2335 } |
| 2336 |
| 2337 checkMcfData(api.McfData o) { |
| 2338 buildCounterMcfData++; |
| 2339 if (buildCounterMcfData < 3) { |
| 2340 checkUnnamed614(o.columnHeaders); |
| 2341 unittest.expect(o.containsSampledData, unittest.isTrue); |
| 2342 unittest.expect(o.id, unittest.equals('foo')); |
| 2343 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 2344 unittest.expect(o.kind, unittest.equals('foo')); |
| 2345 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 2346 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 2347 checkMcfDataProfileInfo(o.profileInfo); |
| 2348 checkMcfDataQuery(o.query); |
| 2349 checkUnnamed619(o.rows); |
| 2350 unittest.expect(o.sampleSize, unittest.equals('foo')); |
| 2351 unittest.expect(o.sampleSpace, unittest.equals('foo')); |
| 2352 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 2353 unittest.expect(o.totalResults, unittest.equals(42)); |
| 2354 checkUnnamed620(o.totalsForAllResults); |
| 2355 } |
| 2356 buildCounterMcfData--; |
| 2357 } |
| 2358 |
| 2359 core.int buildCounterProfileChildLink = 0; |
| 2360 buildProfileChildLink() { |
| 2361 var o = new api.ProfileChildLink(); |
| 2362 buildCounterProfileChildLink++; |
| 2363 if (buildCounterProfileChildLink < 3) { |
| 2364 o.href = "foo"; |
| 2365 o.type = "foo"; |
| 2366 } |
| 2367 buildCounterProfileChildLink--; |
| 2368 return o; |
| 2369 } |
| 2370 |
| 2371 checkProfileChildLink(api.ProfileChildLink o) { |
| 2372 buildCounterProfileChildLink++; |
| 2373 if (buildCounterProfileChildLink < 3) { |
| 2374 unittest.expect(o.href, unittest.equals('foo')); |
| 2375 unittest.expect(o.type, unittest.equals('foo')); |
| 2376 } |
| 2377 buildCounterProfileChildLink--; |
| 2378 } |
| 2379 |
| 2380 core.int buildCounterProfileParentLink = 0; |
| 2381 buildProfileParentLink() { |
| 2382 var o = new api.ProfileParentLink(); |
| 2383 buildCounterProfileParentLink++; |
| 2384 if (buildCounterProfileParentLink < 3) { |
| 2385 o.href = "foo"; |
| 2386 o.type = "foo"; |
| 2387 } |
| 2388 buildCounterProfileParentLink--; |
| 2389 return o; |
| 2390 } |
| 2391 |
| 2392 checkProfileParentLink(api.ProfileParentLink o) { |
| 2393 buildCounterProfileParentLink++; |
| 2394 if (buildCounterProfileParentLink < 3) { |
| 2395 unittest.expect(o.href, unittest.equals('foo')); |
| 2396 unittest.expect(o.type, unittest.equals('foo')); |
| 2397 } |
| 2398 buildCounterProfileParentLink--; |
| 2399 } |
| 2400 |
| 2401 buildUnnamed621() { |
| 2402 var o = new core.List<core.String>(); |
| 2403 o.add("foo"); |
| 2404 o.add("foo"); |
| 2405 return o; |
| 2406 } |
| 2407 |
| 2408 checkUnnamed621(core.List<core.String> o) { |
| 2409 unittest.expect(o, unittest.hasLength(2)); |
| 2410 unittest.expect(o[0], unittest.equals('foo')); |
| 2411 unittest.expect(o[1], unittest.equals('foo')); |
| 2412 } |
| 2413 |
| 2414 core.int buildCounterProfilePermissions = 0; |
| 2415 buildProfilePermissions() { |
| 2416 var o = new api.ProfilePermissions(); |
| 2417 buildCounterProfilePermissions++; |
| 2418 if (buildCounterProfilePermissions < 3) { |
| 2419 o.effective = buildUnnamed621(); |
| 2420 } |
| 2421 buildCounterProfilePermissions--; |
| 2422 return o; |
| 2423 } |
| 2424 |
| 2425 checkProfilePermissions(api.ProfilePermissions o) { |
| 2426 buildCounterProfilePermissions++; |
| 2427 if (buildCounterProfilePermissions < 3) { |
| 2428 checkUnnamed621(o.effective); |
| 2429 } |
| 2430 buildCounterProfilePermissions--; |
| 2431 } |
| 2432 |
| 2433 core.int buildCounterProfile = 0; |
| 2434 buildProfile() { |
| 2435 var o = new api.Profile(); |
| 2436 buildCounterProfile++; |
| 2437 if (buildCounterProfile < 3) { |
| 2438 o.accountId = "foo"; |
| 2439 o.childLink = buildProfileChildLink(); |
| 2440 o.created = core.DateTime.parse("2002-02-27T14:01:02"); |
| 2441 o.currency = "foo"; |
| 2442 o.defaultPage = "foo"; |
| 2443 o.eCommerceTracking = true; |
| 2444 o.excludeQueryParameters = "foo"; |
| 2445 o.id = "foo"; |
| 2446 o.internalWebPropertyId = "foo"; |
| 2447 o.kind = "foo"; |
| 2448 o.name = "foo"; |
| 2449 o.parentLink = buildProfileParentLink(); |
| 2450 o.permissions = buildProfilePermissions(); |
| 2451 o.selfLink = "foo"; |
| 2452 o.siteSearchCategoryParameters = "foo"; |
| 2453 o.siteSearchQueryParameters = "foo"; |
| 2454 o.stripSiteSearchCategoryParameters = true; |
| 2455 o.stripSiteSearchQueryParameters = true; |
| 2456 o.timezone = "foo"; |
| 2457 o.type = "foo"; |
| 2458 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
| 2459 o.webPropertyId = "foo"; |
| 2460 o.websiteUrl = "foo"; |
| 2461 } |
| 2462 buildCounterProfile--; |
| 2463 return o; |
| 2464 } |
| 2465 |
| 2466 checkProfile(api.Profile o) { |
| 2467 buildCounterProfile++; |
| 2468 if (buildCounterProfile < 3) { |
| 2469 unittest.expect(o.accountId, unittest.equals('foo')); |
| 2470 checkProfileChildLink(o.childLink); |
| 2471 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 2472 unittest.expect(o.currency, unittest.equals('foo')); |
| 2473 unittest.expect(o.defaultPage, unittest.equals('foo')); |
| 2474 unittest.expect(o.eCommerceTracking, unittest.isTrue); |
| 2475 unittest.expect(o.excludeQueryParameters, unittest.equals('foo')); |
| 2476 unittest.expect(o.id, unittest.equals('foo')); |
| 2477 unittest.expect(o.internalWebPropertyId, unittest.equals('foo')); |
| 2478 unittest.expect(o.kind, unittest.equals('foo')); |
| 2479 unittest.expect(o.name, unittest.equals('foo')); |
| 2480 checkProfileParentLink(o.parentLink); |
| 2481 checkProfilePermissions(o.permissions); |
| 2482 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 2483 unittest.expect(o.siteSearchCategoryParameters, unittest.equals('foo')); |
| 2484 unittest.expect(o.siteSearchQueryParameters, unittest.equals('foo')); |
| 2485 unittest.expect(o.stripSiteSearchCategoryParameters, unittest.isTrue); |
| 2486 unittest.expect(o.stripSiteSearchQueryParameters, unittest.isTrue); |
| 2487 unittest.expect(o.timezone, unittest.equals('foo')); |
| 2488 unittest.expect(o.type, unittest.equals('foo')); |
| 2489 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 2490 unittest.expect(o.webPropertyId, unittest.equals('foo')); |
| 2491 unittest.expect(o.websiteUrl, unittest.equals('foo')); |
| 2492 } |
| 2493 buildCounterProfile--; |
| 2494 } |
| 2495 |
| 2496 core.int buildCounterProfileFilterLink = 0; |
| 2497 buildProfileFilterLink() { |
| 2498 var o = new api.ProfileFilterLink(); |
| 2499 buildCounterProfileFilterLink++; |
| 2500 if (buildCounterProfileFilterLink < 3) { |
| 2501 o.filterRef = buildFilterRef(); |
| 2502 o.id = "foo"; |
| 2503 o.kind = "foo"; |
| 2504 o.profileRef = buildProfileRef(); |
| 2505 o.rank = 42; |
| 2506 o.selfLink = "foo"; |
| 2507 } |
| 2508 buildCounterProfileFilterLink--; |
| 2509 return o; |
| 2510 } |
| 2511 |
| 2512 checkProfileFilterLink(api.ProfileFilterLink o) { |
| 2513 buildCounterProfileFilterLink++; |
| 2514 if (buildCounterProfileFilterLink < 3) { |
| 2515 checkFilterRef(o.filterRef); |
| 2516 unittest.expect(o.id, unittest.equals('foo')); |
| 2517 unittest.expect(o.kind, unittest.equals('foo')); |
| 2518 checkProfileRef(o.profileRef); |
| 2519 unittest.expect(o.rank, unittest.equals(42)); |
| 2520 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 2521 } |
| 2522 buildCounterProfileFilterLink--; |
| 2523 } |
| 2524 |
| 2525 buildUnnamed622() { |
| 2526 var o = new core.List<api.ProfileFilterLink>(); |
| 2527 o.add(buildProfileFilterLink()); |
| 2528 o.add(buildProfileFilterLink()); |
| 2529 return o; |
| 2530 } |
| 2531 |
| 2532 checkUnnamed622(core.List<api.ProfileFilterLink> o) { |
| 2533 unittest.expect(o, unittest.hasLength(2)); |
| 2534 checkProfileFilterLink(o[0]); |
| 2535 checkProfileFilterLink(o[1]); |
| 2536 } |
| 2537 |
| 2538 core.int buildCounterProfileFilterLinks = 0; |
| 2539 buildProfileFilterLinks() { |
| 2540 var o = new api.ProfileFilterLinks(); |
| 2541 buildCounterProfileFilterLinks++; |
| 2542 if (buildCounterProfileFilterLinks < 3) { |
| 2543 o.items = buildUnnamed622(); |
| 2544 o.itemsPerPage = 42; |
| 2545 o.kind = "foo"; |
| 2546 o.nextLink = "foo"; |
| 2547 o.previousLink = "foo"; |
| 2548 o.startIndex = 42; |
| 2549 o.totalResults = 42; |
| 2550 o.username = "foo"; |
| 2551 } |
| 2552 buildCounterProfileFilterLinks--; |
| 2553 return o; |
| 2554 } |
| 2555 |
| 2556 checkProfileFilterLinks(api.ProfileFilterLinks o) { |
| 2557 buildCounterProfileFilterLinks++; |
| 2558 if (buildCounterProfileFilterLinks < 3) { |
| 2559 checkUnnamed622(o.items); |
| 2560 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 2561 unittest.expect(o.kind, unittest.equals('foo')); |
| 2562 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 2563 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 2564 unittest.expect(o.startIndex, unittest.equals(42)); |
| 2565 unittest.expect(o.totalResults, unittest.equals(42)); |
| 2566 unittest.expect(o.username, unittest.equals('foo')); |
| 2567 } |
| 2568 buildCounterProfileFilterLinks--; |
| 2569 } |
| 2570 |
| 2571 core.int buildCounterProfileRef = 0; |
| 2572 buildProfileRef() { |
| 2573 var o = new api.ProfileRef(); |
| 2574 buildCounterProfileRef++; |
| 2575 if (buildCounterProfileRef < 3) { |
| 2576 o.accountId = "foo"; |
| 2577 o.href = "foo"; |
| 2578 o.id = "foo"; |
| 2579 o.internalWebPropertyId = "foo"; |
| 2580 o.kind = "foo"; |
| 2581 o.name = "foo"; |
| 2582 o.webPropertyId = "foo"; |
| 2583 } |
| 2584 buildCounterProfileRef--; |
| 2585 return o; |
| 2586 } |
| 2587 |
| 2588 checkProfileRef(api.ProfileRef o) { |
| 2589 buildCounterProfileRef++; |
| 2590 if (buildCounterProfileRef < 3) { |
| 2591 unittest.expect(o.accountId, unittest.equals('foo')); |
| 2592 unittest.expect(o.href, unittest.equals('foo')); |
| 2593 unittest.expect(o.id, unittest.equals('foo')); |
| 2594 unittest.expect(o.internalWebPropertyId, unittest.equals('foo')); |
| 2595 unittest.expect(o.kind, unittest.equals('foo')); |
| 2596 unittest.expect(o.name, unittest.equals('foo')); |
| 2597 unittest.expect(o.webPropertyId, unittest.equals('foo')); |
| 2598 } |
| 2599 buildCounterProfileRef--; |
| 2600 } |
| 2601 |
| 2602 core.int buildCounterProfileSummary = 0; |
| 2603 buildProfileSummary() { |
| 2604 var o = new api.ProfileSummary(); |
| 2605 buildCounterProfileSummary++; |
| 2606 if (buildCounterProfileSummary < 3) { |
| 2607 o.id = "foo"; |
| 2608 o.kind = "foo"; |
| 2609 o.name = "foo"; |
| 2610 o.type = "foo"; |
| 2611 } |
| 2612 buildCounterProfileSummary--; |
| 2613 return o; |
| 2614 } |
| 2615 |
| 2616 checkProfileSummary(api.ProfileSummary o) { |
| 2617 buildCounterProfileSummary++; |
| 2618 if (buildCounterProfileSummary < 3) { |
| 2619 unittest.expect(o.id, unittest.equals('foo')); |
| 2620 unittest.expect(o.kind, unittest.equals('foo')); |
| 2621 unittest.expect(o.name, unittest.equals('foo')); |
| 2622 unittest.expect(o.type, unittest.equals('foo')); |
| 2623 } |
| 2624 buildCounterProfileSummary--; |
| 2625 } |
| 2626 |
| 2627 buildUnnamed623() { |
| 2628 var o = new core.List<api.Profile>(); |
| 2629 o.add(buildProfile()); |
| 2630 o.add(buildProfile()); |
| 2631 return o; |
| 2632 } |
| 2633 |
| 2634 checkUnnamed623(core.List<api.Profile> o) { |
| 2635 unittest.expect(o, unittest.hasLength(2)); |
| 2636 checkProfile(o[0]); |
| 2637 checkProfile(o[1]); |
| 2638 } |
| 2639 |
| 2640 core.int buildCounterProfiles = 0; |
| 2641 buildProfiles() { |
| 2642 var o = new api.Profiles(); |
| 2643 buildCounterProfiles++; |
| 2644 if (buildCounterProfiles < 3) { |
| 2645 o.items = buildUnnamed623(); |
| 2646 o.itemsPerPage = 42; |
| 2647 o.kind = "foo"; |
| 2648 o.nextLink = "foo"; |
| 2649 o.previousLink = "foo"; |
| 2650 o.startIndex = 42; |
| 2651 o.totalResults = 42; |
| 2652 o.username = "foo"; |
| 2653 } |
| 2654 buildCounterProfiles--; |
| 2655 return o; |
| 2656 } |
| 2657 |
| 2658 checkProfiles(api.Profiles o) { |
| 2659 buildCounterProfiles++; |
| 2660 if (buildCounterProfiles < 3) { |
| 2661 checkUnnamed623(o.items); |
| 2662 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 2663 unittest.expect(o.kind, unittest.equals('foo')); |
| 2664 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 2665 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 2666 unittest.expect(o.startIndex, unittest.equals(42)); |
| 2667 unittest.expect(o.totalResults, unittest.equals(42)); |
| 2668 unittest.expect(o.username, unittest.equals('foo')); |
| 2669 } |
| 2670 buildCounterProfiles--; |
| 2671 } |
| 2672 |
| 2673 core.int buildCounterRealtimeDataColumnHeaders = 0; |
| 2674 buildRealtimeDataColumnHeaders() { |
| 2675 var o = new api.RealtimeDataColumnHeaders(); |
| 2676 buildCounterRealtimeDataColumnHeaders++; |
| 2677 if (buildCounterRealtimeDataColumnHeaders < 3) { |
| 2678 o.columnType = "foo"; |
| 2679 o.dataType = "foo"; |
| 2680 o.name = "foo"; |
| 2681 } |
| 2682 buildCounterRealtimeDataColumnHeaders--; |
| 2683 return o; |
| 2684 } |
| 2685 |
| 2686 checkRealtimeDataColumnHeaders(api.RealtimeDataColumnHeaders o) { |
| 2687 buildCounterRealtimeDataColumnHeaders++; |
| 2688 if (buildCounterRealtimeDataColumnHeaders < 3) { |
| 2689 unittest.expect(o.columnType, unittest.equals('foo')); |
| 2690 unittest.expect(o.dataType, unittest.equals('foo')); |
| 2691 unittest.expect(o.name, unittest.equals('foo')); |
| 2692 } |
| 2693 buildCounterRealtimeDataColumnHeaders--; |
| 2694 } |
| 2695 |
| 2696 buildUnnamed624() { |
| 2697 var o = new core.List<api.RealtimeDataColumnHeaders>(); |
| 2698 o.add(buildRealtimeDataColumnHeaders()); |
| 2699 o.add(buildRealtimeDataColumnHeaders()); |
| 2700 return o; |
| 2701 } |
| 2702 |
| 2703 checkUnnamed624(core.List<api.RealtimeDataColumnHeaders> o) { |
| 2704 unittest.expect(o, unittest.hasLength(2)); |
| 2705 checkRealtimeDataColumnHeaders(o[0]); |
| 2706 checkRealtimeDataColumnHeaders(o[1]); |
| 2707 } |
| 2708 |
| 2709 core.int buildCounterRealtimeDataProfileInfo = 0; |
| 2710 buildRealtimeDataProfileInfo() { |
| 2711 var o = new api.RealtimeDataProfileInfo(); |
| 2712 buildCounterRealtimeDataProfileInfo++; |
| 2713 if (buildCounterRealtimeDataProfileInfo < 3) { |
| 2714 o.accountId = "foo"; |
| 2715 o.internalWebPropertyId = "foo"; |
| 2716 o.profileId = "foo"; |
| 2717 o.profileName = "foo"; |
| 2718 o.tableId = "foo"; |
| 2719 o.webPropertyId = "foo"; |
| 2720 } |
| 2721 buildCounterRealtimeDataProfileInfo--; |
| 2722 return o; |
| 2723 } |
| 2724 |
| 2725 checkRealtimeDataProfileInfo(api.RealtimeDataProfileInfo o) { |
| 2726 buildCounterRealtimeDataProfileInfo++; |
| 2727 if (buildCounterRealtimeDataProfileInfo < 3) { |
| 2728 unittest.expect(o.accountId, unittest.equals('foo')); |
| 2729 unittest.expect(o.internalWebPropertyId, unittest.equals('foo')); |
| 2730 unittest.expect(o.profileId, unittest.equals('foo')); |
| 2731 unittest.expect(o.profileName, unittest.equals('foo')); |
| 2732 unittest.expect(o.tableId, unittest.equals('foo')); |
| 2733 unittest.expect(o.webPropertyId, unittest.equals('foo')); |
| 2734 } |
| 2735 buildCounterRealtimeDataProfileInfo--; |
| 2736 } |
| 2737 |
| 2738 buildUnnamed625() { |
| 2739 var o = new core.List<core.String>(); |
| 2740 o.add("foo"); |
| 2741 o.add("foo"); |
| 2742 return o; |
| 2743 } |
| 2744 |
| 2745 checkUnnamed625(core.List<core.String> o) { |
| 2746 unittest.expect(o, unittest.hasLength(2)); |
| 2747 unittest.expect(o[0], unittest.equals('foo')); |
| 2748 unittest.expect(o[1], unittest.equals('foo')); |
| 2749 } |
| 2750 |
| 2751 buildUnnamed626() { |
| 2752 var o = new core.List<core.String>(); |
| 2753 o.add("foo"); |
| 2754 o.add("foo"); |
| 2755 return o; |
| 2756 } |
| 2757 |
| 2758 checkUnnamed626(core.List<core.String> o) { |
| 2759 unittest.expect(o, unittest.hasLength(2)); |
| 2760 unittest.expect(o[0], unittest.equals('foo')); |
| 2761 unittest.expect(o[1], unittest.equals('foo')); |
| 2762 } |
| 2763 |
| 2764 core.int buildCounterRealtimeDataQuery = 0; |
| 2765 buildRealtimeDataQuery() { |
| 2766 var o = new api.RealtimeDataQuery(); |
| 2767 buildCounterRealtimeDataQuery++; |
| 2768 if (buildCounterRealtimeDataQuery < 3) { |
| 2769 o.dimensions = "foo"; |
| 2770 o.filters = "foo"; |
| 2771 o.ids = "foo"; |
| 2772 o.max_results = 42; |
| 2773 o.metrics = buildUnnamed625(); |
| 2774 o.sort = buildUnnamed626(); |
| 2775 } |
| 2776 buildCounterRealtimeDataQuery--; |
| 2777 return o; |
| 2778 } |
| 2779 |
| 2780 checkRealtimeDataQuery(api.RealtimeDataQuery o) { |
| 2781 buildCounterRealtimeDataQuery++; |
| 2782 if (buildCounterRealtimeDataQuery < 3) { |
| 2783 unittest.expect(o.dimensions, unittest.equals('foo')); |
| 2784 unittest.expect(o.filters, unittest.equals('foo')); |
| 2785 unittest.expect(o.ids, unittest.equals('foo')); |
| 2786 unittest.expect(o.max_results, unittest.equals(42)); |
| 2787 checkUnnamed625(o.metrics); |
| 2788 checkUnnamed626(o.sort); |
| 2789 } |
| 2790 buildCounterRealtimeDataQuery--; |
| 2791 } |
| 2792 |
| 2793 buildUnnamed627() { |
| 2794 var o = new core.List<core.String>(); |
| 2795 o.add("foo"); |
| 2796 o.add("foo"); |
| 2797 return o; |
| 2798 } |
| 2799 |
| 2800 checkUnnamed627(core.List<core.String> o) { |
| 2801 unittest.expect(o, unittest.hasLength(2)); |
| 2802 unittest.expect(o[0], unittest.equals('foo')); |
| 2803 unittest.expect(o[1], unittest.equals('foo')); |
| 2804 } |
| 2805 |
| 2806 buildUnnamed628() { |
| 2807 var o = new core.List<core.List<core.String>>(); |
| 2808 o.add(buildUnnamed627()); |
| 2809 o.add(buildUnnamed627()); |
| 2810 return o; |
| 2811 } |
| 2812 |
| 2813 checkUnnamed628(core.List<core.List<core.String>> o) { |
| 2814 unittest.expect(o, unittest.hasLength(2)); |
| 2815 checkUnnamed627(o[0]); |
| 2816 checkUnnamed627(o[1]); |
| 2817 } |
| 2818 |
| 2819 buildUnnamed629() { |
| 2820 var o = new core.Map<core.String, core.String>(); |
| 2821 o["x"] = "foo"; |
| 2822 o["y"] = "foo"; |
| 2823 return o; |
| 2824 } |
| 2825 |
| 2826 checkUnnamed629(core.Map<core.String, core.String> o) { |
| 2827 unittest.expect(o, unittest.hasLength(2)); |
| 2828 unittest.expect(o["x"], unittest.equals('foo')); |
| 2829 unittest.expect(o["y"], unittest.equals('foo')); |
| 2830 } |
| 2831 |
| 2832 core.int buildCounterRealtimeData = 0; |
| 2833 buildRealtimeData() { |
| 2834 var o = new api.RealtimeData(); |
| 2835 buildCounterRealtimeData++; |
| 2836 if (buildCounterRealtimeData < 3) { |
| 2837 o.columnHeaders = buildUnnamed624(); |
| 2838 o.id = "foo"; |
| 2839 o.kind = "foo"; |
| 2840 o.profileInfo = buildRealtimeDataProfileInfo(); |
| 2841 o.query = buildRealtimeDataQuery(); |
| 2842 o.rows = buildUnnamed628(); |
| 2843 o.selfLink = "foo"; |
| 2844 o.totalResults = 42; |
| 2845 o.totalsForAllResults = buildUnnamed629(); |
| 2846 } |
| 2847 buildCounterRealtimeData--; |
| 2848 return o; |
| 2849 } |
| 2850 |
| 2851 checkRealtimeData(api.RealtimeData o) { |
| 2852 buildCounterRealtimeData++; |
| 2853 if (buildCounterRealtimeData < 3) { |
| 2854 checkUnnamed624(o.columnHeaders); |
| 2855 unittest.expect(o.id, unittest.equals('foo')); |
| 2856 unittest.expect(o.kind, unittest.equals('foo')); |
| 2857 checkRealtimeDataProfileInfo(o.profileInfo); |
| 2858 checkRealtimeDataQuery(o.query); |
| 2859 checkUnnamed628(o.rows); |
| 2860 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 2861 unittest.expect(o.totalResults, unittest.equals(42)); |
| 2862 checkUnnamed629(o.totalsForAllResults); |
| 2863 } |
| 2864 buildCounterRealtimeData--; |
| 2865 } |
| 2866 |
| 2867 core.int buildCounterSegment = 0; |
| 2868 buildSegment() { |
| 2869 var o = new api.Segment(); |
| 2870 buildCounterSegment++; |
| 2871 if (buildCounterSegment < 3) { |
| 2872 o.created = core.DateTime.parse("2002-02-27T14:01:02"); |
| 2873 o.definition = "foo"; |
| 2874 o.id = "foo"; |
| 2875 o.kind = "foo"; |
| 2876 o.name = "foo"; |
| 2877 o.segmentId = "foo"; |
| 2878 o.selfLink = "foo"; |
| 2879 o.type = "foo"; |
| 2880 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
| 2881 } |
| 2882 buildCounterSegment--; |
| 2883 return o; |
| 2884 } |
| 2885 |
| 2886 checkSegment(api.Segment o) { |
| 2887 buildCounterSegment++; |
| 2888 if (buildCounterSegment < 3) { |
| 2889 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 2890 unittest.expect(o.definition, unittest.equals('foo')); |
| 2891 unittest.expect(o.id, unittest.equals('foo')); |
| 2892 unittest.expect(o.kind, unittest.equals('foo')); |
| 2893 unittest.expect(o.name, unittest.equals('foo')); |
| 2894 unittest.expect(o.segmentId, unittest.equals('foo')); |
| 2895 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 2896 unittest.expect(o.type, unittest.equals('foo')); |
| 2897 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 2898 } |
| 2899 buildCounterSegment--; |
| 2900 } |
| 2901 |
| 2902 buildUnnamed630() { |
| 2903 var o = new core.List<api.Segment>(); |
| 2904 o.add(buildSegment()); |
| 2905 o.add(buildSegment()); |
| 2906 return o; |
| 2907 } |
| 2908 |
| 2909 checkUnnamed630(core.List<api.Segment> o) { |
| 2910 unittest.expect(o, unittest.hasLength(2)); |
| 2911 checkSegment(o[0]); |
| 2912 checkSegment(o[1]); |
| 2913 } |
| 2914 |
| 2915 core.int buildCounterSegments = 0; |
| 2916 buildSegments() { |
| 2917 var o = new api.Segments(); |
| 2918 buildCounterSegments++; |
| 2919 if (buildCounterSegments < 3) { |
| 2920 o.items = buildUnnamed630(); |
| 2921 o.itemsPerPage = 42; |
| 2922 o.kind = "foo"; |
| 2923 o.nextLink = "foo"; |
| 2924 o.previousLink = "foo"; |
| 2925 o.startIndex = 42; |
| 2926 o.totalResults = 42; |
| 2927 o.username = "foo"; |
| 2928 } |
| 2929 buildCounterSegments--; |
| 2930 return o; |
| 2931 } |
| 2932 |
| 2933 checkSegments(api.Segments o) { |
| 2934 buildCounterSegments++; |
| 2935 if (buildCounterSegments < 3) { |
| 2936 checkUnnamed630(o.items); |
| 2937 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 2938 unittest.expect(o.kind, unittest.equals('foo')); |
| 2939 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 2940 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 2941 unittest.expect(o.startIndex, unittest.equals(42)); |
| 2942 unittest.expect(o.totalResults, unittest.equals(42)); |
| 2943 unittest.expect(o.username, unittest.equals('foo')); |
| 2944 } |
| 2945 buildCounterSegments--; |
| 2946 } |
| 2947 |
| 2948 core.int buildCounterUnsampledReportCloudStorageDownloadDetails = 0; |
| 2949 buildUnsampledReportCloudStorageDownloadDetails() { |
| 2950 var o = new api.UnsampledReportCloudStorageDownloadDetails(); |
| 2951 buildCounterUnsampledReportCloudStorageDownloadDetails++; |
| 2952 if (buildCounterUnsampledReportCloudStorageDownloadDetails < 3) { |
| 2953 o.bucketId = "foo"; |
| 2954 o.objectId = "foo"; |
| 2955 } |
| 2956 buildCounterUnsampledReportCloudStorageDownloadDetails--; |
| 2957 return o; |
| 2958 } |
| 2959 |
| 2960 checkUnsampledReportCloudStorageDownloadDetails(api.UnsampledReportCloudStorageD
ownloadDetails o) { |
| 2961 buildCounterUnsampledReportCloudStorageDownloadDetails++; |
| 2962 if (buildCounterUnsampledReportCloudStorageDownloadDetails < 3) { |
| 2963 unittest.expect(o.bucketId, unittest.equals('foo')); |
| 2964 unittest.expect(o.objectId, unittest.equals('foo')); |
| 2965 } |
| 2966 buildCounterUnsampledReportCloudStorageDownloadDetails--; |
| 2967 } |
| 2968 |
| 2969 core.int buildCounterUnsampledReportDriveDownloadDetails = 0; |
| 2970 buildUnsampledReportDriveDownloadDetails() { |
| 2971 var o = new api.UnsampledReportDriveDownloadDetails(); |
| 2972 buildCounterUnsampledReportDriveDownloadDetails++; |
| 2973 if (buildCounterUnsampledReportDriveDownloadDetails < 3) { |
| 2974 o.documentId = "foo"; |
| 2975 } |
| 2976 buildCounterUnsampledReportDriveDownloadDetails--; |
| 2977 return o; |
| 2978 } |
| 2979 |
| 2980 checkUnsampledReportDriveDownloadDetails(api.UnsampledReportDriveDownloadDetails
o) { |
| 2981 buildCounterUnsampledReportDriveDownloadDetails++; |
| 2982 if (buildCounterUnsampledReportDriveDownloadDetails < 3) { |
| 2983 unittest.expect(o.documentId, unittest.equals('foo')); |
| 2984 } |
| 2985 buildCounterUnsampledReportDriveDownloadDetails--; |
| 2986 } |
| 2987 |
| 2988 core.int buildCounterUnsampledReport = 0; |
| 2989 buildUnsampledReport() { |
| 2990 var o = new api.UnsampledReport(); |
| 2991 buildCounterUnsampledReport++; |
| 2992 if (buildCounterUnsampledReport < 3) { |
| 2993 o.accountId = "foo"; |
| 2994 o.cloudStorageDownloadDetails = buildUnsampledReportCloudStorageDownloadDeta
ils(); |
| 2995 o.created = core.DateTime.parse("2002-02-27T14:01:02"); |
| 2996 o.dimensions = "foo"; |
| 2997 o.downloadType = "foo"; |
| 2998 o.driveDownloadDetails = buildUnsampledReportDriveDownloadDetails(); |
| 2999 o.end_date = "foo"; |
| 3000 o.filters = "foo"; |
| 3001 o.id = "foo"; |
| 3002 o.kind = "foo"; |
| 3003 o.metrics = "foo"; |
| 3004 o.profileId = "foo"; |
| 3005 o.segment = "foo"; |
| 3006 o.selfLink = "foo"; |
| 3007 o.start_date = "foo"; |
| 3008 o.status = "foo"; |
| 3009 o.title = "foo"; |
| 3010 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
| 3011 o.webPropertyId = "foo"; |
| 3012 } |
| 3013 buildCounterUnsampledReport--; |
| 3014 return o; |
| 3015 } |
| 3016 |
| 3017 checkUnsampledReport(api.UnsampledReport o) { |
| 3018 buildCounterUnsampledReport++; |
| 3019 if (buildCounterUnsampledReport < 3) { |
| 3020 unittest.expect(o.accountId, unittest.equals('foo')); |
| 3021 checkUnsampledReportCloudStorageDownloadDetails(o.cloudStorageDownloadDetail
s); |
| 3022 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 3023 unittest.expect(o.dimensions, unittest.equals('foo')); |
| 3024 unittest.expect(o.downloadType, unittest.equals('foo')); |
| 3025 checkUnsampledReportDriveDownloadDetails(o.driveDownloadDetails); |
| 3026 unittest.expect(o.end_date, unittest.equals('foo')); |
| 3027 unittest.expect(o.filters, unittest.equals('foo')); |
| 3028 unittest.expect(o.id, unittest.equals('foo')); |
| 3029 unittest.expect(o.kind, unittest.equals('foo')); |
| 3030 unittest.expect(o.metrics, unittest.equals('foo')); |
| 3031 unittest.expect(o.profileId, unittest.equals('foo')); |
| 3032 unittest.expect(o.segment, unittest.equals('foo')); |
| 3033 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 3034 unittest.expect(o.start_date, unittest.equals('foo')); |
| 3035 unittest.expect(o.status, unittest.equals('foo')); |
| 3036 unittest.expect(o.title, unittest.equals('foo')); |
| 3037 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 3038 unittest.expect(o.webPropertyId, unittest.equals('foo')); |
| 3039 } |
| 3040 buildCounterUnsampledReport--; |
| 3041 } |
| 3042 |
| 3043 buildUnnamed631() { |
| 3044 var o = new core.List<api.UnsampledReport>(); |
| 3045 o.add(buildUnsampledReport()); |
| 3046 o.add(buildUnsampledReport()); |
| 3047 return o; |
| 3048 } |
| 3049 |
| 3050 checkUnnamed631(core.List<api.UnsampledReport> o) { |
| 3051 unittest.expect(o, unittest.hasLength(2)); |
| 3052 checkUnsampledReport(o[0]); |
| 3053 checkUnsampledReport(o[1]); |
| 3054 } |
| 3055 |
| 3056 core.int buildCounterUnsampledReports = 0; |
| 3057 buildUnsampledReports() { |
| 3058 var o = new api.UnsampledReports(); |
| 3059 buildCounterUnsampledReports++; |
| 3060 if (buildCounterUnsampledReports < 3) { |
| 3061 o.items = buildUnnamed631(); |
| 3062 o.itemsPerPage = 42; |
| 3063 o.kind = "foo"; |
| 3064 o.nextLink = "foo"; |
| 3065 o.previousLink = "foo"; |
| 3066 o.startIndex = 42; |
| 3067 o.totalResults = 42; |
| 3068 o.username = "foo"; |
| 3069 } |
| 3070 buildCounterUnsampledReports--; |
| 3071 return o; |
| 3072 } |
| 3073 |
| 3074 checkUnsampledReports(api.UnsampledReports o) { |
| 3075 buildCounterUnsampledReports++; |
| 3076 if (buildCounterUnsampledReports < 3) { |
| 3077 checkUnnamed631(o.items); |
| 3078 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 3079 unittest.expect(o.kind, unittest.equals('foo')); |
| 3080 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 3081 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 3082 unittest.expect(o.startIndex, unittest.equals(42)); |
| 3083 unittest.expect(o.totalResults, unittest.equals(42)); |
| 3084 unittest.expect(o.username, unittest.equals('foo')); |
| 3085 } |
| 3086 buildCounterUnsampledReports--; |
| 3087 } |
| 3088 |
| 3089 buildUnnamed632() { |
| 3090 var o = new core.List<core.String>(); |
| 3091 o.add("foo"); |
| 3092 o.add("foo"); |
| 3093 return o; |
| 3094 } |
| 3095 |
| 3096 checkUnnamed632(core.List<core.String> o) { |
| 3097 unittest.expect(o, unittest.hasLength(2)); |
| 3098 unittest.expect(o[0], unittest.equals('foo')); |
| 3099 unittest.expect(o[1], unittest.equals('foo')); |
| 3100 } |
| 3101 |
| 3102 core.int buildCounterUpload = 0; |
| 3103 buildUpload() { |
| 3104 var o = new api.Upload(); |
| 3105 buildCounterUpload++; |
| 3106 if (buildCounterUpload < 3) { |
| 3107 o.accountId = "foo"; |
| 3108 o.customDataSourceId = "foo"; |
| 3109 o.errors = buildUnnamed632(); |
| 3110 o.id = "foo"; |
| 3111 o.kind = "foo"; |
| 3112 o.status = "foo"; |
| 3113 } |
| 3114 buildCounterUpload--; |
| 3115 return o; |
| 3116 } |
| 3117 |
| 3118 checkUpload(api.Upload o) { |
| 3119 buildCounterUpload++; |
| 3120 if (buildCounterUpload < 3) { |
| 3121 unittest.expect(o.accountId, unittest.equals('foo')); |
| 3122 unittest.expect(o.customDataSourceId, unittest.equals('foo')); |
| 3123 checkUnnamed632(o.errors); |
| 3124 unittest.expect(o.id, unittest.equals('foo')); |
| 3125 unittest.expect(o.kind, unittest.equals('foo')); |
| 3126 unittest.expect(o.status, unittest.equals('foo')); |
| 3127 } |
| 3128 buildCounterUpload--; |
| 3129 } |
| 3130 |
| 3131 buildUnnamed633() { |
| 3132 var o = new core.List<api.Upload>(); |
| 3133 o.add(buildUpload()); |
| 3134 o.add(buildUpload()); |
| 3135 return o; |
| 3136 } |
| 3137 |
| 3138 checkUnnamed633(core.List<api.Upload> o) { |
| 3139 unittest.expect(o, unittest.hasLength(2)); |
| 3140 checkUpload(o[0]); |
| 3141 checkUpload(o[1]); |
| 3142 } |
| 3143 |
| 3144 core.int buildCounterUploads = 0; |
| 3145 buildUploads() { |
| 3146 var o = new api.Uploads(); |
| 3147 buildCounterUploads++; |
| 3148 if (buildCounterUploads < 3) { |
| 3149 o.items = buildUnnamed633(); |
| 3150 o.itemsPerPage = 42; |
| 3151 o.kind = "foo"; |
| 3152 o.nextLink = "foo"; |
| 3153 o.previousLink = "foo"; |
| 3154 o.startIndex = 42; |
| 3155 o.totalResults = 42; |
| 3156 } |
| 3157 buildCounterUploads--; |
| 3158 return o; |
| 3159 } |
| 3160 |
| 3161 checkUploads(api.Uploads o) { |
| 3162 buildCounterUploads++; |
| 3163 if (buildCounterUploads < 3) { |
| 3164 checkUnnamed633(o.items); |
| 3165 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 3166 unittest.expect(o.kind, unittest.equals('foo')); |
| 3167 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 3168 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 3169 unittest.expect(o.startIndex, unittest.equals(42)); |
| 3170 unittest.expect(o.totalResults, unittest.equals(42)); |
| 3171 } |
| 3172 buildCounterUploads--; |
| 3173 } |
| 3174 |
| 3175 core.int buildCounterUserRef = 0; |
| 3176 buildUserRef() { |
| 3177 var o = new api.UserRef(); |
| 3178 buildCounterUserRef++; |
| 3179 if (buildCounterUserRef < 3) { |
| 3180 o.email = "foo"; |
| 3181 o.id = "foo"; |
| 3182 o.kind = "foo"; |
| 3183 } |
| 3184 buildCounterUserRef--; |
| 3185 return o; |
| 3186 } |
| 3187 |
| 3188 checkUserRef(api.UserRef o) { |
| 3189 buildCounterUserRef++; |
| 3190 if (buildCounterUserRef < 3) { |
| 3191 unittest.expect(o.email, unittest.equals('foo')); |
| 3192 unittest.expect(o.id, unittest.equals('foo')); |
| 3193 unittest.expect(o.kind, unittest.equals('foo')); |
| 3194 } |
| 3195 buildCounterUserRef--; |
| 3196 } |
| 3197 |
| 3198 core.int buildCounterWebPropertyRef = 0; |
| 3199 buildWebPropertyRef() { |
| 3200 var o = new api.WebPropertyRef(); |
| 3201 buildCounterWebPropertyRef++; |
| 3202 if (buildCounterWebPropertyRef < 3) { |
| 3203 o.accountId = "foo"; |
| 3204 o.href = "foo"; |
| 3205 o.id = "foo"; |
| 3206 o.internalWebPropertyId = "foo"; |
| 3207 o.kind = "foo"; |
| 3208 o.name = "foo"; |
| 3209 } |
| 3210 buildCounterWebPropertyRef--; |
| 3211 return o; |
| 3212 } |
| 3213 |
| 3214 checkWebPropertyRef(api.WebPropertyRef o) { |
| 3215 buildCounterWebPropertyRef++; |
| 3216 if (buildCounterWebPropertyRef < 3) { |
| 3217 unittest.expect(o.accountId, unittest.equals('foo')); |
| 3218 unittest.expect(o.href, unittest.equals('foo')); |
| 3219 unittest.expect(o.id, unittest.equals('foo')); |
| 3220 unittest.expect(o.internalWebPropertyId, unittest.equals('foo')); |
| 3221 unittest.expect(o.kind, unittest.equals('foo')); |
| 3222 unittest.expect(o.name, unittest.equals('foo')); |
| 3223 } |
| 3224 buildCounterWebPropertyRef--; |
| 3225 } |
| 3226 |
| 3227 buildUnnamed634() { |
| 3228 var o = new core.List<api.ProfileSummary>(); |
| 3229 o.add(buildProfileSummary()); |
| 3230 o.add(buildProfileSummary()); |
| 3231 return o; |
| 3232 } |
| 3233 |
| 3234 checkUnnamed634(core.List<api.ProfileSummary> o) { |
| 3235 unittest.expect(o, unittest.hasLength(2)); |
| 3236 checkProfileSummary(o[0]); |
| 3237 checkProfileSummary(o[1]); |
| 3238 } |
| 3239 |
| 3240 core.int buildCounterWebPropertySummary = 0; |
| 3241 buildWebPropertySummary() { |
| 3242 var o = new api.WebPropertySummary(); |
| 3243 buildCounterWebPropertySummary++; |
| 3244 if (buildCounterWebPropertySummary < 3) { |
| 3245 o.id = "foo"; |
| 3246 o.internalWebPropertyId = "foo"; |
| 3247 o.kind = "foo"; |
| 3248 o.level = "foo"; |
| 3249 o.name = "foo"; |
| 3250 o.profiles = buildUnnamed634(); |
| 3251 o.websiteUrl = "foo"; |
| 3252 } |
| 3253 buildCounterWebPropertySummary--; |
| 3254 return o; |
| 3255 } |
| 3256 |
| 3257 checkWebPropertySummary(api.WebPropertySummary o) { |
| 3258 buildCounterWebPropertySummary++; |
| 3259 if (buildCounterWebPropertySummary < 3) { |
| 3260 unittest.expect(o.id, unittest.equals('foo')); |
| 3261 unittest.expect(o.internalWebPropertyId, unittest.equals('foo')); |
| 3262 unittest.expect(o.kind, unittest.equals('foo')); |
| 3263 unittest.expect(o.level, unittest.equals('foo')); |
| 3264 unittest.expect(o.name, unittest.equals('foo')); |
| 3265 checkUnnamed634(o.profiles); |
| 3266 unittest.expect(o.websiteUrl, unittest.equals('foo')); |
| 3267 } |
| 3268 buildCounterWebPropertySummary--; |
| 3269 } |
| 3270 |
| 3271 buildUnnamed635() { |
| 3272 var o = new core.List<api.Webproperty>(); |
| 3273 o.add(buildWebproperty()); |
| 3274 o.add(buildWebproperty()); |
| 3275 return o; |
| 3276 } |
| 3277 |
| 3278 checkUnnamed635(core.List<api.Webproperty> o) { |
| 3279 unittest.expect(o, unittest.hasLength(2)); |
| 3280 checkWebproperty(o[0]); |
| 3281 checkWebproperty(o[1]); |
| 3282 } |
| 3283 |
| 3284 core.int buildCounterWebproperties = 0; |
| 3285 buildWebproperties() { |
| 3286 var o = new api.Webproperties(); |
| 3287 buildCounterWebproperties++; |
| 3288 if (buildCounterWebproperties < 3) { |
| 3289 o.items = buildUnnamed635(); |
| 3290 o.itemsPerPage = 42; |
| 3291 o.kind = "foo"; |
| 3292 o.nextLink = "foo"; |
| 3293 o.previousLink = "foo"; |
| 3294 o.startIndex = 42; |
| 3295 o.totalResults = 42; |
| 3296 o.username = "foo"; |
| 3297 } |
| 3298 buildCounterWebproperties--; |
| 3299 return o; |
| 3300 } |
| 3301 |
| 3302 checkWebproperties(api.Webproperties o) { |
| 3303 buildCounterWebproperties++; |
| 3304 if (buildCounterWebproperties < 3) { |
| 3305 checkUnnamed635(o.items); |
| 3306 unittest.expect(o.itemsPerPage, unittest.equals(42)); |
| 3307 unittest.expect(o.kind, unittest.equals('foo')); |
| 3308 unittest.expect(o.nextLink, unittest.equals('foo')); |
| 3309 unittest.expect(o.previousLink, unittest.equals('foo')); |
| 3310 unittest.expect(o.startIndex, unittest.equals(42)); |
| 3311 unittest.expect(o.totalResults, unittest.equals(42)); |
| 3312 unittest.expect(o.username, unittest.equals('foo')); |
| 3313 } |
| 3314 buildCounterWebproperties--; |
| 3315 } |
| 3316 |
| 3317 core.int buildCounterWebpropertyChildLink = 0; |
| 3318 buildWebpropertyChildLink() { |
| 3319 var o = new api.WebpropertyChildLink(); |
| 3320 buildCounterWebpropertyChildLink++; |
| 3321 if (buildCounterWebpropertyChildLink < 3) { |
| 3322 o.href = "foo"; |
| 3323 o.type = "foo"; |
| 3324 } |
| 3325 buildCounterWebpropertyChildLink--; |
| 3326 return o; |
| 3327 } |
| 3328 |
| 3329 checkWebpropertyChildLink(api.WebpropertyChildLink o) { |
| 3330 buildCounterWebpropertyChildLink++; |
| 3331 if (buildCounterWebpropertyChildLink < 3) { |
| 3332 unittest.expect(o.href, unittest.equals('foo')); |
| 3333 unittest.expect(o.type, unittest.equals('foo')); |
| 3334 } |
| 3335 buildCounterWebpropertyChildLink--; |
| 3336 } |
| 3337 |
| 3338 core.int buildCounterWebpropertyParentLink = 0; |
| 3339 buildWebpropertyParentLink() { |
| 3340 var o = new api.WebpropertyParentLink(); |
| 3341 buildCounterWebpropertyParentLink++; |
| 3342 if (buildCounterWebpropertyParentLink < 3) { |
| 3343 o.href = "foo"; |
| 3344 o.type = "foo"; |
| 3345 } |
| 3346 buildCounterWebpropertyParentLink--; |
| 3347 return o; |
| 3348 } |
| 3349 |
| 3350 checkWebpropertyParentLink(api.WebpropertyParentLink o) { |
| 3351 buildCounterWebpropertyParentLink++; |
| 3352 if (buildCounterWebpropertyParentLink < 3) { |
| 3353 unittest.expect(o.href, unittest.equals('foo')); |
| 3354 unittest.expect(o.type, unittest.equals('foo')); |
| 3355 } |
| 3356 buildCounterWebpropertyParentLink--; |
| 3357 } |
| 3358 |
| 3359 buildUnnamed636() { |
| 3360 var o = new core.List<core.String>(); |
| 3361 o.add("foo"); |
| 3362 o.add("foo"); |
| 3363 return o; |
| 3364 } |
| 3365 |
| 3366 checkUnnamed636(core.List<core.String> o) { |
| 3367 unittest.expect(o, unittest.hasLength(2)); |
| 3368 unittest.expect(o[0], unittest.equals('foo')); |
| 3369 unittest.expect(o[1], unittest.equals('foo')); |
| 3370 } |
| 3371 |
| 3372 core.int buildCounterWebpropertyPermissions = 0; |
| 3373 buildWebpropertyPermissions() { |
| 3374 var o = new api.WebpropertyPermissions(); |
| 3375 buildCounterWebpropertyPermissions++; |
| 3376 if (buildCounterWebpropertyPermissions < 3) { |
| 3377 o.effective = buildUnnamed636(); |
| 3378 } |
| 3379 buildCounterWebpropertyPermissions--; |
| 3380 return o; |
| 3381 } |
| 3382 |
| 3383 checkWebpropertyPermissions(api.WebpropertyPermissions o) { |
| 3384 buildCounterWebpropertyPermissions++; |
| 3385 if (buildCounterWebpropertyPermissions < 3) { |
| 3386 checkUnnamed636(o.effective); |
| 3387 } |
| 3388 buildCounterWebpropertyPermissions--; |
| 3389 } |
| 3390 |
| 3391 core.int buildCounterWebproperty = 0; |
| 3392 buildWebproperty() { |
| 3393 var o = new api.Webproperty(); |
| 3394 buildCounterWebproperty++; |
| 3395 if (buildCounterWebproperty < 3) { |
| 3396 o.accountId = "foo"; |
| 3397 o.childLink = buildWebpropertyChildLink(); |
| 3398 o.created = core.DateTime.parse("2002-02-27T14:01:02"); |
| 3399 o.defaultProfileId = "foo"; |
| 3400 o.id = "foo"; |
| 3401 o.industryVertical = "foo"; |
| 3402 o.internalWebPropertyId = "foo"; |
| 3403 o.kind = "foo"; |
| 3404 o.level = "foo"; |
| 3405 o.name = "foo"; |
| 3406 o.parentLink = buildWebpropertyParentLink(); |
| 3407 o.permissions = buildWebpropertyPermissions(); |
| 3408 o.profileCount = 42; |
| 3409 o.selfLink = "foo"; |
| 3410 o.updated = core.DateTime.parse("2002-02-27T14:01:02"); |
| 3411 o.websiteUrl = "foo"; |
| 3412 } |
| 3413 buildCounterWebproperty--; |
| 3414 return o; |
| 3415 } |
| 3416 |
| 3417 checkWebproperty(api.Webproperty o) { |
| 3418 buildCounterWebproperty++; |
| 3419 if (buildCounterWebproperty < 3) { |
| 3420 unittest.expect(o.accountId, unittest.equals('foo')); |
| 3421 checkWebpropertyChildLink(o.childLink); |
| 3422 unittest.expect(o.created, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 3423 unittest.expect(o.defaultProfileId, unittest.equals('foo')); |
| 3424 unittest.expect(o.id, unittest.equals('foo')); |
| 3425 unittest.expect(o.industryVertical, unittest.equals('foo')); |
| 3426 unittest.expect(o.internalWebPropertyId, unittest.equals('foo')); |
| 3427 unittest.expect(o.kind, unittest.equals('foo')); |
| 3428 unittest.expect(o.level, unittest.equals('foo')); |
| 3429 unittest.expect(o.name, unittest.equals('foo')); |
| 3430 checkWebpropertyParentLink(o.parentLink); |
| 3431 checkWebpropertyPermissions(o.permissions); |
| 3432 unittest.expect(o.profileCount, unittest.equals(42)); |
| 3433 unittest.expect(o.selfLink, unittest.equals('foo')); |
| 3434 unittest.expect(o.updated, unittest.equals(core.DateTime.parse("2002-02-27T1
4:01:02"))); |
| 3435 unittest.expect(o.websiteUrl, unittest.equals('foo')); |
| 3436 } |
| 3437 buildCounterWebproperty--; |
| 3438 } |
| 3439 |
| 3440 |
| 3441 main() { |
| 3442 unittest.group("obj-schema-AccountChildLink", () { |
| 3443 unittest.test("to-json--from-json", () { |
| 3444 var o = buildAccountChildLink(); |
| 3445 var od = new api.AccountChildLink.fromJson(o.toJson()); |
| 3446 checkAccountChildLink(od); |
| 3447 }); |
| 3448 }); |
| 3449 |
| 3450 |
| 3451 unittest.group("obj-schema-AccountPermissions", () { |
| 3452 unittest.test("to-json--from-json", () { |
| 3453 var o = buildAccountPermissions(); |
| 3454 var od = new api.AccountPermissions.fromJson(o.toJson()); |
| 3455 checkAccountPermissions(od); |
| 3456 }); |
| 3457 }); |
| 3458 |
| 3459 |
| 3460 unittest.group("obj-schema-Account", () { |
| 3461 unittest.test("to-json--from-json", () { |
| 3462 var o = buildAccount(); |
| 3463 var od = new api.Account.fromJson(o.toJson()); |
| 3464 checkAccount(od); |
| 3465 }); |
| 3466 }); |
| 3467 |
| 3468 |
| 3469 unittest.group("obj-schema-AccountRef", () { |
| 3470 unittest.test("to-json--from-json", () { |
| 3471 var o = buildAccountRef(); |
| 3472 var od = new api.AccountRef.fromJson(o.toJson()); |
| 3473 checkAccountRef(od); |
| 3474 }); |
| 3475 }); |
| 3476 |
| 3477 |
| 3478 unittest.group("obj-schema-AccountSummaries", () { |
| 3479 unittest.test("to-json--from-json", () { |
| 3480 var o = buildAccountSummaries(); |
| 3481 var od = new api.AccountSummaries.fromJson(o.toJson()); |
| 3482 checkAccountSummaries(od); |
| 3483 }); |
| 3484 }); |
| 3485 |
| 3486 |
| 3487 unittest.group("obj-schema-AccountSummary", () { |
| 3488 unittest.test("to-json--from-json", () { |
| 3489 var o = buildAccountSummary(); |
| 3490 var od = new api.AccountSummary.fromJson(o.toJson()); |
| 3491 checkAccountSummary(od); |
| 3492 }); |
| 3493 }); |
| 3494 |
| 3495 |
| 3496 unittest.group("obj-schema-AccountTicket", () { |
| 3497 unittest.test("to-json--from-json", () { |
| 3498 var o = buildAccountTicket(); |
| 3499 var od = new api.AccountTicket.fromJson(o.toJson()); |
| 3500 checkAccountTicket(od); |
| 3501 }); |
| 3502 }); |
| 3503 |
| 3504 |
| 3505 unittest.group("obj-schema-Accounts", () { |
| 3506 unittest.test("to-json--from-json", () { |
| 3507 var o = buildAccounts(); |
| 3508 var od = new api.Accounts.fromJson(o.toJson()); |
| 3509 checkAccounts(od); |
| 3510 }); |
| 3511 }); |
| 3512 |
| 3513 |
| 3514 unittest.group("obj-schema-AdWordsAccount", () { |
| 3515 unittest.test("to-json--from-json", () { |
| 3516 var o = buildAdWordsAccount(); |
| 3517 var od = new api.AdWordsAccount.fromJson(o.toJson()); |
| 3518 checkAdWordsAccount(od); |
| 3519 }); |
| 3520 }); |
| 3521 |
| 3522 |
| 3523 unittest.group("obj-schema-AnalyticsDataimportDeleteUploadDataRequest", () { |
| 3524 unittest.test("to-json--from-json", () { |
| 3525 var o = buildAnalyticsDataimportDeleteUploadDataRequest(); |
| 3526 var od = new api.AnalyticsDataimportDeleteUploadDataRequest.fromJson(o.toJ
son()); |
| 3527 checkAnalyticsDataimportDeleteUploadDataRequest(od); |
| 3528 }); |
| 3529 }); |
| 3530 |
| 3531 |
| 3532 unittest.group("obj-schema-Column", () { |
| 3533 unittest.test("to-json--from-json", () { |
| 3534 var o = buildColumn(); |
| 3535 var od = new api.Column.fromJson(o.toJson()); |
| 3536 checkColumn(od); |
| 3537 }); |
| 3538 }); |
| 3539 |
| 3540 |
| 3541 unittest.group("obj-schema-Columns", () { |
| 3542 unittest.test("to-json--from-json", () { |
| 3543 var o = buildColumns(); |
| 3544 var od = new api.Columns.fromJson(o.toJson()); |
| 3545 checkColumns(od); |
| 3546 }); |
| 3547 }); |
| 3548 |
| 3549 |
| 3550 unittest.group("obj-schema-CustomDataSourceChildLink", () { |
| 3551 unittest.test("to-json--from-json", () { |
| 3552 var o = buildCustomDataSourceChildLink(); |
| 3553 var od = new api.CustomDataSourceChildLink.fromJson(o.toJson()); |
| 3554 checkCustomDataSourceChildLink(od); |
| 3555 }); |
| 3556 }); |
| 3557 |
| 3558 |
| 3559 unittest.group("obj-schema-CustomDataSourceParentLink", () { |
| 3560 unittest.test("to-json--from-json", () { |
| 3561 var o = buildCustomDataSourceParentLink(); |
| 3562 var od = new api.CustomDataSourceParentLink.fromJson(o.toJson()); |
| 3563 checkCustomDataSourceParentLink(od); |
| 3564 }); |
| 3565 }); |
| 3566 |
| 3567 |
| 3568 unittest.group("obj-schema-CustomDataSource", () { |
| 3569 unittest.test("to-json--from-json", () { |
| 3570 var o = buildCustomDataSource(); |
| 3571 var od = new api.CustomDataSource.fromJson(o.toJson()); |
| 3572 checkCustomDataSource(od); |
| 3573 }); |
| 3574 }); |
| 3575 |
| 3576 |
| 3577 unittest.group("obj-schema-CustomDataSources", () { |
| 3578 unittest.test("to-json--from-json", () { |
| 3579 var o = buildCustomDataSources(); |
| 3580 var od = new api.CustomDataSources.fromJson(o.toJson()); |
| 3581 checkCustomDataSources(od); |
| 3582 }); |
| 3583 }); |
| 3584 |
| 3585 |
| 3586 unittest.group("obj-schema-DailyUploadParentLink", () { |
| 3587 unittest.test("to-json--from-json", () { |
| 3588 var o = buildDailyUploadParentLink(); |
| 3589 var od = new api.DailyUploadParentLink.fromJson(o.toJson()); |
| 3590 checkDailyUploadParentLink(od); |
| 3591 }); |
| 3592 }); |
| 3593 |
| 3594 |
| 3595 unittest.group("obj-schema-DailyUploadRecentChanges", () { |
| 3596 unittest.test("to-json--from-json", () { |
| 3597 var o = buildDailyUploadRecentChanges(); |
| 3598 var od = new api.DailyUploadRecentChanges.fromJson(o.toJson()); |
| 3599 checkDailyUploadRecentChanges(od); |
| 3600 }); |
| 3601 }); |
| 3602 |
| 3603 |
| 3604 unittest.group("obj-schema-DailyUpload", () { |
| 3605 unittest.test("to-json--from-json", () { |
| 3606 var o = buildDailyUpload(); |
| 3607 var od = new api.DailyUpload.fromJson(o.toJson()); |
| 3608 checkDailyUpload(od); |
| 3609 }); |
| 3610 }); |
| 3611 |
| 3612 |
| 3613 unittest.group("obj-schema-DailyUploadAppend", () { |
| 3614 unittest.test("to-json--from-json", () { |
| 3615 var o = buildDailyUploadAppend(); |
| 3616 var od = new api.DailyUploadAppend.fromJson(o.toJson()); |
| 3617 checkDailyUploadAppend(od); |
| 3618 }); |
| 3619 }); |
| 3620 |
| 3621 |
| 3622 unittest.group("obj-schema-DailyUploads", () { |
| 3623 unittest.test("to-json--from-json", () { |
| 3624 var o = buildDailyUploads(); |
| 3625 var od = new api.DailyUploads.fromJson(o.toJson()); |
| 3626 checkDailyUploads(od); |
| 3627 }); |
| 3628 }); |
| 3629 |
| 3630 |
| 3631 unittest.group("obj-schema-EntityAdWordsLinkEntity", () { |
| 3632 unittest.test("to-json--from-json", () { |
| 3633 var o = buildEntityAdWordsLinkEntity(); |
| 3634 var od = new api.EntityAdWordsLinkEntity.fromJson(o.toJson()); |
| 3635 checkEntityAdWordsLinkEntity(od); |
| 3636 }); |
| 3637 }); |
| 3638 |
| 3639 |
| 3640 unittest.group("obj-schema-EntityAdWordsLink", () { |
| 3641 unittest.test("to-json--from-json", () { |
| 3642 var o = buildEntityAdWordsLink(); |
| 3643 var od = new api.EntityAdWordsLink.fromJson(o.toJson()); |
| 3644 checkEntityAdWordsLink(od); |
| 3645 }); |
| 3646 }); |
| 3647 |
| 3648 |
| 3649 unittest.group("obj-schema-EntityAdWordsLinks", () { |
| 3650 unittest.test("to-json--from-json", () { |
| 3651 var o = buildEntityAdWordsLinks(); |
| 3652 var od = new api.EntityAdWordsLinks.fromJson(o.toJson()); |
| 3653 checkEntityAdWordsLinks(od); |
| 3654 }); |
| 3655 }); |
| 3656 |
| 3657 |
| 3658 unittest.group("obj-schema-EntityUserLinkEntity", () { |
| 3659 unittest.test("to-json--from-json", () { |
| 3660 var o = buildEntityUserLinkEntity(); |
| 3661 var od = new api.EntityUserLinkEntity.fromJson(o.toJson()); |
| 3662 checkEntityUserLinkEntity(od); |
| 3663 }); |
| 3664 }); |
| 3665 |
| 3666 |
| 3667 unittest.group("obj-schema-EntityUserLinkPermissions", () { |
| 3668 unittest.test("to-json--from-json", () { |
| 3669 var o = buildEntityUserLinkPermissions(); |
| 3670 var od = new api.EntityUserLinkPermissions.fromJson(o.toJson()); |
| 3671 checkEntityUserLinkPermissions(od); |
| 3672 }); |
| 3673 }); |
| 3674 |
| 3675 |
| 3676 unittest.group("obj-schema-EntityUserLink", () { |
| 3677 unittest.test("to-json--from-json", () { |
| 3678 var o = buildEntityUserLink(); |
| 3679 var od = new api.EntityUserLink.fromJson(o.toJson()); |
| 3680 checkEntityUserLink(od); |
| 3681 }); |
| 3682 }); |
| 3683 |
| 3684 |
| 3685 unittest.group("obj-schema-EntityUserLinks", () { |
| 3686 unittest.test("to-json--from-json", () { |
| 3687 var o = buildEntityUserLinks(); |
| 3688 var od = new api.EntityUserLinks.fromJson(o.toJson()); |
| 3689 checkEntityUserLinks(od); |
| 3690 }); |
| 3691 }); |
| 3692 |
| 3693 |
| 3694 unittest.group("obj-schema-ExperimentParentLink", () { |
| 3695 unittest.test("to-json--from-json", () { |
| 3696 var o = buildExperimentParentLink(); |
| 3697 var od = new api.ExperimentParentLink.fromJson(o.toJson()); |
| 3698 checkExperimentParentLink(od); |
| 3699 }); |
| 3700 }); |
| 3701 |
| 3702 |
| 3703 unittest.group("obj-schema-ExperimentVariations", () { |
| 3704 unittest.test("to-json--from-json", () { |
| 3705 var o = buildExperimentVariations(); |
| 3706 var od = new api.ExperimentVariations.fromJson(o.toJson()); |
| 3707 checkExperimentVariations(od); |
| 3708 }); |
| 3709 }); |
| 3710 |
| 3711 |
| 3712 unittest.group("obj-schema-Experiment", () { |
| 3713 unittest.test("to-json--from-json", () { |
| 3714 var o = buildExperiment(); |
| 3715 var od = new api.Experiment.fromJson(o.toJson()); |
| 3716 checkExperiment(od); |
| 3717 }); |
| 3718 }); |
| 3719 |
| 3720 |
| 3721 unittest.group("obj-schema-Experiments", () { |
| 3722 unittest.test("to-json--from-json", () { |
| 3723 var o = buildExperiments(); |
| 3724 var od = new api.Experiments.fromJson(o.toJson()); |
| 3725 checkExperiments(od); |
| 3726 }); |
| 3727 }); |
| 3728 |
| 3729 |
| 3730 unittest.group("obj-schema-FilterAdvancedDetails", () { |
| 3731 unittest.test("to-json--from-json", () { |
| 3732 var o = buildFilterAdvancedDetails(); |
| 3733 var od = new api.FilterAdvancedDetails.fromJson(o.toJson()); |
| 3734 checkFilterAdvancedDetails(od); |
| 3735 }); |
| 3736 }); |
| 3737 |
| 3738 |
| 3739 unittest.group("obj-schema-FilterLowercaseDetails", () { |
| 3740 unittest.test("to-json--from-json", () { |
| 3741 var o = buildFilterLowercaseDetails(); |
| 3742 var od = new api.FilterLowercaseDetails.fromJson(o.toJson()); |
| 3743 checkFilterLowercaseDetails(od); |
| 3744 }); |
| 3745 }); |
| 3746 |
| 3747 |
| 3748 unittest.group("obj-schema-FilterParentLink", () { |
| 3749 unittest.test("to-json--from-json", () { |
| 3750 var o = buildFilterParentLink(); |
| 3751 var od = new api.FilterParentLink.fromJson(o.toJson()); |
| 3752 checkFilterParentLink(od); |
| 3753 }); |
| 3754 }); |
| 3755 |
| 3756 |
| 3757 unittest.group("obj-schema-FilterSearchAndReplaceDetails", () { |
| 3758 unittest.test("to-json--from-json", () { |
| 3759 var o = buildFilterSearchAndReplaceDetails(); |
| 3760 var od = new api.FilterSearchAndReplaceDetails.fromJson(o.toJson()); |
| 3761 checkFilterSearchAndReplaceDetails(od); |
| 3762 }); |
| 3763 }); |
| 3764 |
| 3765 |
| 3766 unittest.group("obj-schema-FilterUppercaseDetails", () { |
| 3767 unittest.test("to-json--from-json", () { |
| 3768 var o = buildFilterUppercaseDetails(); |
| 3769 var od = new api.FilterUppercaseDetails.fromJson(o.toJson()); |
| 3770 checkFilterUppercaseDetails(od); |
| 3771 }); |
| 3772 }); |
| 3773 |
| 3774 |
| 3775 unittest.group("obj-schema-Filter", () { |
| 3776 unittest.test("to-json--from-json", () { |
| 3777 var o = buildFilter(); |
| 3778 var od = new api.Filter.fromJson(o.toJson()); |
| 3779 checkFilter(od); |
| 3780 }); |
| 3781 }); |
| 3782 |
| 3783 |
| 3784 unittest.group("obj-schema-FilterExpression", () { |
| 3785 unittest.test("to-json--from-json", () { |
| 3786 var o = buildFilterExpression(); |
| 3787 var od = new api.FilterExpression.fromJson(o.toJson()); |
| 3788 checkFilterExpression(od); |
| 3789 }); |
| 3790 }); |
| 3791 |
| 3792 |
| 3793 unittest.group("obj-schema-FilterRef", () { |
| 3794 unittest.test("to-json--from-json", () { |
| 3795 var o = buildFilterRef(); |
| 3796 var od = new api.FilterRef.fromJson(o.toJson()); |
| 3797 checkFilterRef(od); |
| 3798 }); |
| 3799 }); |
| 3800 |
| 3801 |
| 3802 unittest.group("obj-schema-Filters", () { |
| 3803 unittest.test("to-json--from-json", () { |
| 3804 var o = buildFilters(); |
| 3805 var od = new api.Filters.fromJson(o.toJson()); |
| 3806 checkFilters(od); |
| 3807 }); |
| 3808 }); |
| 3809 |
| 3810 |
| 3811 unittest.group("obj-schema-GaDataColumnHeaders", () { |
| 3812 unittest.test("to-json--from-json", () { |
| 3813 var o = buildGaDataColumnHeaders(); |
| 3814 var od = new api.GaDataColumnHeaders.fromJson(o.toJson()); |
| 3815 checkGaDataColumnHeaders(od); |
| 3816 }); |
| 3817 }); |
| 3818 |
| 3819 |
| 3820 unittest.group("obj-schema-GaDataDataTableCols", () { |
| 3821 unittest.test("to-json--from-json", () { |
| 3822 var o = buildGaDataDataTableCols(); |
| 3823 var od = new api.GaDataDataTableCols.fromJson(o.toJson()); |
| 3824 checkGaDataDataTableCols(od); |
| 3825 }); |
| 3826 }); |
| 3827 |
| 3828 |
| 3829 unittest.group("obj-schema-GaDataDataTableRowsC", () { |
| 3830 unittest.test("to-json--from-json", () { |
| 3831 var o = buildGaDataDataTableRowsC(); |
| 3832 var od = new api.GaDataDataTableRowsC.fromJson(o.toJson()); |
| 3833 checkGaDataDataTableRowsC(od); |
| 3834 }); |
| 3835 }); |
| 3836 |
| 3837 |
| 3838 unittest.group("obj-schema-GaDataDataTableRows", () { |
| 3839 unittest.test("to-json--from-json", () { |
| 3840 var o = buildGaDataDataTableRows(); |
| 3841 var od = new api.GaDataDataTableRows.fromJson(o.toJson()); |
| 3842 checkGaDataDataTableRows(od); |
| 3843 }); |
| 3844 }); |
| 3845 |
| 3846 |
| 3847 unittest.group("obj-schema-GaDataDataTable", () { |
| 3848 unittest.test("to-json--from-json", () { |
| 3849 var o = buildGaDataDataTable(); |
| 3850 var od = new api.GaDataDataTable.fromJson(o.toJson()); |
| 3851 checkGaDataDataTable(od); |
| 3852 }); |
| 3853 }); |
| 3854 |
| 3855 |
| 3856 unittest.group("obj-schema-GaDataProfileInfo", () { |
| 3857 unittest.test("to-json--from-json", () { |
| 3858 var o = buildGaDataProfileInfo(); |
| 3859 var od = new api.GaDataProfileInfo.fromJson(o.toJson()); |
| 3860 checkGaDataProfileInfo(od); |
| 3861 }); |
| 3862 }); |
| 3863 |
| 3864 |
| 3865 unittest.group("obj-schema-GaDataQuery", () { |
| 3866 unittest.test("to-json--from-json", () { |
| 3867 var o = buildGaDataQuery(); |
| 3868 var od = new api.GaDataQuery.fromJson(o.toJson()); |
| 3869 checkGaDataQuery(od); |
| 3870 }); |
| 3871 }); |
| 3872 |
| 3873 |
| 3874 unittest.group("obj-schema-GaData", () { |
| 3875 unittest.test("to-json--from-json", () { |
| 3876 var o = buildGaData(); |
| 3877 var od = new api.GaData.fromJson(o.toJson()); |
| 3878 checkGaData(od); |
| 3879 }); |
| 3880 }); |
| 3881 |
| 3882 |
| 3883 unittest.group("obj-schema-GoalEventDetailsEventConditions", () { |
| 3884 unittest.test("to-json--from-json", () { |
| 3885 var o = buildGoalEventDetailsEventConditions(); |
| 3886 var od = new api.GoalEventDetailsEventConditions.fromJson(o.toJson()); |
| 3887 checkGoalEventDetailsEventConditions(od); |
| 3888 }); |
| 3889 }); |
| 3890 |
| 3891 |
| 3892 unittest.group("obj-schema-GoalEventDetails", () { |
| 3893 unittest.test("to-json--from-json", () { |
| 3894 var o = buildGoalEventDetails(); |
| 3895 var od = new api.GoalEventDetails.fromJson(o.toJson()); |
| 3896 checkGoalEventDetails(od); |
| 3897 }); |
| 3898 }); |
| 3899 |
| 3900 |
| 3901 unittest.group("obj-schema-GoalParentLink", () { |
| 3902 unittest.test("to-json--from-json", () { |
| 3903 var o = buildGoalParentLink(); |
| 3904 var od = new api.GoalParentLink.fromJson(o.toJson()); |
| 3905 checkGoalParentLink(od); |
| 3906 }); |
| 3907 }); |
| 3908 |
| 3909 |
| 3910 unittest.group("obj-schema-GoalUrlDestinationDetailsSteps", () { |
| 3911 unittest.test("to-json--from-json", () { |
| 3912 var o = buildGoalUrlDestinationDetailsSteps(); |
| 3913 var od = new api.GoalUrlDestinationDetailsSteps.fromJson(o.toJson()); |
| 3914 checkGoalUrlDestinationDetailsSteps(od); |
| 3915 }); |
| 3916 }); |
| 3917 |
| 3918 |
| 3919 unittest.group("obj-schema-GoalUrlDestinationDetails", () { |
| 3920 unittest.test("to-json--from-json", () { |
| 3921 var o = buildGoalUrlDestinationDetails(); |
| 3922 var od = new api.GoalUrlDestinationDetails.fromJson(o.toJson()); |
| 3923 checkGoalUrlDestinationDetails(od); |
| 3924 }); |
| 3925 }); |
| 3926 |
| 3927 |
| 3928 unittest.group("obj-schema-GoalVisitNumPagesDetails", () { |
| 3929 unittest.test("to-json--from-json", () { |
| 3930 var o = buildGoalVisitNumPagesDetails(); |
| 3931 var od = new api.GoalVisitNumPagesDetails.fromJson(o.toJson()); |
| 3932 checkGoalVisitNumPagesDetails(od); |
| 3933 }); |
| 3934 }); |
| 3935 |
| 3936 |
| 3937 unittest.group("obj-schema-GoalVisitTimeOnSiteDetails", () { |
| 3938 unittest.test("to-json--from-json", () { |
| 3939 var o = buildGoalVisitTimeOnSiteDetails(); |
| 3940 var od = new api.GoalVisitTimeOnSiteDetails.fromJson(o.toJson()); |
| 3941 checkGoalVisitTimeOnSiteDetails(od); |
| 3942 }); |
| 3943 }); |
| 3944 |
| 3945 |
| 3946 unittest.group("obj-schema-Goal", () { |
| 3947 unittest.test("to-json--from-json", () { |
| 3948 var o = buildGoal(); |
| 3949 var od = new api.Goal.fromJson(o.toJson()); |
| 3950 checkGoal(od); |
| 3951 }); |
| 3952 }); |
| 3953 |
| 3954 |
| 3955 unittest.group("obj-schema-Goals", () { |
| 3956 unittest.test("to-json--from-json", () { |
| 3957 var o = buildGoals(); |
| 3958 var od = new api.Goals.fromJson(o.toJson()); |
| 3959 checkGoals(od); |
| 3960 }); |
| 3961 }); |
| 3962 |
| 3963 |
| 3964 unittest.group("obj-schema-McfDataColumnHeaders", () { |
| 3965 unittest.test("to-json--from-json", () { |
| 3966 var o = buildMcfDataColumnHeaders(); |
| 3967 var od = new api.McfDataColumnHeaders.fromJson(o.toJson()); |
| 3968 checkMcfDataColumnHeaders(od); |
| 3969 }); |
| 3970 }); |
| 3971 |
| 3972 |
| 3973 unittest.group("obj-schema-McfDataProfileInfo", () { |
| 3974 unittest.test("to-json--from-json", () { |
| 3975 var o = buildMcfDataProfileInfo(); |
| 3976 var od = new api.McfDataProfileInfo.fromJson(o.toJson()); |
| 3977 checkMcfDataProfileInfo(od); |
| 3978 }); |
| 3979 }); |
| 3980 |
| 3981 |
| 3982 unittest.group("obj-schema-McfDataQuery", () { |
| 3983 unittest.test("to-json--from-json", () { |
| 3984 var o = buildMcfDataQuery(); |
| 3985 var od = new api.McfDataQuery.fromJson(o.toJson()); |
| 3986 checkMcfDataQuery(od); |
| 3987 }); |
| 3988 }); |
| 3989 |
| 3990 |
| 3991 unittest.group("obj-schema-McfDataRowsConversionPathValue", () { |
| 3992 unittest.test("to-json--from-json", () { |
| 3993 var o = buildMcfDataRowsConversionPathValue(); |
| 3994 var od = new api.McfDataRowsConversionPathValue.fromJson(o.toJson()); |
| 3995 checkMcfDataRowsConversionPathValue(od); |
| 3996 }); |
| 3997 }); |
| 3998 |
| 3999 |
| 4000 unittest.group("obj-schema-McfDataRows", () { |
| 4001 unittest.test("to-json--from-json", () { |
| 4002 var o = buildMcfDataRows(); |
| 4003 var od = new api.McfDataRows.fromJson(o.toJson()); |
| 4004 checkMcfDataRows(od); |
| 4005 }); |
| 4006 }); |
| 4007 |
| 4008 |
| 4009 unittest.group("obj-schema-McfData", () { |
| 4010 unittest.test("to-json--from-json", () { |
| 4011 var o = buildMcfData(); |
| 4012 var od = new api.McfData.fromJson(o.toJson()); |
| 4013 checkMcfData(od); |
| 4014 }); |
| 4015 }); |
| 4016 |
| 4017 |
| 4018 unittest.group("obj-schema-ProfileChildLink", () { |
| 4019 unittest.test("to-json--from-json", () { |
| 4020 var o = buildProfileChildLink(); |
| 4021 var od = new api.ProfileChildLink.fromJson(o.toJson()); |
| 4022 checkProfileChildLink(od); |
| 4023 }); |
| 4024 }); |
| 4025 |
| 4026 |
| 4027 unittest.group("obj-schema-ProfileParentLink", () { |
| 4028 unittest.test("to-json--from-json", () { |
| 4029 var o = buildProfileParentLink(); |
| 4030 var od = new api.ProfileParentLink.fromJson(o.toJson()); |
| 4031 checkProfileParentLink(od); |
| 4032 }); |
| 4033 }); |
| 4034 |
| 4035 |
| 4036 unittest.group("obj-schema-ProfilePermissions", () { |
| 4037 unittest.test("to-json--from-json", () { |
| 4038 var o = buildProfilePermissions(); |
| 4039 var od = new api.ProfilePermissions.fromJson(o.toJson()); |
| 4040 checkProfilePermissions(od); |
| 4041 }); |
| 4042 }); |
| 4043 |
| 4044 |
| 4045 unittest.group("obj-schema-Profile", () { |
| 4046 unittest.test("to-json--from-json", () { |
| 4047 var o = buildProfile(); |
| 4048 var od = new api.Profile.fromJson(o.toJson()); |
| 4049 checkProfile(od); |
| 4050 }); |
| 4051 }); |
| 4052 |
| 4053 |
| 4054 unittest.group("obj-schema-ProfileFilterLink", () { |
| 4055 unittest.test("to-json--from-json", () { |
| 4056 var o = buildProfileFilterLink(); |
| 4057 var od = new api.ProfileFilterLink.fromJson(o.toJson()); |
| 4058 checkProfileFilterLink(od); |
| 4059 }); |
| 4060 }); |
| 4061 |
| 4062 |
| 4063 unittest.group("obj-schema-ProfileFilterLinks", () { |
| 4064 unittest.test("to-json--from-json", () { |
| 4065 var o = buildProfileFilterLinks(); |
| 4066 var od = new api.ProfileFilterLinks.fromJson(o.toJson()); |
| 4067 checkProfileFilterLinks(od); |
| 4068 }); |
| 4069 }); |
| 4070 |
| 4071 |
| 4072 unittest.group("obj-schema-ProfileRef", () { |
| 4073 unittest.test("to-json--from-json", () { |
| 4074 var o = buildProfileRef(); |
| 4075 var od = new api.ProfileRef.fromJson(o.toJson()); |
| 4076 checkProfileRef(od); |
| 4077 }); |
| 4078 }); |
| 4079 |
| 4080 |
| 4081 unittest.group("obj-schema-ProfileSummary", () { |
| 4082 unittest.test("to-json--from-json", () { |
| 4083 var o = buildProfileSummary(); |
| 4084 var od = new api.ProfileSummary.fromJson(o.toJson()); |
| 4085 checkProfileSummary(od); |
| 4086 }); |
| 4087 }); |
| 4088 |
| 4089 |
| 4090 unittest.group("obj-schema-Profiles", () { |
| 4091 unittest.test("to-json--from-json", () { |
| 4092 var o = buildProfiles(); |
| 4093 var od = new api.Profiles.fromJson(o.toJson()); |
| 4094 checkProfiles(od); |
| 4095 }); |
| 4096 }); |
| 4097 |
| 4098 |
| 4099 unittest.group("obj-schema-RealtimeDataColumnHeaders", () { |
| 4100 unittest.test("to-json--from-json", () { |
| 4101 var o = buildRealtimeDataColumnHeaders(); |
| 4102 var od = new api.RealtimeDataColumnHeaders.fromJson(o.toJson()); |
| 4103 checkRealtimeDataColumnHeaders(od); |
| 4104 }); |
| 4105 }); |
| 4106 |
| 4107 |
| 4108 unittest.group("obj-schema-RealtimeDataProfileInfo", () { |
| 4109 unittest.test("to-json--from-json", () { |
| 4110 var o = buildRealtimeDataProfileInfo(); |
| 4111 var od = new api.RealtimeDataProfileInfo.fromJson(o.toJson()); |
| 4112 checkRealtimeDataProfileInfo(od); |
| 4113 }); |
| 4114 }); |
| 4115 |
| 4116 |
| 4117 unittest.group("obj-schema-RealtimeDataQuery", () { |
| 4118 unittest.test("to-json--from-json", () { |
| 4119 var o = buildRealtimeDataQuery(); |
| 4120 var od = new api.RealtimeDataQuery.fromJson(o.toJson()); |
| 4121 checkRealtimeDataQuery(od); |
| 4122 }); |
| 4123 }); |
| 4124 |
| 4125 |
| 4126 unittest.group("obj-schema-RealtimeData", () { |
| 4127 unittest.test("to-json--from-json", () { |
| 4128 var o = buildRealtimeData(); |
| 4129 var od = new api.RealtimeData.fromJson(o.toJson()); |
| 4130 checkRealtimeData(od); |
| 4131 }); |
| 4132 }); |
| 4133 |
| 4134 |
| 4135 unittest.group("obj-schema-Segment", () { |
| 4136 unittest.test("to-json--from-json", () { |
| 4137 var o = buildSegment(); |
| 4138 var od = new api.Segment.fromJson(o.toJson()); |
| 4139 checkSegment(od); |
| 4140 }); |
| 4141 }); |
| 4142 |
| 4143 |
| 4144 unittest.group("obj-schema-Segments", () { |
| 4145 unittest.test("to-json--from-json", () { |
| 4146 var o = buildSegments(); |
| 4147 var od = new api.Segments.fromJson(o.toJson()); |
| 4148 checkSegments(od); |
| 4149 }); |
| 4150 }); |
| 4151 |
| 4152 |
| 4153 unittest.group("obj-schema-UnsampledReportCloudStorageDownloadDetails", () { |
| 4154 unittest.test("to-json--from-json", () { |
| 4155 var o = buildUnsampledReportCloudStorageDownloadDetails(); |
| 4156 var od = new api.UnsampledReportCloudStorageDownloadDetails.fromJson(o.toJ
son()); |
| 4157 checkUnsampledReportCloudStorageDownloadDetails(od); |
| 4158 }); |
| 4159 }); |
| 4160 |
| 4161 |
| 4162 unittest.group("obj-schema-UnsampledReportDriveDownloadDetails", () { |
| 4163 unittest.test("to-json--from-json", () { |
| 4164 var o = buildUnsampledReportDriveDownloadDetails(); |
| 4165 var od = new api.UnsampledReportDriveDownloadDetails.fromJson(o.toJson()); |
| 4166 checkUnsampledReportDriveDownloadDetails(od); |
| 4167 }); |
| 4168 }); |
| 4169 |
| 4170 |
| 4171 unittest.group("obj-schema-UnsampledReport", () { |
| 4172 unittest.test("to-json--from-json", () { |
| 4173 var o = buildUnsampledReport(); |
| 4174 var od = new api.UnsampledReport.fromJson(o.toJson()); |
| 4175 checkUnsampledReport(od); |
| 4176 }); |
| 4177 }); |
| 4178 |
| 4179 |
| 4180 unittest.group("obj-schema-UnsampledReports", () { |
| 4181 unittest.test("to-json--from-json", () { |
| 4182 var o = buildUnsampledReports(); |
| 4183 var od = new api.UnsampledReports.fromJson(o.toJson()); |
| 4184 checkUnsampledReports(od); |
| 4185 }); |
| 4186 }); |
| 4187 |
| 4188 |
| 4189 unittest.group("obj-schema-Upload", () { |
| 4190 unittest.test("to-json--from-json", () { |
| 4191 var o = buildUpload(); |
| 4192 var od = new api.Upload.fromJson(o.toJson()); |
| 4193 checkUpload(od); |
| 4194 }); |
| 4195 }); |
| 4196 |
| 4197 |
| 4198 unittest.group("obj-schema-Uploads", () { |
| 4199 unittest.test("to-json--from-json", () { |
| 4200 var o = buildUploads(); |
| 4201 var od = new api.Uploads.fromJson(o.toJson()); |
| 4202 checkUploads(od); |
| 4203 }); |
| 4204 }); |
| 4205 |
| 4206 |
| 4207 unittest.group("obj-schema-UserRef", () { |
| 4208 unittest.test("to-json--from-json", () { |
| 4209 var o = buildUserRef(); |
| 4210 var od = new api.UserRef.fromJson(o.toJson()); |
| 4211 checkUserRef(od); |
| 4212 }); |
| 4213 }); |
| 4214 |
| 4215 |
| 4216 unittest.group("obj-schema-WebPropertyRef", () { |
| 4217 unittest.test("to-json--from-json", () { |
| 4218 var o = buildWebPropertyRef(); |
| 4219 var od = new api.WebPropertyRef.fromJson(o.toJson()); |
| 4220 checkWebPropertyRef(od); |
| 4221 }); |
| 4222 }); |
| 4223 |
| 4224 |
| 4225 unittest.group("obj-schema-WebPropertySummary", () { |
| 4226 unittest.test("to-json--from-json", () { |
| 4227 var o = buildWebPropertySummary(); |
| 4228 var od = new api.WebPropertySummary.fromJson(o.toJson()); |
| 4229 checkWebPropertySummary(od); |
| 4230 }); |
| 4231 }); |
| 4232 |
| 4233 |
| 4234 unittest.group("obj-schema-Webproperties", () { |
| 4235 unittest.test("to-json--from-json", () { |
| 4236 var o = buildWebproperties(); |
| 4237 var od = new api.Webproperties.fromJson(o.toJson()); |
| 4238 checkWebproperties(od); |
| 4239 }); |
| 4240 }); |
| 4241 |
| 4242 |
| 4243 unittest.group("obj-schema-WebpropertyChildLink", () { |
| 4244 unittest.test("to-json--from-json", () { |
| 4245 var o = buildWebpropertyChildLink(); |
| 4246 var od = new api.WebpropertyChildLink.fromJson(o.toJson()); |
| 4247 checkWebpropertyChildLink(od); |
| 4248 }); |
| 4249 }); |
| 4250 |
| 4251 |
| 4252 unittest.group("obj-schema-WebpropertyParentLink", () { |
| 4253 unittest.test("to-json--from-json", () { |
| 4254 var o = buildWebpropertyParentLink(); |
| 4255 var od = new api.WebpropertyParentLink.fromJson(o.toJson()); |
| 4256 checkWebpropertyParentLink(od); |
| 4257 }); |
| 4258 }); |
| 4259 |
| 4260 |
| 4261 unittest.group("obj-schema-WebpropertyPermissions", () { |
| 4262 unittest.test("to-json--from-json", () { |
| 4263 var o = buildWebpropertyPermissions(); |
| 4264 var od = new api.WebpropertyPermissions.fromJson(o.toJson()); |
| 4265 checkWebpropertyPermissions(od); |
| 4266 }); |
| 4267 }); |
| 4268 |
| 4269 |
| 4270 unittest.group("obj-schema-Webproperty", () { |
| 4271 unittest.test("to-json--from-json", () { |
| 4272 var o = buildWebproperty(); |
| 4273 var od = new api.Webproperty.fromJson(o.toJson()); |
| 4274 checkWebproperty(od); |
| 4275 }); |
| 4276 }); |
| 4277 |
| 4278 |
| 4279 unittest.group("resource-DataGaResourceApi", () { |
| 4280 unittest.test("method--get", () { |
| 4281 |
| 4282 var mock = new common_test.HttpServerMock(); |
| 4283 api.DataGaResourceApi res = new api.AnalyticsApi(mock).data.ga; |
| 4284 var arg_ids = "foo"; |
| 4285 var arg_start_date = "foo"; |
| 4286 var arg_end_date = "foo"; |
| 4287 var arg_metrics = "foo"; |
| 4288 var arg_dimensions = "foo"; |
| 4289 var arg_filters = "foo"; |
| 4290 var arg_max_results = 42; |
| 4291 var arg_output = "foo"; |
| 4292 var arg_samplingLevel = "foo"; |
| 4293 var arg_segment = "foo"; |
| 4294 var arg_sort = "foo"; |
| 4295 var arg_start_index = 42; |
| 4296 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 4297 var path = (req.url).path; |
| 4298 var pathOffset = 0; |
| 4299 var index; |
| 4300 var subPart; |
| 4301 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 4302 pathOffset += 14; |
| 4303 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("data/ga")); |
| 4304 pathOffset += 7; |
| 4305 |
| 4306 var query = (req.url).query; |
| 4307 var queryOffset = 0; |
| 4308 var queryMap = {}; |
| 4309 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4310 parseBool(n) { |
| 4311 if (n == "true") return true; |
| 4312 if (n == "false") return false; |
| 4313 if (n == null) return null; |
| 4314 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4315 } |
| 4316 if (query.length > 0) { |
| 4317 for (var part in query.split("&")) { |
| 4318 var keyvalue = part.split("="); |
| 4319 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 4320 } |
| 4321 } |
| 4322 unittest.expect(queryMap["ids"].first, unittest.equals(arg_ids)); |
| 4323 unittest.expect(queryMap["start-date"].first, unittest.equals(arg_start_
date)); |
| 4324 unittest.expect(queryMap["end-date"].first, unittest.equals(arg_end_date
)); |
| 4325 unittest.expect(queryMap["metrics"].first, unittest.equals(arg_metrics))
; |
| 4326 unittest.expect(queryMap["dimensions"].first, unittest.equals(arg_dimens
ions)); |
| 4327 unittest.expect(queryMap["filters"].first, unittest.equals(arg_filters))
; |
| 4328 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 4329 unittest.expect(queryMap["output"].first, unittest.equals(arg_output)); |
| 4330 unittest.expect(queryMap["samplingLevel"].first, unittest.equals(arg_sam
plingLevel)); |
| 4331 unittest.expect(queryMap["segment"].first, unittest.equals(arg_segment))
; |
| 4332 unittest.expect(queryMap["sort"].first, unittest.equals(arg_sort)); |
| 4333 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 4334 |
| 4335 |
| 4336 var h = { |
| 4337 "content-type" : "application/json; charset=utf-8", |
| 4338 }; |
| 4339 var resp = convert.JSON.encode(buildGaData()); |
| 4340 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 4341 }), true); |
| 4342 res.get(arg_ids, arg_start_date, arg_end_date, arg_metrics, dimensions: ar
g_dimensions, filters: arg_filters, max_results: arg_max_results, output: arg_ou
tput, samplingLevel: arg_samplingLevel, segment: arg_segment, sort: arg_sort, st
art_index: arg_start_index).then(unittest.expectAsync(((api.GaData response) { |
| 4343 checkGaData(response); |
| 4344 }))); |
| 4345 }); |
| 4346 |
| 4347 }); |
| 4348 |
| 4349 |
| 4350 unittest.group("resource-DataMcfResourceApi", () { |
| 4351 unittest.test("method--get", () { |
| 4352 |
| 4353 var mock = new common_test.HttpServerMock(); |
| 4354 api.DataMcfResourceApi res = new api.AnalyticsApi(mock).data.mcf; |
| 4355 var arg_ids = "foo"; |
| 4356 var arg_start_date = "foo"; |
| 4357 var arg_end_date = "foo"; |
| 4358 var arg_metrics = "foo"; |
| 4359 var arg_dimensions = "foo"; |
| 4360 var arg_filters = "foo"; |
| 4361 var arg_max_results = 42; |
| 4362 var arg_samplingLevel = "foo"; |
| 4363 var arg_sort = "foo"; |
| 4364 var arg_start_index = 42; |
| 4365 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 4366 var path = (req.url).path; |
| 4367 var pathOffset = 0; |
| 4368 var index; |
| 4369 var subPart; |
| 4370 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 4371 pathOffset += 14; |
| 4372 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("data/mcf")); |
| 4373 pathOffset += 8; |
| 4374 |
| 4375 var query = (req.url).query; |
| 4376 var queryOffset = 0; |
| 4377 var queryMap = {}; |
| 4378 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4379 parseBool(n) { |
| 4380 if (n == "true") return true; |
| 4381 if (n == "false") return false; |
| 4382 if (n == null) return null; |
| 4383 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4384 } |
| 4385 if (query.length > 0) { |
| 4386 for (var part in query.split("&")) { |
| 4387 var keyvalue = part.split("="); |
| 4388 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 4389 } |
| 4390 } |
| 4391 unittest.expect(queryMap["ids"].first, unittest.equals(arg_ids)); |
| 4392 unittest.expect(queryMap["start-date"].first, unittest.equals(arg_start_
date)); |
| 4393 unittest.expect(queryMap["end-date"].first, unittest.equals(arg_end_date
)); |
| 4394 unittest.expect(queryMap["metrics"].first, unittest.equals(arg_metrics))
; |
| 4395 unittest.expect(queryMap["dimensions"].first, unittest.equals(arg_dimens
ions)); |
| 4396 unittest.expect(queryMap["filters"].first, unittest.equals(arg_filters))
; |
| 4397 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 4398 unittest.expect(queryMap["samplingLevel"].first, unittest.equals(arg_sam
plingLevel)); |
| 4399 unittest.expect(queryMap["sort"].first, unittest.equals(arg_sort)); |
| 4400 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 4401 |
| 4402 |
| 4403 var h = { |
| 4404 "content-type" : "application/json; charset=utf-8", |
| 4405 }; |
| 4406 var resp = convert.JSON.encode(buildMcfData()); |
| 4407 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 4408 }), true); |
| 4409 res.get(arg_ids, arg_start_date, arg_end_date, arg_metrics, dimensions: ar
g_dimensions, filters: arg_filters, max_results: arg_max_results, samplingLevel:
arg_samplingLevel, sort: arg_sort, start_index: arg_start_index).then(unittest.
expectAsync(((api.McfData response) { |
| 4410 checkMcfData(response); |
| 4411 }))); |
| 4412 }); |
| 4413 |
| 4414 }); |
| 4415 |
| 4416 |
| 4417 unittest.group("resource-DataRealtimeResourceApi", () { |
| 4418 unittest.test("method--get", () { |
| 4419 |
| 4420 var mock = new common_test.HttpServerMock(); |
| 4421 api.DataRealtimeResourceApi res = new api.AnalyticsApi(mock).data.realtime
; |
| 4422 var arg_ids = "foo"; |
| 4423 var arg_metrics = "foo"; |
| 4424 var arg_dimensions = "foo"; |
| 4425 var arg_filters = "foo"; |
| 4426 var arg_max_results = 42; |
| 4427 var arg_sort = "foo"; |
| 4428 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 4429 var path = (req.url).path; |
| 4430 var pathOffset = 0; |
| 4431 var index; |
| 4432 var subPart; |
| 4433 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 4434 pathOffset += 14; |
| 4435 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("data/realtime")); |
| 4436 pathOffset += 13; |
| 4437 |
| 4438 var query = (req.url).query; |
| 4439 var queryOffset = 0; |
| 4440 var queryMap = {}; |
| 4441 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4442 parseBool(n) { |
| 4443 if (n == "true") return true; |
| 4444 if (n == "false") return false; |
| 4445 if (n == null) return null; |
| 4446 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4447 } |
| 4448 if (query.length > 0) { |
| 4449 for (var part in query.split("&")) { |
| 4450 var keyvalue = part.split("="); |
| 4451 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 4452 } |
| 4453 } |
| 4454 unittest.expect(queryMap["ids"].first, unittest.equals(arg_ids)); |
| 4455 unittest.expect(queryMap["metrics"].first, unittest.equals(arg_metrics))
; |
| 4456 unittest.expect(queryMap["dimensions"].first, unittest.equals(arg_dimens
ions)); |
| 4457 unittest.expect(queryMap["filters"].first, unittest.equals(arg_filters))
; |
| 4458 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 4459 unittest.expect(queryMap["sort"].first, unittest.equals(arg_sort)); |
| 4460 |
| 4461 |
| 4462 var h = { |
| 4463 "content-type" : "application/json; charset=utf-8", |
| 4464 }; |
| 4465 var resp = convert.JSON.encode(buildRealtimeData()); |
| 4466 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 4467 }), true); |
| 4468 res.get(arg_ids, arg_metrics, dimensions: arg_dimensions, filters: arg_fil
ters, max_results: arg_max_results, sort: arg_sort).then(unittest.expectAsync(((
api.RealtimeData response) { |
| 4469 checkRealtimeData(response); |
| 4470 }))); |
| 4471 }); |
| 4472 |
| 4473 }); |
| 4474 |
| 4475 |
| 4476 unittest.group("resource-ManagementAccountSummariesResourceApi", () { |
| 4477 unittest.test("method--list", () { |
| 4478 |
| 4479 var mock = new common_test.HttpServerMock(); |
| 4480 api.ManagementAccountSummariesResourceApi res = new api.AnalyticsApi(mock)
.management.accountSummaries; |
| 4481 var arg_max_results = 42; |
| 4482 var arg_start_index = 42; |
| 4483 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 4484 var path = (req.url).path; |
| 4485 var pathOffset = 0; |
| 4486 var index; |
| 4487 var subPart; |
| 4488 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 4489 pathOffset += 14; |
| 4490 unittest.expect(path.substring(pathOffset, pathOffset + 27), unittest.eq
uals("management/accountSummaries")); |
| 4491 pathOffset += 27; |
| 4492 |
| 4493 var query = (req.url).query; |
| 4494 var queryOffset = 0; |
| 4495 var queryMap = {}; |
| 4496 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4497 parseBool(n) { |
| 4498 if (n == "true") return true; |
| 4499 if (n == "false") return false; |
| 4500 if (n == null) return null; |
| 4501 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4502 } |
| 4503 if (query.length > 0) { |
| 4504 for (var part in query.split("&")) { |
| 4505 var keyvalue = part.split("="); |
| 4506 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 4507 } |
| 4508 } |
| 4509 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 4510 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 4511 |
| 4512 |
| 4513 var h = { |
| 4514 "content-type" : "application/json; charset=utf-8", |
| 4515 }; |
| 4516 var resp = convert.JSON.encode(buildAccountSummaries()); |
| 4517 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 4518 }), true); |
| 4519 res.list(max_results: arg_max_results, start_index: arg_start_index).then(
unittest.expectAsync(((api.AccountSummaries response) { |
| 4520 checkAccountSummaries(response); |
| 4521 }))); |
| 4522 }); |
| 4523 |
| 4524 }); |
| 4525 |
| 4526 |
| 4527 unittest.group("resource-ManagementAccountUserLinksResourceApi", () { |
| 4528 unittest.test("method--delete", () { |
| 4529 |
| 4530 var mock = new common_test.HttpServerMock(); |
| 4531 api.ManagementAccountUserLinksResourceApi res = new api.AnalyticsApi(mock)
.management.accountUserLinks; |
| 4532 var arg_accountId = "foo"; |
| 4533 var arg_linkId = "foo"; |
| 4534 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 4535 var path = (req.url).path; |
| 4536 var pathOffset = 0; |
| 4537 var index; |
| 4538 var subPart; |
| 4539 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 4540 pathOffset += 14; |
| 4541 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 4542 pathOffset += 20; |
| 4543 index = path.indexOf("/entityUserLinks/", pathOffset); |
| 4544 unittest.expect(index >= 0, unittest.isTrue); |
| 4545 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 4546 pathOffset = index; |
| 4547 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 4548 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/entityUserLinks/")); |
| 4549 pathOffset += 17; |
| 4550 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 4551 pathOffset = path.length; |
| 4552 unittest.expect(subPart, unittest.equals("$arg_linkId")); |
| 4553 |
| 4554 var query = (req.url).query; |
| 4555 var queryOffset = 0; |
| 4556 var queryMap = {}; |
| 4557 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4558 parseBool(n) { |
| 4559 if (n == "true") return true; |
| 4560 if (n == "false") return false; |
| 4561 if (n == null) return null; |
| 4562 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4563 } |
| 4564 if (query.length > 0) { |
| 4565 for (var part in query.split("&")) { |
| 4566 var keyvalue = part.split("="); |
| 4567 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 4568 } |
| 4569 } |
| 4570 |
| 4571 |
| 4572 var h = { |
| 4573 "content-type" : "application/json; charset=utf-8", |
| 4574 }; |
| 4575 var resp = ""; |
| 4576 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 4577 }), true); |
| 4578 res.delete(arg_accountId, arg_linkId).then(unittest.expectAsync((_) {})); |
| 4579 }); |
| 4580 |
| 4581 unittest.test("method--insert", () { |
| 4582 |
| 4583 var mock = new common_test.HttpServerMock(); |
| 4584 api.ManagementAccountUserLinksResourceApi res = new api.AnalyticsApi(mock)
.management.accountUserLinks; |
| 4585 var arg_request = buildEntityUserLink(); |
| 4586 var arg_accountId = "foo"; |
| 4587 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 4588 var obj = new api.EntityUserLink.fromJson(json); |
| 4589 checkEntityUserLink(obj); |
| 4590 |
| 4591 var path = (req.url).path; |
| 4592 var pathOffset = 0; |
| 4593 var index; |
| 4594 var subPart; |
| 4595 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 4596 pathOffset += 14; |
| 4597 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 4598 pathOffset += 20; |
| 4599 index = path.indexOf("/entityUserLinks", pathOffset); |
| 4600 unittest.expect(index >= 0, unittest.isTrue); |
| 4601 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 4602 pathOffset = index; |
| 4603 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 4604 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/entityUserLinks")); |
| 4605 pathOffset += 16; |
| 4606 |
| 4607 var query = (req.url).query; |
| 4608 var queryOffset = 0; |
| 4609 var queryMap = {}; |
| 4610 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4611 parseBool(n) { |
| 4612 if (n == "true") return true; |
| 4613 if (n == "false") return false; |
| 4614 if (n == null) return null; |
| 4615 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4616 } |
| 4617 if (query.length > 0) { |
| 4618 for (var part in query.split("&")) { |
| 4619 var keyvalue = part.split("="); |
| 4620 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 4621 } |
| 4622 } |
| 4623 |
| 4624 |
| 4625 var h = { |
| 4626 "content-type" : "application/json; charset=utf-8", |
| 4627 }; |
| 4628 var resp = convert.JSON.encode(buildEntityUserLink()); |
| 4629 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 4630 }), true); |
| 4631 res.insert(arg_request, arg_accountId).then(unittest.expectAsync(((api.Ent
ityUserLink response) { |
| 4632 checkEntityUserLink(response); |
| 4633 }))); |
| 4634 }); |
| 4635 |
| 4636 unittest.test("method--list", () { |
| 4637 |
| 4638 var mock = new common_test.HttpServerMock(); |
| 4639 api.ManagementAccountUserLinksResourceApi res = new api.AnalyticsApi(mock)
.management.accountUserLinks; |
| 4640 var arg_accountId = "foo"; |
| 4641 var arg_max_results = 42; |
| 4642 var arg_start_index = 42; |
| 4643 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 4644 var path = (req.url).path; |
| 4645 var pathOffset = 0; |
| 4646 var index; |
| 4647 var subPart; |
| 4648 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 4649 pathOffset += 14; |
| 4650 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 4651 pathOffset += 20; |
| 4652 index = path.indexOf("/entityUserLinks", pathOffset); |
| 4653 unittest.expect(index >= 0, unittest.isTrue); |
| 4654 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 4655 pathOffset = index; |
| 4656 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 4657 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/entityUserLinks")); |
| 4658 pathOffset += 16; |
| 4659 |
| 4660 var query = (req.url).query; |
| 4661 var queryOffset = 0; |
| 4662 var queryMap = {}; |
| 4663 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4664 parseBool(n) { |
| 4665 if (n == "true") return true; |
| 4666 if (n == "false") return false; |
| 4667 if (n == null) return null; |
| 4668 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4669 } |
| 4670 if (query.length > 0) { |
| 4671 for (var part in query.split("&")) { |
| 4672 var keyvalue = part.split("="); |
| 4673 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 4674 } |
| 4675 } |
| 4676 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 4677 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 4678 |
| 4679 |
| 4680 var h = { |
| 4681 "content-type" : "application/json; charset=utf-8", |
| 4682 }; |
| 4683 var resp = convert.JSON.encode(buildEntityUserLinks()); |
| 4684 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 4685 }), true); |
| 4686 res.list(arg_accountId, max_results: arg_max_results, start_index: arg_sta
rt_index).then(unittest.expectAsync(((api.EntityUserLinks response) { |
| 4687 checkEntityUserLinks(response); |
| 4688 }))); |
| 4689 }); |
| 4690 |
| 4691 unittest.test("method--update", () { |
| 4692 |
| 4693 var mock = new common_test.HttpServerMock(); |
| 4694 api.ManagementAccountUserLinksResourceApi res = new api.AnalyticsApi(mock)
.management.accountUserLinks; |
| 4695 var arg_request = buildEntityUserLink(); |
| 4696 var arg_accountId = "foo"; |
| 4697 var arg_linkId = "foo"; |
| 4698 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 4699 var obj = new api.EntityUserLink.fromJson(json); |
| 4700 checkEntityUserLink(obj); |
| 4701 |
| 4702 var path = (req.url).path; |
| 4703 var pathOffset = 0; |
| 4704 var index; |
| 4705 var subPart; |
| 4706 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 4707 pathOffset += 14; |
| 4708 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 4709 pathOffset += 20; |
| 4710 index = path.indexOf("/entityUserLinks/", pathOffset); |
| 4711 unittest.expect(index >= 0, unittest.isTrue); |
| 4712 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 4713 pathOffset = index; |
| 4714 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 4715 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/entityUserLinks/")); |
| 4716 pathOffset += 17; |
| 4717 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 4718 pathOffset = path.length; |
| 4719 unittest.expect(subPart, unittest.equals("$arg_linkId")); |
| 4720 |
| 4721 var query = (req.url).query; |
| 4722 var queryOffset = 0; |
| 4723 var queryMap = {}; |
| 4724 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4725 parseBool(n) { |
| 4726 if (n == "true") return true; |
| 4727 if (n == "false") return false; |
| 4728 if (n == null) return null; |
| 4729 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4730 } |
| 4731 if (query.length > 0) { |
| 4732 for (var part in query.split("&")) { |
| 4733 var keyvalue = part.split("="); |
| 4734 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 4735 } |
| 4736 } |
| 4737 |
| 4738 |
| 4739 var h = { |
| 4740 "content-type" : "application/json; charset=utf-8", |
| 4741 }; |
| 4742 var resp = convert.JSON.encode(buildEntityUserLink()); |
| 4743 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 4744 }), true); |
| 4745 res.update(arg_request, arg_accountId, arg_linkId).then(unittest.expectAsy
nc(((api.EntityUserLink response) { |
| 4746 checkEntityUserLink(response); |
| 4747 }))); |
| 4748 }); |
| 4749 |
| 4750 }); |
| 4751 |
| 4752 |
| 4753 unittest.group("resource-ManagementAccountsResourceApi", () { |
| 4754 unittest.test("method--list", () { |
| 4755 |
| 4756 var mock = new common_test.HttpServerMock(); |
| 4757 api.ManagementAccountsResourceApi res = new api.AnalyticsApi(mock).managem
ent.accounts; |
| 4758 var arg_max_results = 42; |
| 4759 var arg_start_index = 42; |
| 4760 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 4761 var path = (req.url).path; |
| 4762 var pathOffset = 0; |
| 4763 var index; |
| 4764 var subPart; |
| 4765 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 4766 pathOffset += 14; |
| 4767 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("management/accounts")); |
| 4768 pathOffset += 19; |
| 4769 |
| 4770 var query = (req.url).query; |
| 4771 var queryOffset = 0; |
| 4772 var queryMap = {}; |
| 4773 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4774 parseBool(n) { |
| 4775 if (n == "true") return true; |
| 4776 if (n == "false") return false; |
| 4777 if (n == null) return null; |
| 4778 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4779 } |
| 4780 if (query.length > 0) { |
| 4781 for (var part in query.split("&")) { |
| 4782 var keyvalue = part.split("="); |
| 4783 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 4784 } |
| 4785 } |
| 4786 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 4787 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 4788 |
| 4789 |
| 4790 var h = { |
| 4791 "content-type" : "application/json; charset=utf-8", |
| 4792 }; |
| 4793 var resp = convert.JSON.encode(buildAccounts()); |
| 4794 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 4795 }), true); |
| 4796 res.list(max_results: arg_max_results, start_index: arg_start_index).then(
unittest.expectAsync(((api.Accounts response) { |
| 4797 checkAccounts(response); |
| 4798 }))); |
| 4799 }); |
| 4800 |
| 4801 }); |
| 4802 |
| 4803 |
| 4804 unittest.group("resource-ManagementCustomDataSourcesResourceApi", () { |
| 4805 unittest.test("method--list", () { |
| 4806 |
| 4807 var mock = new common_test.HttpServerMock(); |
| 4808 api.ManagementCustomDataSourcesResourceApi res = new api.AnalyticsApi(mock
).management.customDataSources; |
| 4809 var arg_accountId = "foo"; |
| 4810 var arg_webPropertyId = "foo"; |
| 4811 var arg_max_results = 42; |
| 4812 var arg_start_index = 42; |
| 4813 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 4814 var path = (req.url).path; |
| 4815 var pathOffset = 0; |
| 4816 var index; |
| 4817 var subPart; |
| 4818 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 4819 pathOffset += 14; |
| 4820 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 4821 pathOffset += 20; |
| 4822 index = path.indexOf("/webproperties/", pathOffset); |
| 4823 unittest.expect(index >= 0, unittest.isTrue); |
| 4824 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 4825 pathOffset = index; |
| 4826 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 4827 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 4828 pathOffset += 15; |
| 4829 index = path.indexOf("/customDataSources", pathOffset); |
| 4830 unittest.expect(index >= 0, unittest.isTrue); |
| 4831 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 4832 pathOffset = index; |
| 4833 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 4834 unittest.expect(path.substring(pathOffset, pathOffset + 18), unittest.eq
uals("/customDataSources")); |
| 4835 pathOffset += 18; |
| 4836 |
| 4837 var query = (req.url).query; |
| 4838 var queryOffset = 0; |
| 4839 var queryMap = {}; |
| 4840 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4841 parseBool(n) { |
| 4842 if (n == "true") return true; |
| 4843 if (n == "false") return false; |
| 4844 if (n == null) return null; |
| 4845 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4846 } |
| 4847 if (query.length > 0) { |
| 4848 for (var part in query.split("&")) { |
| 4849 var keyvalue = part.split("="); |
| 4850 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 4851 } |
| 4852 } |
| 4853 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 4854 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 4855 |
| 4856 |
| 4857 var h = { |
| 4858 "content-type" : "application/json; charset=utf-8", |
| 4859 }; |
| 4860 var resp = convert.JSON.encode(buildCustomDataSources()); |
| 4861 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 4862 }), true); |
| 4863 res.list(arg_accountId, arg_webPropertyId, max_results: arg_max_results, s
tart_index: arg_start_index).then(unittest.expectAsync(((api.CustomDataSources r
esponse) { |
| 4864 checkCustomDataSources(response); |
| 4865 }))); |
| 4866 }); |
| 4867 |
| 4868 }); |
| 4869 |
| 4870 |
| 4871 unittest.group("resource-ManagementDailyUploadsResourceApi", () { |
| 4872 unittest.test("method--delete", () { |
| 4873 |
| 4874 var mock = new common_test.HttpServerMock(); |
| 4875 api.ManagementDailyUploadsResourceApi res = new api.AnalyticsApi(mock).man
agement.dailyUploads; |
| 4876 var arg_accountId = "foo"; |
| 4877 var arg_webPropertyId = "foo"; |
| 4878 var arg_customDataSourceId = "foo"; |
| 4879 var arg_date = "foo"; |
| 4880 var arg_type = "foo"; |
| 4881 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 4882 var path = (req.url).path; |
| 4883 var pathOffset = 0; |
| 4884 var index; |
| 4885 var subPart; |
| 4886 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 4887 pathOffset += 14; |
| 4888 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 4889 pathOffset += 20; |
| 4890 index = path.indexOf("/webproperties/", pathOffset); |
| 4891 unittest.expect(index >= 0, unittest.isTrue); |
| 4892 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 4893 pathOffset = index; |
| 4894 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 4895 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 4896 pathOffset += 15; |
| 4897 index = path.indexOf("/customDataSources/", pathOffset); |
| 4898 unittest.expect(index >= 0, unittest.isTrue); |
| 4899 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 4900 pathOffset = index; |
| 4901 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 4902 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/customDataSources/")); |
| 4903 pathOffset += 19; |
| 4904 index = path.indexOf("/dailyUploads/", pathOffset); |
| 4905 unittest.expect(index >= 0, unittest.isTrue); |
| 4906 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 4907 pathOffset = index; |
| 4908 unittest.expect(subPart, unittest.equals("$arg_customDataSourceId")); |
| 4909 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/dailyUploads/")); |
| 4910 pathOffset += 14; |
| 4911 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 4912 pathOffset = path.length; |
| 4913 unittest.expect(subPart, unittest.equals("$arg_date")); |
| 4914 |
| 4915 var query = (req.url).query; |
| 4916 var queryOffset = 0; |
| 4917 var queryMap = {}; |
| 4918 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4919 parseBool(n) { |
| 4920 if (n == "true") return true; |
| 4921 if (n == "false") return false; |
| 4922 if (n == null) return null; |
| 4923 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4924 } |
| 4925 if (query.length > 0) { |
| 4926 for (var part in query.split("&")) { |
| 4927 var keyvalue = part.split("="); |
| 4928 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 4929 } |
| 4930 } |
| 4931 unittest.expect(queryMap["type"].first, unittest.equals(arg_type)); |
| 4932 |
| 4933 |
| 4934 var h = { |
| 4935 "content-type" : "application/json; charset=utf-8", |
| 4936 }; |
| 4937 var resp = ""; |
| 4938 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 4939 }), true); |
| 4940 res.delete(arg_accountId, arg_webPropertyId, arg_customDataSourceId, arg_d
ate, arg_type).then(unittest.expectAsync((_) {})); |
| 4941 }); |
| 4942 |
| 4943 unittest.test("method--list", () { |
| 4944 |
| 4945 var mock = new common_test.HttpServerMock(); |
| 4946 api.ManagementDailyUploadsResourceApi res = new api.AnalyticsApi(mock).man
agement.dailyUploads; |
| 4947 var arg_accountId = "foo"; |
| 4948 var arg_webPropertyId = "foo"; |
| 4949 var arg_customDataSourceId = "foo"; |
| 4950 var arg_start_date = "foo"; |
| 4951 var arg_end_date = "foo"; |
| 4952 var arg_max_results = 42; |
| 4953 var arg_start_index = 42; |
| 4954 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 4955 var path = (req.url).path; |
| 4956 var pathOffset = 0; |
| 4957 var index; |
| 4958 var subPart; |
| 4959 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 4960 pathOffset += 14; |
| 4961 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 4962 pathOffset += 20; |
| 4963 index = path.indexOf("/webproperties/", pathOffset); |
| 4964 unittest.expect(index >= 0, unittest.isTrue); |
| 4965 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 4966 pathOffset = index; |
| 4967 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 4968 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 4969 pathOffset += 15; |
| 4970 index = path.indexOf("/customDataSources/", pathOffset); |
| 4971 unittest.expect(index >= 0, unittest.isTrue); |
| 4972 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 4973 pathOffset = index; |
| 4974 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 4975 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/customDataSources/")); |
| 4976 pathOffset += 19; |
| 4977 index = path.indexOf("/dailyUploads", pathOffset); |
| 4978 unittest.expect(index >= 0, unittest.isTrue); |
| 4979 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 4980 pathOffset = index; |
| 4981 unittest.expect(subPart, unittest.equals("$arg_customDataSourceId")); |
| 4982 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/dailyUploads")); |
| 4983 pathOffset += 13; |
| 4984 |
| 4985 var query = (req.url).query; |
| 4986 var queryOffset = 0; |
| 4987 var queryMap = {}; |
| 4988 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 4989 parseBool(n) { |
| 4990 if (n == "true") return true; |
| 4991 if (n == "false") return false; |
| 4992 if (n == null) return null; |
| 4993 throw new core.ArgumentError("Invalid boolean: $n"); |
| 4994 } |
| 4995 if (query.length > 0) { |
| 4996 for (var part in query.split("&")) { |
| 4997 var keyvalue = part.split("="); |
| 4998 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 4999 } |
| 5000 } |
| 5001 unittest.expect(queryMap["start-date"].first, unittest.equals(arg_start_
date)); |
| 5002 unittest.expect(queryMap["end-date"].first, unittest.equals(arg_end_date
)); |
| 5003 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 5004 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 5005 |
| 5006 |
| 5007 var h = { |
| 5008 "content-type" : "application/json; charset=utf-8", |
| 5009 }; |
| 5010 var resp = convert.JSON.encode(buildDailyUploads()); |
| 5011 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5012 }), true); |
| 5013 res.list(arg_accountId, arg_webPropertyId, arg_customDataSourceId, arg_sta
rt_date, arg_end_date, max_results: arg_max_results, start_index: arg_start_inde
x).then(unittest.expectAsync(((api.DailyUploads response) { |
| 5014 checkDailyUploads(response); |
| 5015 }))); |
| 5016 }); |
| 5017 |
| 5018 unittest.test("method--upload", () { |
| 5019 // TODO: Implement tests for media upload; |
| 5020 // TODO: Implement tests for media download; |
| 5021 |
| 5022 var mock = new common_test.HttpServerMock(); |
| 5023 api.ManagementDailyUploadsResourceApi res = new api.AnalyticsApi(mock).man
agement.dailyUploads; |
| 5024 var arg_accountId = "foo"; |
| 5025 var arg_webPropertyId = "foo"; |
| 5026 var arg_customDataSourceId = "foo"; |
| 5027 var arg_date = "foo"; |
| 5028 var arg_appendNumber = 42; |
| 5029 var arg_type = "foo"; |
| 5030 var arg_reset = true; |
| 5031 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5032 var path = (req.url).path; |
| 5033 var pathOffset = 0; |
| 5034 var index; |
| 5035 var subPart; |
| 5036 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5037 pathOffset += 14; |
| 5038 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5039 pathOffset += 20; |
| 5040 index = path.indexOf("/webproperties/", pathOffset); |
| 5041 unittest.expect(index >= 0, unittest.isTrue); |
| 5042 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5043 pathOffset = index; |
| 5044 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5045 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 5046 pathOffset += 15; |
| 5047 index = path.indexOf("/customDataSources/", pathOffset); |
| 5048 unittest.expect(index >= 0, unittest.isTrue); |
| 5049 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5050 pathOffset = index; |
| 5051 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 5052 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/customDataSources/")); |
| 5053 pathOffset += 19; |
| 5054 index = path.indexOf("/dailyUploads/", pathOffset); |
| 5055 unittest.expect(index >= 0, unittest.isTrue); |
| 5056 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5057 pathOffset = index; |
| 5058 unittest.expect(subPart, unittest.equals("$arg_customDataSourceId")); |
| 5059 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/dailyUploads/")); |
| 5060 pathOffset += 14; |
| 5061 index = path.indexOf("/uploads", pathOffset); |
| 5062 unittest.expect(index >= 0, unittest.isTrue); |
| 5063 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5064 pathOffset = index; |
| 5065 unittest.expect(subPart, unittest.equals("$arg_date")); |
| 5066 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/uploads")); |
| 5067 pathOffset += 8; |
| 5068 |
| 5069 var query = (req.url).query; |
| 5070 var queryOffset = 0; |
| 5071 var queryMap = {}; |
| 5072 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5073 parseBool(n) { |
| 5074 if (n == "true") return true; |
| 5075 if (n == "false") return false; |
| 5076 if (n == null) return null; |
| 5077 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5078 } |
| 5079 if (query.length > 0) { |
| 5080 for (var part in query.split("&")) { |
| 5081 var keyvalue = part.split("="); |
| 5082 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5083 } |
| 5084 } |
| 5085 unittest.expect(core.int.parse(queryMap["appendNumber"].first), unittest
.equals(arg_appendNumber)); |
| 5086 unittest.expect(queryMap["type"].first, unittest.equals(arg_type)); |
| 5087 unittest.expect(queryMap["reset"].first, unittest.equals("$arg_reset")); |
| 5088 |
| 5089 |
| 5090 var h = { |
| 5091 "content-type" : "application/json; charset=utf-8", |
| 5092 }; |
| 5093 var resp = convert.JSON.encode(buildDailyUploadAppend()); |
| 5094 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5095 }), true); |
| 5096 res.upload(arg_accountId, arg_webPropertyId, arg_customDataSourceId, arg_d
ate, arg_appendNumber, arg_type, reset: arg_reset).then(unittest.expectAsync(((a
pi.DailyUploadAppend response) { |
| 5097 checkDailyUploadAppend(response); |
| 5098 }))); |
| 5099 }); |
| 5100 |
| 5101 }); |
| 5102 |
| 5103 |
| 5104 unittest.group("resource-ManagementExperimentsResourceApi", () { |
| 5105 unittest.test("method--delete", () { |
| 5106 |
| 5107 var mock = new common_test.HttpServerMock(); |
| 5108 api.ManagementExperimentsResourceApi res = new api.AnalyticsApi(mock).mana
gement.experiments; |
| 5109 var arg_accountId = "foo"; |
| 5110 var arg_webPropertyId = "foo"; |
| 5111 var arg_profileId = "foo"; |
| 5112 var arg_experimentId = "foo"; |
| 5113 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5114 var path = (req.url).path; |
| 5115 var pathOffset = 0; |
| 5116 var index; |
| 5117 var subPart; |
| 5118 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5119 pathOffset += 14; |
| 5120 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5121 pathOffset += 20; |
| 5122 index = path.indexOf("/webproperties/", pathOffset); |
| 5123 unittest.expect(index >= 0, unittest.isTrue); |
| 5124 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5125 pathOffset = index; |
| 5126 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5127 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 5128 pathOffset += 15; |
| 5129 index = path.indexOf("/profiles/", pathOffset); |
| 5130 unittest.expect(index >= 0, unittest.isTrue); |
| 5131 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5132 pathOffset = index; |
| 5133 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 5134 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 5135 pathOffset += 10; |
| 5136 index = path.indexOf("/experiments/", pathOffset); |
| 5137 unittest.expect(index >= 0, unittest.isTrue); |
| 5138 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5139 pathOffset = index; |
| 5140 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 5141 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/experiments/")); |
| 5142 pathOffset += 13; |
| 5143 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 5144 pathOffset = path.length; |
| 5145 unittest.expect(subPart, unittest.equals("$arg_experimentId")); |
| 5146 |
| 5147 var query = (req.url).query; |
| 5148 var queryOffset = 0; |
| 5149 var queryMap = {}; |
| 5150 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5151 parseBool(n) { |
| 5152 if (n == "true") return true; |
| 5153 if (n == "false") return false; |
| 5154 if (n == null) return null; |
| 5155 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5156 } |
| 5157 if (query.length > 0) { |
| 5158 for (var part in query.split("&")) { |
| 5159 var keyvalue = part.split("="); |
| 5160 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5161 } |
| 5162 } |
| 5163 |
| 5164 |
| 5165 var h = { |
| 5166 "content-type" : "application/json; charset=utf-8", |
| 5167 }; |
| 5168 var resp = ""; |
| 5169 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5170 }), true); |
| 5171 res.delete(arg_accountId, arg_webPropertyId, arg_profileId, arg_experiment
Id).then(unittest.expectAsync((_) {})); |
| 5172 }); |
| 5173 |
| 5174 unittest.test("method--get", () { |
| 5175 |
| 5176 var mock = new common_test.HttpServerMock(); |
| 5177 api.ManagementExperimentsResourceApi res = new api.AnalyticsApi(mock).mana
gement.experiments; |
| 5178 var arg_accountId = "foo"; |
| 5179 var arg_webPropertyId = "foo"; |
| 5180 var arg_profileId = "foo"; |
| 5181 var arg_experimentId = "foo"; |
| 5182 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5183 var path = (req.url).path; |
| 5184 var pathOffset = 0; |
| 5185 var index; |
| 5186 var subPart; |
| 5187 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5188 pathOffset += 14; |
| 5189 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5190 pathOffset += 20; |
| 5191 index = path.indexOf("/webproperties/", pathOffset); |
| 5192 unittest.expect(index >= 0, unittest.isTrue); |
| 5193 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5194 pathOffset = index; |
| 5195 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5196 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 5197 pathOffset += 15; |
| 5198 index = path.indexOf("/profiles/", pathOffset); |
| 5199 unittest.expect(index >= 0, unittest.isTrue); |
| 5200 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5201 pathOffset = index; |
| 5202 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 5203 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 5204 pathOffset += 10; |
| 5205 index = path.indexOf("/experiments/", pathOffset); |
| 5206 unittest.expect(index >= 0, unittest.isTrue); |
| 5207 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5208 pathOffset = index; |
| 5209 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 5210 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/experiments/")); |
| 5211 pathOffset += 13; |
| 5212 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 5213 pathOffset = path.length; |
| 5214 unittest.expect(subPart, unittest.equals("$arg_experimentId")); |
| 5215 |
| 5216 var query = (req.url).query; |
| 5217 var queryOffset = 0; |
| 5218 var queryMap = {}; |
| 5219 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5220 parseBool(n) { |
| 5221 if (n == "true") return true; |
| 5222 if (n == "false") return false; |
| 5223 if (n == null) return null; |
| 5224 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5225 } |
| 5226 if (query.length > 0) { |
| 5227 for (var part in query.split("&")) { |
| 5228 var keyvalue = part.split("="); |
| 5229 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5230 } |
| 5231 } |
| 5232 |
| 5233 |
| 5234 var h = { |
| 5235 "content-type" : "application/json; charset=utf-8", |
| 5236 }; |
| 5237 var resp = convert.JSON.encode(buildExperiment()); |
| 5238 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5239 }), true); |
| 5240 res.get(arg_accountId, arg_webPropertyId, arg_profileId, arg_experimentId)
.then(unittest.expectAsync(((api.Experiment response) { |
| 5241 checkExperiment(response); |
| 5242 }))); |
| 5243 }); |
| 5244 |
| 5245 unittest.test("method--insert", () { |
| 5246 |
| 5247 var mock = new common_test.HttpServerMock(); |
| 5248 api.ManagementExperimentsResourceApi res = new api.AnalyticsApi(mock).mana
gement.experiments; |
| 5249 var arg_request = buildExperiment(); |
| 5250 var arg_accountId = "foo"; |
| 5251 var arg_webPropertyId = "foo"; |
| 5252 var arg_profileId = "foo"; |
| 5253 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5254 var obj = new api.Experiment.fromJson(json); |
| 5255 checkExperiment(obj); |
| 5256 |
| 5257 var path = (req.url).path; |
| 5258 var pathOffset = 0; |
| 5259 var index; |
| 5260 var subPart; |
| 5261 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5262 pathOffset += 14; |
| 5263 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5264 pathOffset += 20; |
| 5265 index = path.indexOf("/webproperties/", pathOffset); |
| 5266 unittest.expect(index >= 0, unittest.isTrue); |
| 5267 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5268 pathOffset = index; |
| 5269 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5270 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 5271 pathOffset += 15; |
| 5272 index = path.indexOf("/profiles/", pathOffset); |
| 5273 unittest.expect(index >= 0, unittest.isTrue); |
| 5274 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5275 pathOffset = index; |
| 5276 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 5277 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 5278 pathOffset += 10; |
| 5279 index = path.indexOf("/experiments", pathOffset); |
| 5280 unittest.expect(index >= 0, unittest.isTrue); |
| 5281 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5282 pathOffset = index; |
| 5283 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 5284 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/experiments")); |
| 5285 pathOffset += 12; |
| 5286 |
| 5287 var query = (req.url).query; |
| 5288 var queryOffset = 0; |
| 5289 var queryMap = {}; |
| 5290 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5291 parseBool(n) { |
| 5292 if (n == "true") return true; |
| 5293 if (n == "false") return false; |
| 5294 if (n == null) return null; |
| 5295 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5296 } |
| 5297 if (query.length > 0) { |
| 5298 for (var part in query.split("&")) { |
| 5299 var keyvalue = part.split("="); |
| 5300 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5301 } |
| 5302 } |
| 5303 |
| 5304 |
| 5305 var h = { |
| 5306 "content-type" : "application/json; charset=utf-8", |
| 5307 }; |
| 5308 var resp = convert.JSON.encode(buildExperiment()); |
| 5309 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5310 }), true); |
| 5311 res.insert(arg_request, arg_accountId, arg_webPropertyId, arg_profileId).t
hen(unittest.expectAsync(((api.Experiment response) { |
| 5312 checkExperiment(response); |
| 5313 }))); |
| 5314 }); |
| 5315 |
| 5316 unittest.test("method--list", () { |
| 5317 |
| 5318 var mock = new common_test.HttpServerMock(); |
| 5319 api.ManagementExperimentsResourceApi res = new api.AnalyticsApi(mock).mana
gement.experiments; |
| 5320 var arg_accountId = "foo"; |
| 5321 var arg_webPropertyId = "foo"; |
| 5322 var arg_profileId = "foo"; |
| 5323 var arg_max_results = 42; |
| 5324 var arg_start_index = 42; |
| 5325 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5326 var path = (req.url).path; |
| 5327 var pathOffset = 0; |
| 5328 var index; |
| 5329 var subPart; |
| 5330 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5331 pathOffset += 14; |
| 5332 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5333 pathOffset += 20; |
| 5334 index = path.indexOf("/webproperties/", pathOffset); |
| 5335 unittest.expect(index >= 0, unittest.isTrue); |
| 5336 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5337 pathOffset = index; |
| 5338 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5339 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 5340 pathOffset += 15; |
| 5341 index = path.indexOf("/profiles/", pathOffset); |
| 5342 unittest.expect(index >= 0, unittest.isTrue); |
| 5343 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5344 pathOffset = index; |
| 5345 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 5346 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 5347 pathOffset += 10; |
| 5348 index = path.indexOf("/experiments", pathOffset); |
| 5349 unittest.expect(index >= 0, unittest.isTrue); |
| 5350 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5351 pathOffset = index; |
| 5352 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 5353 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/experiments")); |
| 5354 pathOffset += 12; |
| 5355 |
| 5356 var query = (req.url).query; |
| 5357 var queryOffset = 0; |
| 5358 var queryMap = {}; |
| 5359 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5360 parseBool(n) { |
| 5361 if (n == "true") return true; |
| 5362 if (n == "false") return false; |
| 5363 if (n == null) return null; |
| 5364 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5365 } |
| 5366 if (query.length > 0) { |
| 5367 for (var part in query.split("&")) { |
| 5368 var keyvalue = part.split("="); |
| 5369 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5370 } |
| 5371 } |
| 5372 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 5373 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 5374 |
| 5375 |
| 5376 var h = { |
| 5377 "content-type" : "application/json; charset=utf-8", |
| 5378 }; |
| 5379 var resp = convert.JSON.encode(buildExperiments()); |
| 5380 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5381 }), true); |
| 5382 res.list(arg_accountId, arg_webPropertyId, arg_profileId, max_results: arg
_max_results, start_index: arg_start_index).then(unittest.expectAsync(((api.Expe
riments response) { |
| 5383 checkExperiments(response); |
| 5384 }))); |
| 5385 }); |
| 5386 |
| 5387 unittest.test("method--patch", () { |
| 5388 |
| 5389 var mock = new common_test.HttpServerMock(); |
| 5390 api.ManagementExperimentsResourceApi res = new api.AnalyticsApi(mock).mana
gement.experiments; |
| 5391 var arg_request = buildExperiment(); |
| 5392 var arg_accountId = "foo"; |
| 5393 var arg_webPropertyId = "foo"; |
| 5394 var arg_profileId = "foo"; |
| 5395 var arg_experimentId = "foo"; |
| 5396 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5397 var obj = new api.Experiment.fromJson(json); |
| 5398 checkExperiment(obj); |
| 5399 |
| 5400 var path = (req.url).path; |
| 5401 var pathOffset = 0; |
| 5402 var index; |
| 5403 var subPart; |
| 5404 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5405 pathOffset += 14; |
| 5406 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5407 pathOffset += 20; |
| 5408 index = path.indexOf("/webproperties/", pathOffset); |
| 5409 unittest.expect(index >= 0, unittest.isTrue); |
| 5410 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5411 pathOffset = index; |
| 5412 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5413 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 5414 pathOffset += 15; |
| 5415 index = path.indexOf("/profiles/", pathOffset); |
| 5416 unittest.expect(index >= 0, unittest.isTrue); |
| 5417 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5418 pathOffset = index; |
| 5419 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 5420 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 5421 pathOffset += 10; |
| 5422 index = path.indexOf("/experiments/", pathOffset); |
| 5423 unittest.expect(index >= 0, unittest.isTrue); |
| 5424 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5425 pathOffset = index; |
| 5426 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 5427 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/experiments/")); |
| 5428 pathOffset += 13; |
| 5429 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 5430 pathOffset = path.length; |
| 5431 unittest.expect(subPart, unittest.equals("$arg_experimentId")); |
| 5432 |
| 5433 var query = (req.url).query; |
| 5434 var queryOffset = 0; |
| 5435 var queryMap = {}; |
| 5436 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5437 parseBool(n) { |
| 5438 if (n == "true") return true; |
| 5439 if (n == "false") return false; |
| 5440 if (n == null) return null; |
| 5441 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5442 } |
| 5443 if (query.length > 0) { |
| 5444 for (var part in query.split("&")) { |
| 5445 var keyvalue = part.split("="); |
| 5446 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5447 } |
| 5448 } |
| 5449 |
| 5450 |
| 5451 var h = { |
| 5452 "content-type" : "application/json; charset=utf-8", |
| 5453 }; |
| 5454 var resp = convert.JSON.encode(buildExperiment()); |
| 5455 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5456 }), true); |
| 5457 res.patch(arg_request, arg_accountId, arg_webPropertyId, arg_profileId, ar
g_experimentId).then(unittest.expectAsync(((api.Experiment response) { |
| 5458 checkExperiment(response); |
| 5459 }))); |
| 5460 }); |
| 5461 |
| 5462 unittest.test("method--update", () { |
| 5463 |
| 5464 var mock = new common_test.HttpServerMock(); |
| 5465 api.ManagementExperimentsResourceApi res = new api.AnalyticsApi(mock).mana
gement.experiments; |
| 5466 var arg_request = buildExperiment(); |
| 5467 var arg_accountId = "foo"; |
| 5468 var arg_webPropertyId = "foo"; |
| 5469 var arg_profileId = "foo"; |
| 5470 var arg_experimentId = "foo"; |
| 5471 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5472 var obj = new api.Experiment.fromJson(json); |
| 5473 checkExperiment(obj); |
| 5474 |
| 5475 var path = (req.url).path; |
| 5476 var pathOffset = 0; |
| 5477 var index; |
| 5478 var subPart; |
| 5479 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5480 pathOffset += 14; |
| 5481 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5482 pathOffset += 20; |
| 5483 index = path.indexOf("/webproperties/", pathOffset); |
| 5484 unittest.expect(index >= 0, unittest.isTrue); |
| 5485 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5486 pathOffset = index; |
| 5487 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5488 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 5489 pathOffset += 15; |
| 5490 index = path.indexOf("/profiles/", pathOffset); |
| 5491 unittest.expect(index >= 0, unittest.isTrue); |
| 5492 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5493 pathOffset = index; |
| 5494 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 5495 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 5496 pathOffset += 10; |
| 5497 index = path.indexOf("/experiments/", pathOffset); |
| 5498 unittest.expect(index >= 0, unittest.isTrue); |
| 5499 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5500 pathOffset = index; |
| 5501 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 5502 unittest.expect(path.substring(pathOffset, pathOffset + 13), unittest.eq
uals("/experiments/")); |
| 5503 pathOffset += 13; |
| 5504 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 5505 pathOffset = path.length; |
| 5506 unittest.expect(subPart, unittest.equals("$arg_experimentId")); |
| 5507 |
| 5508 var query = (req.url).query; |
| 5509 var queryOffset = 0; |
| 5510 var queryMap = {}; |
| 5511 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5512 parseBool(n) { |
| 5513 if (n == "true") return true; |
| 5514 if (n == "false") return false; |
| 5515 if (n == null) return null; |
| 5516 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5517 } |
| 5518 if (query.length > 0) { |
| 5519 for (var part in query.split("&")) { |
| 5520 var keyvalue = part.split("="); |
| 5521 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5522 } |
| 5523 } |
| 5524 |
| 5525 |
| 5526 var h = { |
| 5527 "content-type" : "application/json; charset=utf-8", |
| 5528 }; |
| 5529 var resp = convert.JSON.encode(buildExperiment()); |
| 5530 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5531 }), true); |
| 5532 res.update(arg_request, arg_accountId, arg_webPropertyId, arg_profileId, a
rg_experimentId).then(unittest.expectAsync(((api.Experiment response) { |
| 5533 checkExperiment(response); |
| 5534 }))); |
| 5535 }); |
| 5536 |
| 5537 }); |
| 5538 |
| 5539 |
| 5540 unittest.group("resource-ManagementFiltersResourceApi", () { |
| 5541 unittest.test("method--delete", () { |
| 5542 |
| 5543 var mock = new common_test.HttpServerMock(); |
| 5544 api.ManagementFiltersResourceApi res = new api.AnalyticsApi(mock).manageme
nt.filters; |
| 5545 var arg_accountId = "foo"; |
| 5546 var arg_filterId = "foo"; |
| 5547 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5548 var path = (req.url).path; |
| 5549 var pathOffset = 0; |
| 5550 var index; |
| 5551 var subPart; |
| 5552 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5553 pathOffset += 14; |
| 5554 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5555 pathOffset += 20; |
| 5556 index = path.indexOf("/filters/", pathOffset); |
| 5557 unittest.expect(index >= 0, unittest.isTrue); |
| 5558 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5559 pathOffset = index; |
| 5560 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5561 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/filters/")); |
| 5562 pathOffset += 9; |
| 5563 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 5564 pathOffset = path.length; |
| 5565 unittest.expect(subPart, unittest.equals("$arg_filterId")); |
| 5566 |
| 5567 var query = (req.url).query; |
| 5568 var queryOffset = 0; |
| 5569 var queryMap = {}; |
| 5570 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5571 parseBool(n) { |
| 5572 if (n == "true") return true; |
| 5573 if (n == "false") return false; |
| 5574 if (n == null) return null; |
| 5575 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5576 } |
| 5577 if (query.length > 0) { |
| 5578 for (var part in query.split("&")) { |
| 5579 var keyvalue = part.split("="); |
| 5580 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5581 } |
| 5582 } |
| 5583 |
| 5584 |
| 5585 var h = { |
| 5586 "content-type" : "application/json; charset=utf-8", |
| 5587 }; |
| 5588 var resp = convert.JSON.encode(buildFilter()); |
| 5589 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5590 }), true); |
| 5591 res.delete(arg_accountId, arg_filterId).then(unittest.expectAsync(((api.Fi
lter response) { |
| 5592 checkFilter(response); |
| 5593 }))); |
| 5594 }); |
| 5595 |
| 5596 unittest.test("method--get", () { |
| 5597 |
| 5598 var mock = new common_test.HttpServerMock(); |
| 5599 api.ManagementFiltersResourceApi res = new api.AnalyticsApi(mock).manageme
nt.filters; |
| 5600 var arg_accountId = "foo"; |
| 5601 var arg_filterId = "foo"; |
| 5602 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5603 var path = (req.url).path; |
| 5604 var pathOffset = 0; |
| 5605 var index; |
| 5606 var subPart; |
| 5607 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5608 pathOffset += 14; |
| 5609 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5610 pathOffset += 20; |
| 5611 index = path.indexOf("/filters/", pathOffset); |
| 5612 unittest.expect(index >= 0, unittest.isTrue); |
| 5613 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5614 pathOffset = index; |
| 5615 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5616 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/filters/")); |
| 5617 pathOffset += 9; |
| 5618 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 5619 pathOffset = path.length; |
| 5620 unittest.expect(subPart, unittest.equals("$arg_filterId")); |
| 5621 |
| 5622 var query = (req.url).query; |
| 5623 var queryOffset = 0; |
| 5624 var queryMap = {}; |
| 5625 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5626 parseBool(n) { |
| 5627 if (n == "true") return true; |
| 5628 if (n == "false") return false; |
| 5629 if (n == null) return null; |
| 5630 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5631 } |
| 5632 if (query.length > 0) { |
| 5633 for (var part in query.split("&")) { |
| 5634 var keyvalue = part.split("="); |
| 5635 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5636 } |
| 5637 } |
| 5638 |
| 5639 |
| 5640 var h = { |
| 5641 "content-type" : "application/json; charset=utf-8", |
| 5642 }; |
| 5643 var resp = convert.JSON.encode(buildFilter()); |
| 5644 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5645 }), true); |
| 5646 res.get(arg_accountId, arg_filterId).then(unittest.expectAsync(((api.Filte
r response) { |
| 5647 checkFilter(response); |
| 5648 }))); |
| 5649 }); |
| 5650 |
| 5651 unittest.test("method--insert", () { |
| 5652 |
| 5653 var mock = new common_test.HttpServerMock(); |
| 5654 api.ManagementFiltersResourceApi res = new api.AnalyticsApi(mock).manageme
nt.filters; |
| 5655 var arg_request = buildFilter(); |
| 5656 var arg_accountId = "foo"; |
| 5657 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5658 var obj = new api.Filter.fromJson(json); |
| 5659 checkFilter(obj); |
| 5660 |
| 5661 var path = (req.url).path; |
| 5662 var pathOffset = 0; |
| 5663 var index; |
| 5664 var subPart; |
| 5665 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5666 pathOffset += 14; |
| 5667 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5668 pathOffset += 20; |
| 5669 index = path.indexOf("/filters", pathOffset); |
| 5670 unittest.expect(index >= 0, unittest.isTrue); |
| 5671 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5672 pathOffset = index; |
| 5673 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5674 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/filters")); |
| 5675 pathOffset += 8; |
| 5676 |
| 5677 var query = (req.url).query; |
| 5678 var queryOffset = 0; |
| 5679 var queryMap = {}; |
| 5680 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5681 parseBool(n) { |
| 5682 if (n == "true") return true; |
| 5683 if (n == "false") return false; |
| 5684 if (n == null) return null; |
| 5685 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5686 } |
| 5687 if (query.length > 0) { |
| 5688 for (var part in query.split("&")) { |
| 5689 var keyvalue = part.split("="); |
| 5690 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5691 } |
| 5692 } |
| 5693 |
| 5694 |
| 5695 var h = { |
| 5696 "content-type" : "application/json; charset=utf-8", |
| 5697 }; |
| 5698 var resp = convert.JSON.encode(buildFilter()); |
| 5699 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5700 }), true); |
| 5701 res.insert(arg_request, arg_accountId).then(unittest.expectAsync(((api.Fil
ter response) { |
| 5702 checkFilter(response); |
| 5703 }))); |
| 5704 }); |
| 5705 |
| 5706 unittest.test("method--list", () { |
| 5707 |
| 5708 var mock = new common_test.HttpServerMock(); |
| 5709 api.ManagementFiltersResourceApi res = new api.AnalyticsApi(mock).manageme
nt.filters; |
| 5710 var arg_accountId = "foo"; |
| 5711 var arg_max_results = 42; |
| 5712 var arg_start_index = 42; |
| 5713 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5714 var path = (req.url).path; |
| 5715 var pathOffset = 0; |
| 5716 var index; |
| 5717 var subPart; |
| 5718 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5719 pathOffset += 14; |
| 5720 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5721 pathOffset += 20; |
| 5722 index = path.indexOf("/filters", pathOffset); |
| 5723 unittest.expect(index >= 0, unittest.isTrue); |
| 5724 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5725 pathOffset = index; |
| 5726 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5727 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/filters")); |
| 5728 pathOffset += 8; |
| 5729 |
| 5730 var query = (req.url).query; |
| 5731 var queryOffset = 0; |
| 5732 var queryMap = {}; |
| 5733 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5734 parseBool(n) { |
| 5735 if (n == "true") return true; |
| 5736 if (n == "false") return false; |
| 5737 if (n == null) return null; |
| 5738 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5739 } |
| 5740 if (query.length > 0) { |
| 5741 for (var part in query.split("&")) { |
| 5742 var keyvalue = part.split("="); |
| 5743 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5744 } |
| 5745 } |
| 5746 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 5747 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 5748 |
| 5749 |
| 5750 var h = { |
| 5751 "content-type" : "application/json; charset=utf-8", |
| 5752 }; |
| 5753 var resp = convert.JSON.encode(buildFilters()); |
| 5754 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5755 }), true); |
| 5756 res.list(arg_accountId, max_results: arg_max_results, start_index: arg_sta
rt_index).then(unittest.expectAsync(((api.Filters response) { |
| 5757 checkFilters(response); |
| 5758 }))); |
| 5759 }); |
| 5760 |
| 5761 unittest.test("method--patch", () { |
| 5762 |
| 5763 var mock = new common_test.HttpServerMock(); |
| 5764 api.ManagementFiltersResourceApi res = new api.AnalyticsApi(mock).manageme
nt.filters; |
| 5765 var arg_request = buildFilter(); |
| 5766 var arg_accountId = "foo"; |
| 5767 var arg_filterId = "foo"; |
| 5768 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5769 var obj = new api.Filter.fromJson(json); |
| 5770 checkFilter(obj); |
| 5771 |
| 5772 var path = (req.url).path; |
| 5773 var pathOffset = 0; |
| 5774 var index; |
| 5775 var subPart; |
| 5776 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5777 pathOffset += 14; |
| 5778 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5779 pathOffset += 20; |
| 5780 index = path.indexOf("/filters/", pathOffset); |
| 5781 unittest.expect(index >= 0, unittest.isTrue); |
| 5782 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5783 pathOffset = index; |
| 5784 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5785 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/filters/")); |
| 5786 pathOffset += 9; |
| 5787 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 5788 pathOffset = path.length; |
| 5789 unittest.expect(subPart, unittest.equals("$arg_filterId")); |
| 5790 |
| 5791 var query = (req.url).query; |
| 5792 var queryOffset = 0; |
| 5793 var queryMap = {}; |
| 5794 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5795 parseBool(n) { |
| 5796 if (n == "true") return true; |
| 5797 if (n == "false") return false; |
| 5798 if (n == null) return null; |
| 5799 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5800 } |
| 5801 if (query.length > 0) { |
| 5802 for (var part in query.split("&")) { |
| 5803 var keyvalue = part.split("="); |
| 5804 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5805 } |
| 5806 } |
| 5807 |
| 5808 |
| 5809 var h = { |
| 5810 "content-type" : "application/json; charset=utf-8", |
| 5811 }; |
| 5812 var resp = convert.JSON.encode(buildFilter()); |
| 5813 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5814 }), true); |
| 5815 res.patch(arg_request, arg_accountId, arg_filterId).then(unittest.expectAs
ync(((api.Filter response) { |
| 5816 checkFilter(response); |
| 5817 }))); |
| 5818 }); |
| 5819 |
| 5820 unittest.test("method--update", () { |
| 5821 |
| 5822 var mock = new common_test.HttpServerMock(); |
| 5823 api.ManagementFiltersResourceApi res = new api.AnalyticsApi(mock).manageme
nt.filters; |
| 5824 var arg_request = buildFilter(); |
| 5825 var arg_accountId = "foo"; |
| 5826 var arg_filterId = "foo"; |
| 5827 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5828 var obj = new api.Filter.fromJson(json); |
| 5829 checkFilter(obj); |
| 5830 |
| 5831 var path = (req.url).path; |
| 5832 var pathOffset = 0; |
| 5833 var index; |
| 5834 var subPart; |
| 5835 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5836 pathOffset += 14; |
| 5837 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5838 pathOffset += 20; |
| 5839 index = path.indexOf("/filters/", pathOffset); |
| 5840 unittest.expect(index >= 0, unittest.isTrue); |
| 5841 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5842 pathOffset = index; |
| 5843 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5844 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/filters/")); |
| 5845 pathOffset += 9; |
| 5846 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 5847 pathOffset = path.length; |
| 5848 unittest.expect(subPart, unittest.equals("$arg_filterId")); |
| 5849 |
| 5850 var query = (req.url).query; |
| 5851 var queryOffset = 0; |
| 5852 var queryMap = {}; |
| 5853 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5854 parseBool(n) { |
| 5855 if (n == "true") return true; |
| 5856 if (n == "false") return false; |
| 5857 if (n == null) return null; |
| 5858 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5859 } |
| 5860 if (query.length > 0) { |
| 5861 for (var part in query.split("&")) { |
| 5862 var keyvalue = part.split("="); |
| 5863 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5864 } |
| 5865 } |
| 5866 |
| 5867 |
| 5868 var h = { |
| 5869 "content-type" : "application/json; charset=utf-8", |
| 5870 }; |
| 5871 var resp = convert.JSON.encode(buildFilter()); |
| 5872 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5873 }), true); |
| 5874 res.update(arg_request, arg_accountId, arg_filterId).then(unittest.expectA
sync(((api.Filter response) { |
| 5875 checkFilter(response); |
| 5876 }))); |
| 5877 }); |
| 5878 |
| 5879 }); |
| 5880 |
| 5881 |
| 5882 unittest.group("resource-ManagementGoalsResourceApi", () { |
| 5883 unittest.test("method--get", () { |
| 5884 |
| 5885 var mock = new common_test.HttpServerMock(); |
| 5886 api.ManagementGoalsResourceApi res = new api.AnalyticsApi(mock).management
.goals; |
| 5887 var arg_accountId = "foo"; |
| 5888 var arg_webPropertyId = "foo"; |
| 5889 var arg_profileId = "foo"; |
| 5890 var arg_goalId = "foo"; |
| 5891 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5892 var path = (req.url).path; |
| 5893 var pathOffset = 0; |
| 5894 var index; |
| 5895 var subPart; |
| 5896 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5897 pathOffset += 14; |
| 5898 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5899 pathOffset += 20; |
| 5900 index = path.indexOf("/webproperties/", pathOffset); |
| 5901 unittest.expect(index >= 0, unittest.isTrue); |
| 5902 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5903 pathOffset = index; |
| 5904 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5905 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 5906 pathOffset += 15; |
| 5907 index = path.indexOf("/profiles/", pathOffset); |
| 5908 unittest.expect(index >= 0, unittest.isTrue); |
| 5909 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5910 pathOffset = index; |
| 5911 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 5912 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 5913 pathOffset += 10; |
| 5914 index = path.indexOf("/goals/", pathOffset); |
| 5915 unittest.expect(index >= 0, unittest.isTrue); |
| 5916 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5917 pathOffset = index; |
| 5918 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 5919 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/goals/")); |
| 5920 pathOffset += 7; |
| 5921 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 5922 pathOffset = path.length; |
| 5923 unittest.expect(subPart, unittest.equals("$arg_goalId")); |
| 5924 |
| 5925 var query = (req.url).query; |
| 5926 var queryOffset = 0; |
| 5927 var queryMap = {}; |
| 5928 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 5929 parseBool(n) { |
| 5930 if (n == "true") return true; |
| 5931 if (n == "false") return false; |
| 5932 if (n == null) return null; |
| 5933 throw new core.ArgumentError("Invalid boolean: $n"); |
| 5934 } |
| 5935 if (query.length > 0) { |
| 5936 for (var part in query.split("&")) { |
| 5937 var keyvalue = part.split("="); |
| 5938 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 5939 } |
| 5940 } |
| 5941 |
| 5942 |
| 5943 var h = { |
| 5944 "content-type" : "application/json; charset=utf-8", |
| 5945 }; |
| 5946 var resp = convert.JSON.encode(buildGoal()); |
| 5947 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 5948 }), true); |
| 5949 res.get(arg_accountId, arg_webPropertyId, arg_profileId, arg_goalId).then(
unittest.expectAsync(((api.Goal response) { |
| 5950 checkGoal(response); |
| 5951 }))); |
| 5952 }); |
| 5953 |
| 5954 unittest.test("method--insert", () { |
| 5955 |
| 5956 var mock = new common_test.HttpServerMock(); |
| 5957 api.ManagementGoalsResourceApi res = new api.AnalyticsApi(mock).management
.goals; |
| 5958 var arg_request = buildGoal(); |
| 5959 var arg_accountId = "foo"; |
| 5960 var arg_webPropertyId = "foo"; |
| 5961 var arg_profileId = "foo"; |
| 5962 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 5963 var obj = new api.Goal.fromJson(json); |
| 5964 checkGoal(obj); |
| 5965 |
| 5966 var path = (req.url).path; |
| 5967 var pathOffset = 0; |
| 5968 var index; |
| 5969 var subPart; |
| 5970 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 5971 pathOffset += 14; |
| 5972 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 5973 pathOffset += 20; |
| 5974 index = path.indexOf("/webproperties/", pathOffset); |
| 5975 unittest.expect(index >= 0, unittest.isTrue); |
| 5976 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5977 pathOffset = index; |
| 5978 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 5979 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 5980 pathOffset += 15; |
| 5981 index = path.indexOf("/profiles/", pathOffset); |
| 5982 unittest.expect(index >= 0, unittest.isTrue); |
| 5983 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5984 pathOffset = index; |
| 5985 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 5986 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 5987 pathOffset += 10; |
| 5988 index = path.indexOf("/goals", pathOffset); |
| 5989 unittest.expect(index >= 0, unittest.isTrue); |
| 5990 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 5991 pathOffset = index; |
| 5992 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 5993 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/goals")); |
| 5994 pathOffset += 6; |
| 5995 |
| 5996 var query = (req.url).query; |
| 5997 var queryOffset = 0; |
| 5998 var queryMap = {}; |
| 5999 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6000 parseBool(n) { |
| 6001 if (n == "true") return true; |
| 6002 if (n == "false") return false; |
| 6003 if (n == null) return null; |
| 6004 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6005 } |
| 6006 if (query.length > 0) { |
| 6007 for (var part in query.split("&")) { |
| 6008 var keyvalue = part.split("="); |
| 6009 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6010 } |
| 6011 } |
| 6012 |
| 6013 |
| 6014 var h = { |
| 6015 "content-type" : "application/json; charset=utf-8", |
| 6016 }; |
| 6017 var resp = convert.JSON.encode(buildGoal()); |
| 6018 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6019 }), true); |
| 6020 res.insert(arg_request, arg_accountId, arg_webPropertyId, arg_profileId).t
hen(unittest.expectAsync(((api.Goal response) { |
| 6021 checkGoal(response); |
| 6022 }))); |
| 6023 }); |
| 6024 |
| 6025 unittest.test("method--list", () { |
| 6026 |
| 6027 var mock = new common_test.HttpServerMock(); |
| 6028 api.ManagementGoalsResourceApi res = new api.AnalyticsApi(mock).management
.goals; |
| 6029 var arg_accountId = "foo"; |
| 6030 var arg_webPropertyId = "foo"; |
| 6031 var arg_profileId = "foo"; |
| 6032 var arg_max_results = 42; |
| 6033 var arg_start_index = 42; |
| 6034 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6035 var path = (req.url).path; |
| 6036 var pathOffset = 0; |
| 6037 var index; |
| 6038 var subPart; |
| 6039 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6040 pathOffset += 14; |
| 6041 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6042 pathOffset += 20; |
| 6043 index = path.indexOf("/webproperties/", pathOffset); |
| 6044 unittest.expect(index >= 0, unittest.isTrue); |
| 6045 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6046 pathOffset = index; |
| 6047 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6048 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6049 pathOffset += 15; |
| 6050 index = path.indexOf("/profiles/", pathOffset); |
| 6051 unittest.expect(index >= 0, unittest.isTrue); |
| 6052 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6053 pathOffset = index; |
| 6054 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6055 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6056 pathOffset += 10; |
| 6057 index = path.indexOf("/goals", pathOffset); |
| 6058 unittest.expect(index >= 0, unittest.isTrue); |
| 6059 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6060 pathOffset = index; |
| 6061 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6062 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als("/goals")); |
| 6063 pathOffset += 6; |
| 6064 |
| 6065 var query = (req.url).query; |
| 6066 var queryOffset = 0; |
| 6067 var queryMap = {}; |
| 6068 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6069 parseBool(n) { |
| 6070 if (n == "true") return true; |
| 6071 if (n == "false") return false; |
| 6072 if (n == null) return null; |
| 6073 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6074 } |
| 6075 if (query.length > 0) { |
| 6076 for (var part in query.split("&")) { |
| 6077 var keyvalue = part.split("="); |
| 6078 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6079 } |
| 6080 } |
| 6081 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 6082 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 6083 |
| 6084 |
| 6085 var h = { |
| 6086 "content-type" : "application/json; charset=utf-8", |
| 6087 }; |
| 6088 var resp = convert.JSON.encode(buildGoals()); |
| 6089 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6090 }), true); |
| 6091 res.list(arg_accountId, arg_webPropertyId, arg_profileId, max_results: arg
_max_results, start_index: arg_start_index).then(unittest.expectAsync(((api.Goal
s response) { |
| 6092 checkGoals(response); |
| 6093 }))); |
| 6094 }); |
| 6095 |
| 6096 unittest.test("method--patch", () { |
| 6097 |
| 6098 var mock = new common_test.HttpServerMock(); |
| 6099 api.ManagementGoalsResourceApi res = new api.AnalyticsApi(mock).management
.goals; |
| 6100 var arg_request = buildGoal(); |
| 6101 var arg_accountId = "foo"; |
| 6102 var arg_webPropertyId = "foo"; |
| 6103 var arg_profileId = "foo"; |
| 6104 var arg_goalId = "foo"; |
| 6105 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6106 var obj = new api.Goal.fromJson(json); |
| 6107 checkGoal(obj); |
| 6108 |
| 6109 var path = (req.url).path; |
| 6110 var pathOffset = 0; |
| 6111 var index; |
| 6112 var subPart; |
| 6113 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6114 pathOffset += 14; |
| 6115 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6116 pathOffset += 20; |
| 6117 index = path.indexOf("/webproperties/", pathOffset); |
| 6118 unittest.expect(index >= 0, unittest.isTrue); |
| 6119 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6120 pathOffset = index; |
| 6121 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6122 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6123 pathOffset += 15; |
| 6124 index = path.indexOf("/profiles/", pathOffset); |
| 6125 unittest.expect(index >= 0, unittest.isTrue); |
| 6126 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6127 pathOffset = index; |
| 6128 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6129 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6130 pathOffset += 10; |
| 6131 index = path.indexOf("/goals/", pathOffset); |
| 6132 unittest.expect(index >= 0, unittest.isTrue); |
| 6133 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6134 pathOffset = index; |
| 6135 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6136 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/goals/")); |
| 6137 pathOffset += 7; |
| 6138 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 6139 pathOffset = path.length; |
| 6140 unittest.expect(subPart, unittest.equals("$arg_goalId")); |
| 6141 |
| 6142 var query = (req.url).query; |
| 6143 var queryOffset = 0; |
| 6144 var queryMap = {}; |
| 6145 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6146 parseBool(n) { |
| 6147 if (n == "true") return true; |
| 6148 if (n == "false") return false; |
| 6149 if (n == null) return null; |
| 6150 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6151 } |
| 6152 if (query.length > 0) { |
| 6153 for (var part in query.split("&")) { |
| 6154 var keyvalue = part.split("="); |
| 6155 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6156 } |
| 6157 } |
| 6158 |
| 6159 |
| 6160 var h = { |
| 6161 "content-type" : "application/json; charset=utf-8", |
| 6162 }; |
| 6163 var resp = convert.JSON.encode(buildGoal()); |
| 6164 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6165 }), true); |
| 6166 res.patch(arg_request, arg_accountId, arg_webPropertyId, arg_profileId, ar
g_goalId).then(unittest.expectAsync(((api.Goal response) { |
| 6167 checkGoal(response); |
| 6168 }))); |
| 6169 }); |
| 6170 |
| 6171 unittest.test("method--update", () { |
| 6172 |
| 6173 var mock = new common_test.HttpServerMock(); |
| 6174 api.ManagementGoalsResourceApi res = new api.AnalyticsApi(mock).management
.goals; |
| 6175 var arg_request = buildGoal(); |
| 6176 var arg_accountId = "foo"; |
| 6177 var arg_webPropertyId = "foo"; |
| 6178 var arg_profileId = "foo"; |
| 6179 var arg_goalId = "foo"; |
| 6180 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6181 var obj = new api.Goal.fromJson(json); |
| 6182 checkGoal(obj); |
| 6183 |
| 6184 var path = (req.url).path; |
| 6185 var pathOffset = 0; |
| 6186 var index; |
| 6187 var subPart; |
| 6188 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6189 pathOffset += 14; |
| 6190 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6191 pathOffset += 20; |
| 6192 index = path.indexOf("/webproperties/", pathOffset); |
| 6193 unittest.expect(index >= 0, unittest.isTrue); |
| 6194 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6195 pathOffset = index; |
| 6196 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6197 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6198 pathOffset += 15; |
| 6199 index = path.indexOf("/profiles/", pathOffset); |
| 6200 unittest.expect(index >= 0, unittest.isTrue); |
| 6201 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6202 pathOffset = index; |
| 6203 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6204 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6205 pathOffset += 10; |
| 6206 index = path.indexOf("/goals/", pathOffset); |
| 6207 unittest.expect(index >= 0, unittest.isTrue); |
| 6208 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6209 pathOffset = index; |
| 6210 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6211 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als("/goals/")); |
| 6212 pathOffset += 7; |
| 6213 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 6214 pathOffset = path.length; |
| 6215 unittest.expect(subPart, unittest.equals("$arg_goalId")); |
| 6216 |
| 6217 var query = (req.url).query; |
| 6218 var queryOffset = 0; |
| 6219 var queryMap = {}; |
| 6220 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6221 parseBool(n) { |
| 6222 if (n == "true") return true; |
| 6223 if (n == "false") return false; |
| 6224 if (n == null) return null; |
| 6225 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6226 } |
| 6227 if (query.length > 0) { |
| 6228 for (var part in query.split("&")) { |
| 6229 var keyvalue = part.split("="); |
| 6230 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6231 } |
| 6232 } |
| 6233 |
| 6234 |
| 6235 var h = { |
| 6236 "content-type" : "application/json; charset=utf-8", |
| 6237 }; |
| 6238 var resp = convert.JSON.encode(buildGoal()); |
| 6239 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6240 }), true); |
| 6241 res.update(arg_request, arg_accountId, arg_webPropertyId, arg_profileId, a
rg_goalId).then(unittest.expectAsync(((api.Goal response) { |
| 6242 checkGoal(response); |
| 6243 }))); |
| 6244 }); |
| 6245 |
| 6246 }); |
| 6247 |
| 6248 |
| 6249 unittest.group("resource-ManagementProfileFilterLinksResourceApi", () { |
| 6250 unittest.test("method--delete", () { |
| 6251 |
| 6252 var mock = new common_test.HttpServerMock(); |
| 6253 api.ManagementProfileFilterLinksResourceApi res = new api.AnalyticsApi(moc
k).management.profileFilterLinks; |
| 6254 var arg_accountId = "foo"; |
| 6255 var arg_webPropertyId = "foo"; |
| 6256 var arg_profileId = "foo"; |
| 6257 var arg_linkId = "foo"; |
| 6258 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6259 var path = (req.url).path; |
| 6260 var pathOffset = 0; |
| 6261 var index; |
| 6262 var subPart; |
| 6263 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6264 pathOffset += 14; |
| 6265 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6266 pathOffset += 20; |
| 6267 index = path.indexOf("/webproperties/", pathOffset); |
| 6268 unittest.expect(index >= 0, unittest.isTrue); |
| 6269 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6270 pathOffset = index; |
| 6271 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6272 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6273 pathOffset += 15; |
| 6274 index = path.indexOf("/profiles/", pathOffset); |
| 6275 unittest.expect(index >= 0, unittest.isTrue); |
| 6276 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6277 pathOffset = index; |
| 6278 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6279 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6280 pathOffset += 10; |
| 6281 index = path.indexOf("/profileFilterLinks/", pathOffset); |
| 6282 unittest.expect(index >= 0, unittest.isTrue); |
| 6283 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6284 pathOffset = index; |
| 6285 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6286 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("/profileFilterLinks/")); |
| 6287 pathOffset += 20; |
| 6288 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 6289 pathOffset = path.length; |
| 6290 unittest.expect(subPart, unittest.equals("$arg_linkId")); |
| 6291 |
| 6292 var query = (req.url).query; |
| 6293 var queryOffset = 0; |
| 6294 var queryMap = {}; |
| 6295 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6296 parseBool(n) { |
| 6297 if (n == "true") return true; |
| 6298 if (n == "false") return false; |
| 6299 if (n == null) return null; |
| 6300 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6301 } |
| 6302 if (query.length > 0) { |
| 6303 for (var part in query.split("&")) { |
| 6304 var keyvalue = part.split("="); |
| 6305 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6306 } |
| 6307 } |
| 6308 |
| 6309 |
| 6310 var h = { |
| 6311 "content-type" : "application/json; charset=utf-8", |
| 6312 }; |
| 6313 var resp = ""; |
| 6314 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6315 }), true); |
| 6316 res.delete(arg_accountId, arg_webPropertyId, arg_profileId, arg_linkId).th
en(unittest.expectAsync((_) {})); |
| 6317 }); |
| 6318 |
| 6319 unittest.test("method--get", () { |
| 6320 |
| 6321 var mock = new common_test.HttpServerMock(); |
| 6322 api.ManagementProfileFilterLinksResourceApi res = new api.AnalyticsApi(moc
k).management.profileFilterLinks; |
| 6323 var arg_accountId = "foo"; |
| 6324 var arg_webPropertyId = "foo"; |
| 6325 var arg_profileId = "foo"; |
| 6326 var arg_linkId = "foo"; |
| 6327 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6328 var path = (req.url).path; |
| 6329 var pathOffset = 0; |
| 6330 var index; |
| 6331 var subPart; |
| 6332 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6333 pathOffset += 14; |
| 6334 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6335 pathOffset += 20; |
| 6336 index = path.indexOf("/webproperties/", pathOffset); |
| 6337 unittest.expect(index >= 0, unittest.isTrue); |
| 6338 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6339 pathOffset = index; |
| 6340 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6341 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6342 pathOffset += 15; |
| 6343 index = path.indexOf("/profiles/", pathOffset); |
| 6344 unittest.expect(index >= 0, unittest.isTrue); |
| 6345 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6346 pathOffset = index; |
| 6347 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6348 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6349 pathOffset += 10; |
| 6350 index = path.indexOf("/profileFilterLinks/", pathOffset); |
| 6351 unittest.expect(index >= 0, unittest.isTrue); |
| 6352 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6353 pathOffset = index; |
| 6354 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6355 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("/profileFilterLinks/")); |
| 6356 pathOffset += 20; |
| 6357 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 6358 pathOffset = path.length; |
| 6359 unittest.expect(subPart, unittest.equals("$arg_linkId")); |
| 6360 |
| 6361 var query = (req.url).query; |
| 6362 var queryOffset = 0; |
| 6363 var queryMap = {}; |
| 6364 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6365 parseBool(n) { |
| 6366 if (n == "true") return true; |
| 6367 if (n == "false") return false; |
| 6368 if (n == null) return null; |
| 6369 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6370 } |
| 6371 if (query.length > 0) { |
| 6372 for (var part in query.split("&")) { |
| 6373 var keyvalue = part.split("="); |
| 6374 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6375 } |
| 6376 } |
| 6377 |
| 6378 |
| 6379 var h = { |
| 6380 "content-type" : "application/json; charset=utf-8", |
| 6381 }; |
| 6382 var resp = convert.JSON.encode(buildProfileFilterLink()); |
| 6383 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6384 }), true); |
| 6385 res.get(arg_accountId, arg_webPropertyId, arg_profileId, arg_linkId).then(
unittest.expectAsync(((api.ProfileFilterLink response) { |
| 6386 checkProfileFilterLink(response); |
| 6387 }))); |
| 6388 }); |
| 6389 |
| 6390 unittest.test("method--insert", () { |
| 6391 |
| 6392 var mock = new common_test.HttpServerMock(); |
| 6393 api.ManagementProfileFilterLinksResourceApi res = new api.AnalyticsApi(moc
k).management.profileFilterLinks; |
| 6394 var arg_request = buildProfileFilterLink(); |
| 6395 var arg_accountId = "foo"; |
| 6396 var arg_webPropertyId = "foo"; |
| 6397 var arg_profileId = "foo"; |
| 6398 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6399 var obj = new api.ProfileFilterLink.fromJson(json); |
| 6400 checkProfileFilterLink(obj); |
| 6401 |
| 6402 var path = (req.url).path; |
| 6403 var pathOffset = 0; |
| 6404 var index; |
| 6405 var subPart; |
| 6406 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6407 pathOffset += 14; |
| 6408 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6409 pathOffset += 20; |
| 6410 index = path.indexOf("/webproperties/", pathOffset); |
| 6411 unittest.expect(index >= 0, unittest.isTrue); |
| 6412 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6413 pathOffset = index; |
| 6414 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6415 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6416 pathOffset += 15; |
| 6417 index = path.indexOf("/profiles/", pathOffset); |
| 6418 unittest.expect(index >= 0, unittest.isTrue); |
| 6419 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6420 pathOffset = index; |
| 6421 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6422 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6423 pathOffset += 10; |
| 6424 index = path.indexOf("/profileFilterLinks", pathOffset); |
| 6425 unittest.expect(index >= 0, unittest.isTrue); |
| 6426 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6427 pathOffset = index; |
| 6428 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6429 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/profileFilterLinks")); |
| 6430 pathOffset += 19; |
| 6431 |
| 6432 var query = (req.url).query; |
| 6433 var queryOffset = 0; |
| 6434 var queryMap = {}; |
| 6435 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6436 parseBool(n) { |
| 6437 if (n == "true") return true; |
| 6438 if (n == "false") return false; |
| 6439 if (n == null) return null; |
| 6440 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6441 } |
| 6442 if (query.length > 0) { |
| 6443 for (var part in query.split("&")) { |
| 6444 var keyvalue = part.split("="); |
| 6445 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6446 } |
| 6447 } |
| 6448 |
| 6449 |
| 6450 var h = { |
| 6451 "content-type" : "application/json; charset=utf-8", |
| 6452 }; |
| 6453 var resp = convert.JSON.encode(buildProfileFilterLink()); |
| 6454 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6455 }), true); |
| 6456 res.insert(arg_request, arg_accountId, arg_webPropertyId, arg_profileId).t
hen(unittest.expectAsync(((api.ProfileFilterLink response) { |
| 6457 checkProfileFilterLink(response); |
| 6458 }))); |
| 6459 }); |
| 6460 |
| 6461 unittest.test("method--list", () { |
| 6462 |
| 6463 var mock = new common_test.HttpServerMock(); |
| 6464 api.ManagementProfileFilterLinksResourceApi res = new api.AnalyticsApi(moc
k).management.profileFilterLinks; |
| 6465 var arg_accountId = "foo"; |
| 6466 var arg_webPropertyId = "foo"; |
| 6467 var arg_profileId = "foo"; |
| 6468 var arg_max_results = 42; |
| 6469 var arg_start_index = 42; |
| 6470 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6471 var path = (req.url).path; |
| 6472 var pathOffset = 0; |
| 6473 var index; |
| 6474 var subPart; |
| 6475 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6476 pathOffset += 14; |
| 6477 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6478 pathOffset += 20; |
| 6479 index = path.indexOf("/webproperties/", pathOffset); |
| 6480 unittest.expect(index >= 0, unittest.isTrue); |
| 6481 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6482 pathOffset = index; |
| 6483 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6484 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6485 pathOffset += 15; |
| 6486 index = path.indexOf("/profiles/", pathOffset); |
| 6487 unittest.expect(index >= 0, unittest.isTrue); |
| 6488 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6489 pathOffset = index; |
| 6490 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6491 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6492 pathOffset += 10; |
| 6493 index = path.indexOf("/profileFilterLinks", pathOffset); |
| 6494 unittest.expect(index >= 0, unittest.isTrue); |
| 6495 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6496 pathOffset = index; |
| 6497 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6498 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/profileFilterLinks")); |
| 6499 pathOffset += 19; |
| 6500 |
| 6501 var query = (req.url).query; |
| 6502 var queryOffset = 0; |
| 6503 var queryMap = {}; |
| 6504 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6505 parseBool(n) { |
| 6506 if (n == "true") return true; |
| 6507 if (n == "false") return false; |
| 6508 if (n == null) return null; |
| 6509 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6510 } |
| 6511 if (query.length > 0) { |
| 6512 for (var part in query.split("&")) { |
| 6513 var keyvalue = part.split("="); |
| 6514 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6515 } |
| 6516 } |
| 6517 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 6518 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 6519 |
| 6520 |
| 6521 var h = { |
| 6522 "content-type" : "application/json; charset=utf-8", |
| 6523 }; |
| 6524 var resp = convert.JSON.encode(buildProfileFilterLinks()); |
| 6525 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6526 }), true); |
| 6527 res.list(arg_accountId, arg_webPropertyId, arg_profileId, max_results: arg
_max_results, start_index: arg_start_index).then(unittest.expectAsync(((api.Prof
ileFilterLinks response) { |
| 6528 checkProfileFilterLinks(response); |
| 6529 }))); |
| 6530 }); |
| 6531 |
| 6532 unittest.test("method--patch", () { |
| 6533 |
| 6534 var mock = new common_test.HttpServerMock(); |
| 6535 api.ManagementProfileFilterLinksResourceApi res = new api.AnalyticsApi(moc
k).management.profileFilterLinks; |
| 6536 var arg_request = buildProfileFilterLink(); |
| 6537 var arg_accountId = "foo"; |
| 6538 var arg_webPropertyId = "foo"; |
| 6539 var arg_profileId = "foo"; |
| 6540 var arg_linkId = "foo"; |
| 6541 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6542 var obj = new api.ProfileFilterLink.fromJson(json); |
| 6543 checkProfileFilterLink(obj); |
| 6544 |
| 6545 var path = (req.url).path; |
| 6546 var pathOffset = 0; |
| 6547 var index; |
| 6548 var subPart; |
| 6549 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6550 pathOffset += 14; |
| 6551 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6552 pathOffset += 20; |
| 6553 index = path.indexOf("/webproperties/", pathOffset); |
| 6554 unittest.expect(index >= 0, unittest.isTrue); |
| 6555 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6556 pathOffset = index; |
| 6557 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6558 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6559 pathOffset += 15; |
| 6560 index = path.indexOf("/profiles/", pathOffset); |
| 6561 unittest.expect(index >= 0, unittest.isTrue); |
| 6562 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6563 pathOffset = index; |
| 6564 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6565 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6566 pathOffset += 10; |
| 6567 index = path.indexOf("/profileFilterLinks/", pathOffset); |
| 6568 unittest.expect(index >= 0, unittest.isTrue); |
| 6569 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6570 pathOffset = index; |
| 6571 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6572 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("/profileFilterLinks/")); |
| 6573 pathOffset += 20; |
| 6574 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 6575 pathOffset = path.length; |
| 6576 unittest.expect(subPart, unittest.equals("$arg_linkId")); |
| 6577 |
| 6578 var query = (req.url).query; |
| 6579 var queryOffset = 0; |
| 6580 var queryMap = {}; |
| 6581 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6582 parseBool(n) { |
| 6583 if (n == "true") return true; |
| 6584 if (n == "false") return false; |
| 6585 if (n == null) return null; |
| 6586 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6587 } |
| 6588 if (query.length > 0) { |
| 6589 for (var part in query.split("&")) { |
| 6590 var keyvalue = part.split("="); |
| 6591 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6592 } |
| 6593 } |
| 6594 |
| 6595 |
| 6596 var h = { |
| 6597 "content-type" : "application/json; charset=utf-8", |
| 6598 }; |
| 6599 var resp = convert.JSON.encode(buildProfileFilterLink()); |
| 6600 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6601 }), true); |
| 6602 res.patch(arg_request, arg_accountId, arg_webPropertyId, arg_profileId, ar
g_linkId).then(unittest.expectAsync(((api.ProfileFilterLink response) { |
| 6603 checkProfileFilterLink(response); |
| 6604 }))); |
| 6605 }); |
| 6606 |
| 6607 unittest.test("method--update", () { |
| 6608 |
| 6609 var mock = new common_test.HttpServerMock(); |
| 6610 api.ManagementProfileFilterLinksResourceApi res = new api.AnalyticsApi(moc
k).management.profileFilterLinks; |
| 6611 var arg_request = buildProfileFilterLink(); |
| 6612 var arg_accountId = "foo"; |
| 6613 var arg_webPropertyId = "foo"; |
| 6614 var arg_profileId = "foo"; |
| 6615 var arg_linkId = "foo"; |
| 6616 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6617 var obj = new api.ProfileFilterLink.fromJson(json); |
| 6618 checkProfileFilterLink(obj); |
| 6619 |
| 6620 var path = (req.url).path; |
| 6621 var pathOffset = 0; |
| 6622 var index; |
| 6623 var subPart; |
| 6624 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6625 pathOffset += 14; |
| 6626 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6627 pathOffset += 20; |
| 6628 index = path.indexOf("/webproperties/", pathOffset); |
| 6629 unittest.expect(index >= 0, unittest.isTrue); |
| 6630 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6631 pathOffset = index; |
| 6632 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6633 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6634 pathOffset += 15; |
| 6635 index = path.indexOf("/profiles/", pathOffset); |
| 6636 unittest.expect(index >= 0, unittest.isTrue); |
| 6637 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6638 pathOffset = index; |
| 6639 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6640 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6641 pathOffset += 10; |
| 6642 index = path.indexOf("/profileFilterLinks/", pathOffset); |
| 6643 unittest.expect(index >= 0, unittest.isTrue); |
| 6644 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6645 pathOffset = index; |
| 6646 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6647 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("/profileFilterLinks/")); |
| 6648 pathOffset += 20; |
| 6649 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 6650 pathOffset = path.length; |
| 6651 unittest.expect(subPart, unittest.equals("$arg_linkId")); |
| 6652 |
| 6653 var query = (req.url).query; |
| 6654 var queryOffset = 0; |
| 6655 var queryMap = {}; |
| 6656 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6657 parseBool(n) { |
| 6658 if (n == "true") return true; |
| 6659 if (n == "false") return false; |
| 6660 if (n == null) return null; |
| 6661 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6662 } |
| 6663 if (query.length > 0) { |
| 6664 for (var part in query.split("&")) { |
| 6665 var keyvalue = part.split("="); |
| 6666 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6667 } |
| 6668 } |
| 6669 |
| 6670 |
| 6671 var h = { |
| 6672 "content-type" : "application/json; charset=utf-8", |
| 6673 }; |
| 6674 var resp = convert.JSON.encode(buildProfileFilterLink()); |
| 6675 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6676 }), true); |
| 6677 res.update(arg_request, arg_accountId, arg_webPropertyId, arg_profileId, a
rg_linkId).then(unittest.expectAsync(((api.ProfileFilterLink response) { |
| 6678 checkProfileFilterLink(response); |
| 6679 }))); |
| 6680 }); |
| 6681 |
| 6682 }); |
| 6683 |
| 6684 |
| 6685 unittest.group("resource-ManagementProfileUserLinksResourceApi", () { |
| 6686 unittest.test("method--delete", () { |
| 6687 |
| 6688 var mock = new common_test.HttpServerMock(); |
| 6689 api.ManagementProfileUserLinksResourceApi res = new api.AnalyticsApi(mock)
.management.profileUserLinks; |
| 6690 var arg_accountId = "foo"; |
| 6691 var arg_webPropertyId = "foo"; |
| 6692 var arg_profileId = "foo"; |
| 6693 var arg_linkId = "foo"; |
| 6694 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6695 var path = (req.url).path; |
| 6696 var pathOffset = 0; |
| 6697 var index; |
| 6698 var subPart; |
| 6699 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6700 pathOffset += 14; |
| 6701 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6702 pathOffset += 20; |
| 6703 index = path.indexOf("/webproperties/", pathOffset); |
| 6704 unittest.expect(index >= 0, unittest.isTrue); |
| 6705 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6706 pathOffset = index; |
| 6707 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6708 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6709 pathOffset += 15; |
| 6710 index = path.indexOf("/profiles/", pathOffset); |
| 6711 unittest.expect(index >= 0, unittest.isTrue); |
| 6712 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6713 pathOffset = index; |
| 6714 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6715 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6716 pathOffset += 10; |
| 6717 index = path.indexOf("/entityUserLinks/", pathOffset); |
| 6718 unittest.expect(index >= 0, unittest.isTrue); |
| 6719 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6720 pathOffset = index; |
| 6721 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6722 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/entityUserLinks/")); |
| 6723 pathOffset += 17; |
| 6724 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 6725 pathOffset = path.length; |
| 6726 unittest.expect(subPart, unittest.equals("$arg_linkId")); |
| 6727 |
| 6728 var query = (req.url).query; |
| 6729 var queryOffset = 0; |
| 6730 var queryMap = {}; |
| 6731 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6732 parseBool(n) { |
| 6733 if (n == "true") return true; |
| 6734 if (n == "false") return false; |
| 6735 if (n == null) return null; |
| 6736 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6737 } |
| 6738 if (query.length > 0) { |
| 6739 for (var part in query.split("&")) { |
| 6740 var keyvalue = part.split("="); |
| 6741 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6742 } |
| 6743 } |
| 6744 |
| 6745 |
| 6746 var h = { |
| 6747 "content-type" : "application/json; charset=utf-8", |
| 6748 }; |
| 6749 var resp = ""; |
| 6750 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6751 }), true); |
| 6752 res.delete(arg_accountId, arg_webPropertyId, arg_profileId, arg_linkId).th
en(unittest.expectAsync((_) {})); |
| 6753 }); |
| 6754 |
| 6755 unittest.test("method--insert", () { |
| 6756 |
| 6757 var mock = new common_test.HttpServerMock(); |
| 6758 api.ManagementProfileUserLinksResourceApi res = new api.AnalyticsApi(mock)
.management.profileUserLinks; |
| 6759 var arg_request = buildEntityUserLink(); |
| 6760 var arg_accountId = "foo"; |
| 6761 var arg_webPropertyId = "foo"; |
| 6762 var arg_profileId = "foo"; |
| 6763 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6764 var obj = new api.EntityUserLink.fromJson(json); |
| 6765 checkEntityUserLink(obj); |
| 6766 |
| 6767 var path = (req.url).path; |
| 6768 var pathOffset = 0; |
| 6769 var index; |
| 6770 var subPart; |
| 6771 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6772 pathOffset += 14; |
| 6773 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6774 pathOffset += 20; |
| 6775 index = path.indexOf("/webproperties/", pathOffset); |
| 6776 unittest.expect(index >= 0, unittest.isTrue); |
| 6777 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6778 pathOffset = index; |
| 6779 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6780 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6781 pathOffset += 15; |
| 6782 index = path.indexOf("/profiles/", pathOffset); |
| 6783 unittest.expect(index >= 0, unittest.isTrue); |
| 6784 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6785 pathOffset = index; |
| 6786 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6787 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6788 pathOffset += 10; |
| 6789 index = path.indexOf("/entityUserLinks", pathOffset); |
| 6790 unittest.expect(index >= 0, unittest.isTrue); |
| 6791 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6792 pathOffset = index; |
| 6793 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6794 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/entityUserLinks")); |
| 6795 pathOffset += 16; |
| 6796 |
| 6797 var query = (req.url).query; |
| 6798 var queryOffset = 0; |
| 6799 var queryMap = {}; |
| 6800 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6801 parseBool(n) { |
| 6802 if (n == "true") return true; |
| 6803 if (n == "false") return false; |
| 6804 if (n == null) return null; |
| 6805 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6806 } |
| 6807 if (query.length > 0) { |
| 6808 for (var part in query.split("&")) { |
| 6809 var keyvalue = part.split("="); |
| 6810 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6811 } |
| 6812 } |
| 6813 |
| 6814 |
| 6815 var h = { |
| 6816 "content-type" : "application/json; charset=utf-8", |
| 6817 }; |
| 6818 var resp = convert.JSON.encode(buildEntityUserLink()); |
| 6819 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6820 }), true); |
| 6821 res.insert(arg_request, arg_accountId, arg_webPropertyId, arg_profileId).t
hen(unittest.expectAsync(((api.EntityUserLink response) { |
| 6822 checkEntityUserLink(response); |
| 6823 }))); |
| 6824 }); |
| 6825 |
| 6826 unittest.test("method--list", () { |
| 6827 |
| 6828 var mock = new common_test.HttpServerMock(); |
| 6829 api.ManagementProfileUserLinksResourceApi res = new api.AnalyticsApi(mock)
.management.profileUserLinks; |
| 6830 var arg_accountId = "foo"; |
| 6831 var arg_webPropertyId = "foo"; |
| 6832 var arg_profileId = "foo"; |
| 6833 var arg_max_results = 42; |
| 6834 var arg_start_index = 42; |
| 6835 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6836 var path = (req.url).path; |
| 6837 var pathOffset = 0; |
| 6838 var index; |
| 6839 var subPart; |
| 6840 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6841 pathOffset += 14; |
| 6842 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6843 pathOffset += 20; |
| 6844 index = path.indexOf("/webproperties/", pathOffset); |
| 6845 unittest.expect(index >= 0, unittest.isTrue); |
| 6846 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6847 pathOffset = index; |
| 6848 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6849 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6850 pathOffset += 15; |
| 6851 index = path.indexOf("/profiles/", pathOffset); |
| 6852 unittest.expect(index >= 0, unittest.isTrue); |
| 6853 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6854 pathOffset = index; |
| 6855 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6856 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6857 pathOffset += 10; |
| 6858 index = path.indexOf("/entityUserLinks", pathOffset); |
| 6859 unittest.expect(index >= 0, unittest.isTrue); |
| 6860 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6861 pathOffset = index; |
| 6862 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6863 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/entityUserLinks")); |
| 6864 pathOffset += 16; |
| 6865 |
| 6866 var query = (req.url).query; |
| 6867 var queryOffset = 0; |
| 6868 var queryMap = {}; |
| 6869 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6870 parseBool(n) { |
| 6871 if (n == "true") return true; |
| 6872 if (n == "false") return false; |
| 6873 if (n == null) return null; |
| 6874 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6875 } |
| 6876 if (query.length > 0) { |
| 6877 for (var part in query.split("&")) { |
| 6878 var keyvalue = part.split("="); |
| 6879 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6880 } |
| 6881 } |
| 6882 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 6883 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 6884 |
| 6885 |
| 6886 var h = { |
| 6887 "content-type" : "application/json; charset=utf-8", |
| 6888 }; |
| 6889 var resp = convert.JSON.encode(buildEntityUserLinks()); |
| 6890 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6891 }), true); |
| 6892 res.list(arg_accountId, arg_webPropertyId, arg_profileId, max_results: arg
_max_results, start_index: arg_start_index).then(unittest.expectAsync(((api.Enti
tyUserLinks response) { |
| 6893 checkEntityUserLinks(response); |
| 6894 }))); |
| 6895 }); |
| 6896 |
| 6897 unittest.test("method--update", () { |
| 6898 |
| 6899 var mock = new common_test.HttpServerMock(); |
| 6900 api.ManagementProfileUserLinksResourceApi res = new api.AnalyticsApi(mock)
.management.profileUserLinks; |
| 6901 var arg_request = buildEntityUserLink(); |
| 6902 var arg_accountId = "foo"; |
| 6903 var arg_webPropertyId = "foo"; |
| 6904 var arg_profileId = "foo"; |
| 6905 var arg_linkId = "foo"; |
| 6906 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6907 var obj = new api.EntityUserLink.fromJson(json); |
| 6908 checkEntityUserLink(obj); |
| 6909 |
| 6910 var path = (req.url).path; |
| 6911 var pathOffset = 0; |
| 6912 var index; |
| 6913 var subPart; |
| 6914 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6915 pathOffset += 14; |
| 6916 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6917 pathOffset += 20; |
| 6918 index = path.indexOf("/webproperties/", pathOffset); |
| 6919 unittest.expect(index >= 0, unittest.isTrue); |
| 6920 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6921 pathOffset = index; |
| 6922 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6923 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6924 pathOffset += 15; |
| 6925 index = path.indexOf("/profiles/", pathOffset); |
| 6926 unittest.expect(index >= 0, unittest.isTrue); |
| 6927 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6928 pathOffset = index; |
| 6929 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 6930 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 6931 pathOffset += 10; |
| 6932 index = path.indexOf("/entityUserLinks/", pathOffset); |
| 6933 unittest.expect(index >= 0, unittest.isTrue); |
| 6934 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6935 pathOffset = index; |
| 6936 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 6937 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/entityUserLinks/")); |
| 6938 pathOffset += 17; |
| 6939 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 6940 pathOffset = path.length; |
| 6941 unittest.expect(subPart, unittest.equals("$arg_linkId")); |
| 6942 |
| 6943 var query = (req.url).query; |
| 6944 var queryOffset = 0; |
| 6945 var queryMap = {}; |
| 6946 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 6947 parseBool(n) { |
| 6948 if (n == "true") return true; |
| 6949 if (n == "false") return false; |
| 6950 if (n == null) return null; |
| 6951 throw new core.ArgumentError("Invalid boolean: $n"); |
| 6952 } |
| 6953 if (query.length > 0) { |
| 6954 for (var part in query.split("&")) { |
| 6955 var keyvalue = part.split("="); |
| 6956 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 6957 } |
| 6958 } |
| 6959 |
| 6960 |
| 6961 var h = { |
| 6962 "content-type" : "application/json; charset=utf-8", |
| 6963 }; |
| 6964 var resp = convert.JSON.encode(buildEntityUserLink()); |
| 6965 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 6966 }), true); |
| 6967 res.update(arg_request, arg_accountId, arg_webPropertyId, arg_profileId, a
rg_linkId).then(unittest.expectAsync(((api.EntityUserLink response) { |
| 6968 checkEntityUserLink(response); |
| 6969 }))); |
| 6970 }); |
| 6971 |
| 6972 }); |
| 6973 |
| 6974 |
| 6975 unittest.group("resource-ManagementProfilesResourceApi", () { |
| 6976 unittest.test("method--delete", () { |
| 6977 |
| 6978 var mock = new common_test.HttpServerMock(); |
| 6979 api.ManagementProfilesResourceApi res = new api.AnalyticsApi(mock).managem
ent.profiles; |
| 6980 var arg_accountId = "foo"; |
| 6981 var arg_webPropertyId = "foo"; |
| 6982 var arg_profileId = "foo"; |
| 6983 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 6984 var path = (req.url).path; |
| 6985 var pathOffset = 0; |
| 6986 var index; |
| 6987 var subPart; |
| 6988 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 6989 pathOffset += 14; |
| 6990 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 6991 pathOffset += 20; |
| 6992 index = path.indexOf("/webproperties/", pathOffset); |
| 6993 unittest.expect(index >= 0, unittest.isTrue); |
| 6994 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 6995 pathOffset = index; |
| 6996 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 6997 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 6998 pathOffset += 15; |
| 6999 index = path.indexOf("/profiles/", pathOffset); |
| 7000 unittest.expect(index >= 0, unittest.isTrue); |
| 7001 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7002 pathOffset = index; |
| 7003 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7004 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 7005 pathOffset += 10; |
| 7006 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 7007 pathOffset = path.length; |
| 7008 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 7009 |
| 7010 var query = (req.url).query; |
| 7011 var queryOffset = 0; |
| 7012 var queryMap = {}; |
| 7013 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7014 parseBool(n) { |
| 7015 if (n == "true") return true; |
| 7016 if (n == "false") return false; |
| 7017 if (n == null) return null; |
| 7018 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7019 } |
| 7020 if (query.length > 0) { |
| 7021 for (var part in query.split("&")) { |
| 7022 var keyvalue = part.split("="); |
| 7023 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7024 } |
| 7025 } |
| 7026 |
| 7027 |
| 7028 var h = { |
| 7029 "content-type" : "application/json; charset=utf-8", |
| 7030 }; |
| 7031 var resp = ""; |
| 7032 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7033 }), true); |
| 7034 res.delete(arg_accountId, arg_webPropertyId, arg_profileId).then(unittest.
expectAsync((_) {})); |
| 7035 }); |
| 7036 |
| 7037 unittest.test("method--get", () { |
| 7038 |
| 7039 var mock = new common_test.HttpServerMock(); |
| 7040 api.ManagementProfilesResourceApi res = new api.AnalyticsApi(mock).managem
ent.profiles; |
| 7041 var arg_accountId = "foo"; |
| 7042 var arg_webPropertyId = "foo"; |
| 7043 var arg_profileId = "foo"; |
| 7044 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7045 var path = (req.url).path; |
| 7046 var pathOffset = 0; |
| 7047 var index; |
| 7048 var subPart; |
| 7049 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7050 pathOffset += 14; |
| 7051 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7052 pathOffset += 20; |
| 7053 index = path.indexOf("/webproperties/", pathOffset); |
| 7054 unittest.expect(index >= 0, unittest.isTrue); |
| 7055 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7056 pathOffset = index; |
| 7057 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7058 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7059 pathOffset += 15; |
| 7060 index = path.indexOf("/profiles/", pathOffset); |
| 7061 unittest.expect(index >= 0, unittest.isTrue); |
| 7062 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7063 pathOffset = index; |
| 7064 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7065 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 7066 pathOffset += 10; |
| 7067 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 7068 pathOffset = path.length; |
| 7069 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 7070 |
| 7071 var query = (req.url).query; |
| 7072 var queryOffset = 0; |
| 7073 var queryMap = {}; |
| 7074 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7075 parseBool(n) { |
| 7076 if (n == "true") return true; |
| 7077 if (n == "false") return false; |
| 7078 if (n == null) return null; |
| 7079 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7080 } |
| 7081 if (query.length > 0) { |
| 7082 for (var part in query.split("&")) { |
| 7083 var keyvalue = part.split("="); |
| 7084 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7085 } |
| 7086 } |
| 7087 |
| 7088 |
| 7089 var h = { |
| 7090 "content-type" : "application/json; charset=utf-8", |
| 7091 }; |
| 7092 var resp = convert.JSON.encode(buildProfile()); |
| 7093 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7094 }), true); |
| 7095 res.get(arg_accountId, arg_webPropertyId, arg_profileId).then(unittest.exp
ectAsync(((api.Profile response) { |
| 7096 checkProfile(response); |
| 7097 }))); |
| 7098 }); |
| 7099 |
| 7100 unittest.test("method--insert", () { |
| 7101 |
| 7102 var mock = new common_test.HttpServerMock(); |
| 7103 api.ManagementProfilesResourceApi res = new api.AnalyticsApi(mock).managem
ent.profiles; |
| 7104 var arg_request = buildProfile(); |
| 7105 var arg_accountId = "foo"; |
| 7106 var arg_webPropertyId = "foo"; |
| 7107 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7108 var obj = new api.Profile.fromJson(json); |
| 7109 checkProfile(obj); |
| 7110 |
| 7111 var path = (req.url).path; |
| 7112 var pathOffset = 0; |
| 7113 var index; |
| 7114 var subPart; |
| 7115 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7116 pathOffset += 14; |
| 7117 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7118 pathOffset += 20; |
| 7119 index = path.indexOf("/webproperties/", pathOffset); |
| 7120 unittest.expect(index >= 0, unittest.isTrue); |
| 7121 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7122 pathOffset = index; |
| 7123 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7124 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7125 pathOffset += 15; |
| 7126 index = path.indexOf("/profiles", pathOffset); |
| 7127 unittest.expect(index >= 0, unittest.isTrue); |
| 7128 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7129 pathOffset = index; |
| 7130 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7131 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/profiles")); |
| 7132 pathOffset += 9; |
| 7133 |
| 7134 var query = (req.url).query; |
| 7135 var queryOffset = 0; |
| 7136 var queryMap = {}; |
| 7137 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7138 parseBool(n) { |
| 7139 if (n == "true") return true; |
| 7140 if (n == "false") return false; |
| 7141 if (n == null) return null; |
| 7142 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7143 } |
| 7144 if (query.length > 0) { |
| 7145 for (var part in query.split("&")) { |
| 7146 var keyvalue = part.split("="); |
| 7147 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7148 } |
| 7149 } |
| 7150 |
| 7151 |
| 7152 var h = { |
| 7153 "content-type" : "application/json; charset=utf-8", |
| 7154 }; |
| 7155 var resp = convert.JSON.encode(buildProfile()); |
| 7156 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7157 }), true); |
| 7158 res.insert(arg_request, arg_accountId, arg_webPropertyId).then(unittest.ex
pectAsync(((api.Profile response) { |
| 7159 checkProfile(response); |
| 7160 }))); |
| 7161 }); |
| 7162 |
| 7163 unittest.test("method--list", () { |
| 7164 |
| 7165 var mock = new common_test.HttpServerMock(); |
| 7166 api.ManagementProfilesResourceApi res = new api.AnalyticsApi(mock).managem
ent.profiles; |
| 7167 var arg_accountId = "foo"; |
| 7168 var arg_webPropertyId = "foo"; |
| 7169 var arg_max_results = 42; |
| 7170 var arg_start_index = 42; |
| 7171 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7172 var path = (req.url).path; |
| 7173 var pathOffset = 0; |
| 7174 var index; |
| 7175 var subPart; |
| 7176 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7177 pathOffset += 14; |
| 7178 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7179 pathOffset += 20; |
| 7180 index = path.indexOf("/webproperties/", pathOffset); |
| 7181 unittest.expect(index >= 0, unittest.isTrue); |
| 7182 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7183 pathOffset = index; |
| 7184 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7185 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7186 pathOffset += 15; |
| 7187 index = path.indexOf("/profiles", pathOffset); |
| 7188 unittest.expect(index >= 0, unittest.isTrue); |
| 7189 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7190 pathOffset = index; |
| 7191 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7192 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/profiles")); |
| 7193 pathOffset += 9; |
| 7194 |
| 7195 var query = (req.url).query; |
| 7196 var queryOffset = 0; |
| 7197 var queryMap = {}; |
| 7198 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7199 parseBool(n) { |
| 7200 if (n == "true") return true; |
| 7201 if (n == "false") return false; |
| 7202 if (n == null) return null; |
| 7203 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7204 } |
| 7205 if (query.length > 0) { |
| 7206 for (var part in query.split("&")) { |
| 7207 var keyvalue = part.split("="); |
| 7208 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7209 } |
| 7210 } |
| 7211 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 7212 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 7213 |
| 7214 |
| 7215 var h = { |
| 7216 "content-type" : "application/json; charset=utf-8", |
| 7217 }; |
| 7218 var resp = convert.JSON.encode(buildProfiles()); |
| 7219 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7220 }), true); |
| 7221 res.list(arg_accountId, arg_webPropertyId, max_results: arg_max_results, s
tart_index: arg_start_index).then(unittest.expectAsync(((api.Profiles response)
{ |
| 7222 checkProfiles(response); |
| 7223 }))); |
| 7224 }); |
| 7225 |
| 7226 unittest.test("method--patch", () { |
| 7227 |
| 7228 var mock = new common_test.HttpServerMock(); |
| 7229 api.ManagementProfilesResourceApi res = new api.AnalyticsApi(mock).managem
ent.profiles; |
| 7230 var arg_request = buildProfile(); |
| 7231 var arg_accountId = "foo"; |
| 7232 var arg_webPropertyId = "foo"; |
| 7233 var arg_profileId = "foo"; |
| 7234 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7235 var obj = new api.Profile.fromJson(json); |
| 7236 checkProfile(obj); |
| 7237 |
| 7238 var path = (req.url).path; |
| 7239 var pathOffset = 0; |
| 7240 var index; |
| 7241 var subPart; |
| 7242 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7243 pathOffset += 14; |
| 7244 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7245 pathOffset += 20; |
| 7246 index = path.indexOf("/webproperties/", pathOffset); |
| 7247 unittest.expect(index >= 0, unittest.isTrue); |
| 7248 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7249 pathOffset = index; |
| 7250 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7251 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7252 pathOffset += 15; |
| 7253 index = path.indexOf("/profiles/", pathOffset); |
| 7254 unittest.expect(index >= 0, unittest.isTrue); |
| 7255 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7256 pathOffset = index; |
| 7257 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7258 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 7259 pathOffset += 10; |
| 7260 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 7261 pathOffset = path.length; |
| 7262 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 7263 |
| 7264 var query = (req.url).query; |
| 7265 var queryOffset = 0; |
| 7266 var queryMap = {}; |
| 7267 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7268 parseBool(n) { |
| 7269 if (n == "true") return true; |
| 7270 if (n == "false") return false; |
| 7271 if (n == null) return null; |
| 7272 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7273 } |
| 7274 if (query.length > 0) { |
| 7275 for (var part in query.split("&")) { |
| 7276 var keyvalue = part.split("="); |
| 7277 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7278 } |
| 7279 } |
| 7280 |
| 7281 |
| 7282 var h = { |
| 7283 "content-type" : "application/json; charset=utf-8", |
| 7284 }; |
| 7285 var resp = convert.JSON.encode(buildProfile()); |
| 7286 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7287 }), true); |
| 7288 res.patch(arg_request, arg_accountId, arg_webPropertyId, arg_profileId).th
en(unittest.expectAsync(((api.Profile response) { |
| 7289 checkProfile(response); |
| 7290 }))); |
| 7291 }); |
| 7292 |
| 7293 unittest.test("method--update", () { |
| 7294 |
| 7295 var mock = new common_test.HttpServerMock(); |
| 7296 api.ManagementProfilesResourceApi res = new api.AnalyticsApi(mock).managem
ent.profiles; |
| 7297 var arg_request = buildProfile(); |
| 7298 var arg_accountId = "foo"; |
| 7299 var arg_webPropertyId = "foo"; |
| 7300 var arg_profileId = "foo"; |
| 7301 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7302 var obj = new api.Profile.fromJson(json); |
| 7303 checkProfile(obj); |
| 7304 |
| 7305 var path = (req.url).path; |
| 7306 var pathOffset = 0; |
| 7307 var index; |
| 7308 var subPart; |
| 7309 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7310 pathOffset += 14; |
| 7311 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7312 pathOffset += 20; |
| 7313 index = path.indexOf("/webproperties/", pathOffset); |
| 7314 unittest.expect(index >= 0, unittest.isTrue); |
| 7315 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7316 pathOffset = index; |
| 7317 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7318 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7319 pathOffset += 15; |
| 7320 index = path.indexOf("/profiles/", pathOffset); |
| 7321 unittest.expect(index >= 0, unittest.isTrue); |
| 7322 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7323 pathOffset = index; |
| 7324 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7325 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 7326 pathOffset += 10; |
| 7327 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 7328 pathOffset = path.length; |
| 7329 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 7330 |
| 7331 var query = (req.url).query; |
| 7332 var queryOffset = 0; |
| 7333 var queryMap = {}; |
| 7334 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7335 parseBool(n) { |
| 7336 if (n == "true") return true; |
| 7337 if (n == "false") return false; |
| 7338 if (n == null) return null; |
| 7339 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7340 } |
| 7341 if (query.length > 0) { |
| 7342 for (var part in query.split("&")) { |
| 7343 var keyvalue = part.split("="); |
| 7344 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7345 } |
| 7346 } |
| 7347 |
| 7348 |
| 7349 var h = { |
| 7350 "content-type" : "application/json; charset=utf-8", |
| 7351 }; |
| 7352 var resp = convert.JSON.encode(buildProfile()); |
| 7353 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7354 }), true); |
| 7355 res.update(arg_request, arg_accountId, arg_webPropertyId, arg_profileId).t
hen(unittest.expectAsync(((api.Profile response) { |
| 7356 checkProfile(response); |
| 7357 }))); |
| 7358 }); |
| 7359 |
| 7360 }); |
| 7361 |
| 7362 |
| 7363 unittest.group("resource-ManagementSegmentsResourceApi", () { |
| 7364 unittest.test("method--list", () { |
| 7365 |
| 7366 var mock = new common_test.HttpServerMock(); |
| 7367 api.ManagementSegmentsResourceApi res = new api.AnalyticsApi(mock).managem
ent.segments; |
| 7368 var arg_max_results = 42; |
| 7369 var arg_start_index = 42; |
| 7370 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7371 var path = (req.url).path; |
| 7372 var pathOffset = 0; |
| 7373 var index; |
| 7374 var subPart; |
| 7375 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7376 pathOffset += 14; |
| 7377 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("management/segments")); |
| 7378 pathOffset += 19; |
| 7379 |
| 7380 var query = (req.url).query; |
| 7381 var queryOffset = 0; |
| 7382 var queryMap = {}; |
| 7383 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7384 parseBool(n) { |
| 7385 if (n == "true") return true; |
| 7386 if (n == "false") return false; |
| 7387 if (n == null) return null; |
| 7388 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7389 } |
| 7390 if (query.length > 0) { |
| 7391 for (var part in query.split("&")) { |
| 7392 var keyvalue = part.split("="); |
| 7393 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7394 } |
| 7395 } |
| 7396 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 7397 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 7398 |
| 7399 |
| 7400 var h = { |
| 7401 "content-type" : "application/json; charset=utf-8", |
| 7402 }; |
| 7403 var resp = convert.JSON.encode(buildSegments()); |
| 7404 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7405 }), true); |
| 7406 res.list(max_results: arg_max_results, start_index: arg_start_index).then(
unittest.expectAsync(((api.Segments response) { |
| 7407 checkSegments(response); |
| 7408 }))); |
| 7409 }); |
| 7410 |
| 7411 }); |
| 7412 |
| 7413 |
| 7414 unittest.group("resource-ManagementUnsampledReportsResourceApi", () { |
| 7415 unittest.test("method--get", () { |
| 7416 |
| 7417 var mock = new common_test.HttpServerMock(); |
| 7418 api.ManagementUnsampledReportsResourceApi res = new api.AnalyticsApi(mock)
.management.unsampledReports; |
| 7419 var arg_accountId = "foo"; |
| 7420 var arg_webPropertyId = "foo"; |
| 7421 var arg_profileId = "foo"; |
| 7422 var arg_unsampledReportId = "foo"; |
| 7423 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7424 var path = (req.url).path; |
| 7425 var pathOffset = 0; |
| 7426 var index; |
| 7427 var subPart; |
| 7428 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7429 pathOffset += 14; |
| 7430 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7431 pathOffset += 20; |
| 7432 index = path.indexOf("/webproperties/", pathOffset); |
| 7433 unittest.expect(index >= 0, unittest.isTrue); |
| 7434 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7435 pathOffset = index; |
| 7436 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7437 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7438 pathOffset += 15; |
| 7439 index = path.indexOf("/profiles/", pathOffset); |
| 7440 unittest.expect(index >= 0, unittest.isTrue); |
| 7441 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7442 pathOffset = index; |
| 7443 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7444 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 7445 pathOffset += 10; |
| 7446 index = path.indexOf("/unsampledReports/", pathOffset); |
| 7447 unittest.expect(index >= 0, unittest.isTrue); |
| 7448 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7449 pathOffset = index; |
| 7450 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 7451 unittest.expect(path.substring(pathOffset, pathOffset + 18), unittest.eq
uals("/unsampledReports/")); |
| 7452 pathOffset += 18; |
| 7453 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 7454 pathOffset = path.length; |
| 7455 unittest.expect(subPart, unittest.equals("$arg_unsampledReportId")); |
| 7456 |
| 7457 var query = (req.url).query; |
| 7458 var queryOffset = 0; |
| 7459 var queryMap = {}; |
| 7460 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7461 parseBool(n) { |
| 7462 if (n == "true") return true; |
| 7463 if (n == "false") return false; |
| 7464 if (n == null) return null; |
| 7465 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7466 } |
| 7467 if (query.length > 0) { |
| 7468 for (var part in query.split("&")) { |
| 7469 var keyvalue = part.split("="); |
| 7470 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7471 } |
| 7472 } |
| 7473 |
| 7474 |
| 7475 var h = { |
| 7476 "content-type" : "application/json; charset=utf-8", |
| 7477 }; |
| 7478 var resp = convert.JSON.encode(buildUnsampledReport()); |
| 7479 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7480 }), true); |
| 7481 res.get(arg_accountId, arg_webPropertyId, arg_profileId, arg_unsampledRepo
rtId).then(unittest.expectAsync(((api.UnsampledReport response) { |
| 7482 checkUnsampledReport(response); |
| 7483 }))); |
| 7484 }); |
| 7485 |
| 7486 unittest.test("method--insert", () { |
| 7487 |
| 7488 var mock = new common_test.HttpServerMock(); |
| 7489 api.ManagementUnsampledReportsResourceApi res = new api.AnalyticsApi(mock)
.management.unsampledReports; |
| 7490 var arg_request = buildUnsampledReport(); |
| 7491 var arg_accountId = "foo"; |
| 7492 var arg_webPropertyId = "foo"; |
| 7493 var arg_profileId = "foo"; |
| 7494 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7495 var obj = new api.UnsampledReport.fromJson(json); |
| 7496 checkUnsampledReport(obj); |
| 7497 |
| 7498 var path = (req.url).path; |
| 7499 var pathOffset = 0; |
| 7500 var index; |
| 7501 var subPart; |
| 7502 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7503 pathOffset += 14; |
| 7504 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7505 pathOffset += 20; |
| 7506 index = path.indexOf("/webproperties/", pathOffset); |
| 7507 unittest.expect(index >= 0, unittest.isTrue); |
| 7508 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7509 pathOffset = index; |
| 7510 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7511 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7512 pathOffset += 15; |
| 7513 index = path.indexOf("/profiles/", pathOffset); |
| 7514 unittest.expect(index >= 0, unittest.isTrue); |
| 7515 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7516 pathOffset = index; |
| 7517 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7518 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 7519 pathOffset += 10; |
| 7520 index = path.indexOf("/unsampledReports", pathOffset); |
| 7521 unittest.expect(index >= 0, unittest.isTrue); |
| 7522 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7523 pathOffset = index; |
| 7524 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 7525 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/unsampledReports")); |
| 7526 pathOffset += 17; |
| 7527 |
| 7528 var query = (req.url).query; |
| 7529 var queryOffset = 0; |
| 7530 var queryMap = {}; |
| 7531 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7532 parseBool(n) { |
| 7533 if (n == "true") return true; |
| 7534 if (n == "false") return false; |
| 7535 if (n == null) return null; |
| 7536 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7537 } |
| 7538 if (query.length > 0) { |
| 7539 for (var part in query.split("&")) { |
| 7540 var keyvalue = part.split("="); |
| 7541 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7542 } |
| 7543 } |
| 7544 |
| 7545 |
| 7546 var h = { |
| 7547 "content-type" : "application/json; charset=utf-8", |
| 7548 }; |
| 7549 var resp = convert.JSON.encode(buildUnsampledReport()); |
| 7550 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7551 }), true); |
| 7552 res.insert(arg_request, arg_accountId, arg_webPropertyId, arg_profileId).t
hen(unittest.expectAsync(((api.UnsampledReport response) { |
| 7553 checkUnsampledReport(response); |
| 7554 }))); |
| 7555 }); |
| 7556 |
| 7557 unittest.test("method--list", () { |
| 7558 |
| 7559 var mock = new common_test.HttpServerMock(); |
| 7560 api.ManagementUnsampledReportsResourceApi res = new api.AnalyticsApi(mock)
.management.unsampledReports; |
| 7561 var arg_accountId = "foo"; |
| 7562 var arg_webPropertyId = "foo"; |
| 7563 var arg_profileId = "foo"; |
| 7564 var arg_max_results = 42; |
| 7565 var arg_start_index = 42; |
| 7566 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7567 var path = (req.url).path; |
| 7568 var pathOffset = 0; |
| 7569 var index; |
| 7570 var subPart; |
| 7571 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7572 pathOffset += 14; |
| 7573 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7574 pathOffset += 20; |
| 7575 index = path.indexOf("/webproperties/", pathOffset); |
| 7576 unittest.expect(index >= 0, unittest.isTrue); |
| 7577 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7578 pathOffset = index; |
| 7579 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7580 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7581 pathOffset += 15; |
| 7582 index = path.indexOf("/profiles/", pathOffset); |
| 7583 unittest.expect(index >= 0, unittest.isTrue); |
| 7584 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7585 pathOffset = index; |
| 7586 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7587 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/profiles/")); |
| 7588 pathOffset += 10; |
| 7589 index = path.indexOf("/unsampledReports", pathOffset); |
| 7590 unittest.expect(index >= 0, unittest.isTrue); |
| 7591 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7592 pathOffset = index; |
| 7593 unittest.expect(subPart, unittest.equals("$arg_profileId")); |
| 7594 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/unsampledReports")); |
| 7595 pathOffset += 17; |
| 7596 |
| 7597 var query = (req.url).query; |
| 7598 var queryOffset = 0; |
| 7599 var queryMap = {}; |
| 7600 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7601 parseBool(n) { |
| 7602 if (n == "true") return true; |
| 7603 if (n == "false") return false; |
| 7604 if (n == null) return null; |
| 7605 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7606 } |
| 7607 if (query.length > 0) { |
| 7608 for (var part in query.split("&")) { |
| 7609 var keyvalue = part.split("="); |
| 7610 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7611 } |
| 7612 } |
| 7613 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 7614 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 7615 |
| 7616 |
| 7617 var h = { |
| 7618 "content-type" : "application/json; charset=utf-8", |
| 7619 }; |
| 7620 var resp = convert.JSON.encode(buildUnsampledReports()); |
| 7621 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7622 }), true); |
| 7623 res.list(arg_accountId, arg_webPropertyId, arg_profileId, max_results: arg
_max_results, start_index: arg_start_index).then(unittest.expectAsync(((api.Unsa
mpledReports response) { |
| 7624 checkUnsampledReports(response); |
| 7625 }))); |
| 7626 }); |
| 7627 |
| 7628 }); |
| 7629 |
| 7630 |
| 7631 unittest.group("resource-ManagementUploadsResourceApi", () { |
| 7632 unittest.test("method--deleteUploadData", () { |
| 7633 |
| 7634 var mock = new common_test.HttpServerMock(); |
| 7635 api.ManagementUploadsResourceApi res = new api.AnalyticsApi(mock).manageme
nt.uploads; |
| 7636 var arg_request = buildAnalyticsDataimportDeleteUploadDataRequest(); |
| 7637 var arg_accountId = "foo"; |
| 7638 var arg_webPropertyId = "foo"; |
| 7639 var arg_customDataSourceId = "foo"; |
| 7640 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7641 var obj = new api.AnalyticsDataimportDeleteUploadDataRequest.fromJson(js
on); |
| 7642 checkAnalyticsDataimportDeleteUploadDataRequest(obj); |
| 7643 |
| 7644 var path = (req.url).path; |
| 7645 var pathOffset = 0; |
| 7646 var index; |
| 7647 var subPart; |
| 7648 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7649 pathOffset += 14; |
| 7650 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7651 pathOffset += 20; |
| 7652 index = path.indexOf("/webproperties/", pathOffset); |
| 7653 unittest.expect(index >= 0, unittest.isTrue); |
| 7654 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7655 pathOffset = index; |
| 7656 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7657 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7658 pathOffset += 15; |
| 7659 index = path.indexOf("/customDataSources/", pathOffset); |
| 7660 unittest.expect(index >= 0, unittest.isTrue); |
| 7661 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7662 pathOffset = index; |
| 7663 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7664 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/customDataSources/")); |
| 7665 pathOffset += 19; |
| 7666 index = path.indexOf("/deleteUploadData", pathOffset); |
| 7667 unittest.expect(index >= 0, unittest.isTrue); |
| 7668 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7669 pathOffset = index; |
| 7670 unittest.expect(subPart, unittest.equals("$arg_customDataSourceId")); |
| 7671 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/deleteUploadData")); |
| 7672 pathOffset += 17; |
| 7673 |
| 7674 var query = (req.url).query; |
| 7675 var queryOffset = 0; |
| 7676 var queryMap = {}; |
| 7677 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7678 parseBool(n) { |
| 7679 if (n == "true") return true; |
| 7680 if (n == "false") return false; |
| 7681 if (n == null) return null; |
| 7682 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7683 } |
| 7684 if (query.length > 0) { |
| 7685 for (var part in query.split("&")) { |
| 7686 var keyvalue = part.split("="); |
| 7687 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7688 } |
| 7689 } |
| 7690 |
| 7691 |
| 7692 var h = { |
| 7693 "content-type" : "application/json; charset=utf-8", |
| 7694 }; |
| 7695 var resp = ""; |
| 7696 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7697 }), true); |
| 7698 res.deleteUploadData(arg_request, arg_accountId, arg_webPropertyId, arg_cu
stomDataSourceId).then(unittest.expectAsync((_) {})); |
| 7699 }); |
| 7700 |
| 7701 unittest.test("method--get", () { |
| 7702 |
| 7703 var mock = new common_test.HttpServerMock(); |
| 7704 api.ManagementUploadsResourceApi res = new api.AnalyticsApi(mock).manageme
nt.uploads; |
| 7705 var arg_accountId = "foo"; |
| 7706 var arg_webPropertyId = "foo"; |
| 7707 var arg_customDataSourceId = "foo"; |
| 7708 var arg_uploadId = "foo"; |
| 7709 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7710 var path = (req.url).path; |
| 7711 var pathOffset = 0; |
| 7712 var index; |
| 7713 var subPart; |
| 7714 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7715 pathOffset += 14; |
| 7716 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7717 pathOffset += 20; |
| 7718 index = path.indexOf("/webproperties/", pathOffset); |
| 7719 unittest.expect(index >= 0, unittest.isTrue); |
| 7720 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7721 pathOffset = index; |
| 7722 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7723 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7724 pathOffset += 15; |
| 7725 index = path.indexOf("/customDataSources/", pathOffset); |
| 7726 unittest.expect(index >= 0, unittest.isTrue); |
| 7727 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7728 pathOffset = index; |
| 7729 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7730 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/customDataSources/")); |
| 7731 pathOffset += 19; |
| 7732 index = path.indexOf("/uploads/", pathOffset); |
| 7733 unittest.expect(index >= 0, unittest.isTrue); |
| 7734 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7735 pathOffset = index; |
| 7736 unittest.expect(subPart, unittest.equals("$arg_customDataSourceId")); |
| 7737 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/uploads/")); |
| 7738 pathOffset += 9; |
| 7739 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 7740 pathOffset = path.length; |
| 7741 unittest.expect(subPart, unittest.equals("$arg_uploadId")); |
| 7742 |
| 7743 var query = (req.url).query; |
| 7744 var queryOffset = 0; |
| 7745 var queryMap = {}; |
| 7746 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7747 parseBool(n) { |
| 7748 if (n == "true") return true; |
| 7749 if (n == "false") return false; |
| 7750 if (n == null) return null; |
| 7751 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7752 } |
| 7753 if (query.length > 0) { |
| 7754 for (var part in query.split("&")) { |
| 7755 var keyvalue = part.split("="); |
| 7756 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7757 } |
| 7758 } |
| 7759 |
| 7760 |
| 7761 var h = { |
| 7762 "content-type" : "application/json; charset=utf-8", |
| 7763 }; |
| 7764 var resp = convert.JSON.encode(buildUpload()); |
| 7765 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7766 }), true); |
| 7767 res.get(arg_accountId, arg_webPropertyId, arg_customDataSourceId, arg_uplo
adId).then(unittest.expectAsync(((api.Upload response) { |
| 7768 checkUpload(response); |
| 7769 }))); |
| 7770 }); |
| 7771 |
| 7772 unittest.test("method--list", () { |
| 7773 |
| 7774 var mock = new common_test.HttpServerMock(); |
| 7775 api.ManagementUploadsResourceApi res = new api.AnalyticsApi(mock).manageme
nt.uploads; |
| 7776 var arg_accountId = "foo"; |
| 7777 var arg_webPropertyId = "foo"; |
| 7778 var arg_customDataSourceId = "foo"; |
| 7779 var arg_max_results = 42; |
| 7780 var arg_start_index = 42; |
| 7781 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7782 var path = (req.url).path; |
| 7783 var pathOffset = 0; |
| 7784 var index; |
| 7785 var subPart; |
| 7786 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7787 pathOffset += 14; |
| 7788 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7789 pathOffset += 20; |
| 7790 index = path.indexOf("/webproperties/", pathOffset); |
| 7791 unittest.expect(index >= 0, unittest.isTrue); |
| 7792 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7793 pathOffset = index; |
| 7794 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7795 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7796 pathOffset += 15; |
| 7797 index = path.indexOf("/customDataSources/", pathOffset); |
| 7798 unittest.expect(index >= 0, unittest.isTrue); |
| 7799 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7800 pathOffset = index; |
| 7801 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7802 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/customDataSources/")); |
| 7803 pathOffset += 19; |
| 7804 index = path.indexOf("/uploads", pathOffset); |
| 7805 unittest.expect(index >= 0, unittest.isTrue); |
| 7806 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7807 pathOffset = index; |
| 7808 unittest.expect(subPart, unittest.equals("$arg_customDataSourceId")); |
| 7809 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/uploads")); |
| 7810 pathOffset += 8; |
| 7811 |
| 7812 var query = (req.url).query; |
| 7813 var queryOffset = 0; |
| 7814 var queryMap = {}; |
| 7815 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7816 parseBool(n) { |
| 7817 if (n == "true") return true; |
| 7818 if (n == "false") return false; |
| 7819 if (n == null) return null; |
| 7820 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7821 } |
| 7822 if (query.length > 0) { |
| 7823 for (var part in query.split("&")) { |
| 7824 var keyvalue = part.split("="); |
| 7825 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7826 } |
| 7827 } |
| 7828 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 7829 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 7830 |
| 7831 |
| 7832 var h = { |
| 7833 "content-type" : "application/json; charset=utf-8", |
| 7834 }; |
| 7835 var resp = convert.JSON.encode(buildUploads()); |
| 7836 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7837 }), true); |
| 7838 res.list(arg_accountId, arg_webPropertyId, arg_customDataSourceId, max_res
ults: arg_max_results, start_index: arg_start_index).then(unittest.expectAsync((
(api.Uploads response) { |
| 7839 checkUploads(response); |
| 7840 }))); |
| 7841 }); |
| 7842 |
| 7843 unittest.test("method--migrateDataImport", () { |
| 7844 |
| 7845 var mock = new common_test.HttpServerMock(); |
| 7846 api.ManagementUploadsResourceApi res = new api.AnalyticsApi(mock).manageme
nt.uploads; |
| 7847 var arg_accountId = "foo"; |
| 7848 var arg_webPropertyId = "foo"; |
| 7849 var arg_customDataSourceId = "foo"; |
| 7850 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7851 var path = (req.url).path; |
| 7852 var pathOffset = 0; |
| 7853 var index; |
| 7854 var subPart; |
| 7855 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7856 pathOffset += 14; |
| 7857 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7858 pathOffset += 20; |
| 7859 index = path.indexOf("/webproperties/", pathOffset); |
| 7860 unittest.expect(index >= 0, unittest.isTrue); |
| 7861 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7862 pathOffset = index; |
| 7863 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7864 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7865 pathOffset += 15; |
| 7866 index = path.indexOf("/customDataSources/", pathOffset); |
| 7867 unittest.expect(index >= 0, unittest.isTrue); |
| 7868 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7869 pathOffset = index; |
| 7870 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7871 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/customDataSources/")); |
| 7872 pathOffset += 19; |
| 7873 index = path.indexOf("/migrateDataImport", pathOffset); |
| 7874 unittest.expect(index >= 0, unittest.isTrue); |
| 7875 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7876 pathOffset = index; |
| 7877 unittest.expect(subPart, unittest.equals("$arg_customDataSourceId")); |
| 7878 unittest.expect(path.substring(pathOffset, pathOffset + 18), unittest.eq
uals("/migrateDataImport")); |
| 7879 pathOffset += 18; |
| 7880 |
| 7881 var query = (req.url).query; |
| 7882 var queryOffset = 0; |
| 7883 var queryMap = {}; |
| 7884 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7885 parseBool(n) { |
| 7886 if (n == "true") return true; |
| 7887 if (n == "false") return false; |
| 7888 if (n == null) return null; |
| 7889 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7890 } |
| 7891 if (query.length > 0) { |
| 7892 for (var part in query.split("&")) { |
| 7893 var keyvalue = part.split("="); |
| 7894 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7895 } |
| 7896 } |
| 7897 |
| 7898 |
| 7899 var h = { |
| 7900 "content-type" : "application/json; charset=utf-8", |
| 7901 }; |
| 7902 var resp = ""; |
| 7903 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7904 }), true); |
| 7905 res.migrateDataImport(arg_accountId, arg_webPropertyId, arg_customDataSour
ceId).then(unittest.expectAsync((_) {})); |
| 7906 }); |
| 7907 |
| 7908 unittest.test("method--uploadData", () { |
| 7909 // TODO: Implement tests for media upload; |
| 7910 // TODO: Implement tests for media download; |
| 7911 |
| 7912 var mock = new common_test.HttpServerMock(); |
| 7913 api.ManagementUploadsResourceApi res = new api.AnalyticsApi(mock).manageme
nt.uploads; |
| 7914 var arg_accountId = "foo"; |
| 7915 var arg_webPropertyId = "foo"; |
| 7916 var arg_customDataSourceId = "foo"; |
| 7917 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7918 var path = (req.url).path; |
| 7919 var pathOffset = 0; |
| 7920 var index; |
| 7921 var subPart; |
| 7922 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7923 pathOffset += 14; |
| 7924 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7925 pathOffset += 20; |
| 7926 index = path.indexOf("/webproperties/", pathOffset); |
| 7927 unittest.expect(index >= 0, unittest.isTrue); |
| 7928 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7929 pathOffset = index; |
| 7930 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 7931 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 7932 pathOffset += 15; |
| 7933 index = path.indexOf("/customDataSources/", pathOffset); |
| 7934 unittest.expect(index >= 0, unittest.isTrue); |
| 7935 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7936 pathOffset = index; |
| 7937 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 7938 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/customDataSources/")); |
| 7939 pathOffset += 19; |
| 7940 index = path.indexOf("/uploads", pathOffset); |
| 7941 unittest.expect(index >= 0, unittest.isTrue); |
| 7942 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 7943 pathOffset = index; |
| 7944 unittest.expect(subPart, unittest.equals("$arg_customDataSourceId")); |
| 7945 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/uploads")); |
| 7946 pathOffset += 8; |
| 7947 |
| 7948 var query = (req.url).query; |
| 7949 var queryOffset = 0; |
| 7950 var queryMap = {}; |
| 7951 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 7952 parseBool(n) { |
| 7953 if (n == "true") return true; |
| 7954 if (n == "false") return false; |
| 7955 if (n == null) return null; |
| 7956 throw new core.ArgumentError("Invalid boolean: $n"); |
| 7957 } |
| 7958 if (query.length > 0) { |
| 7959 for (var part in query.split("&")) { |
| 7960 var keyvalue = part.split("="); |
| 7961 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 7962 } |
| 7963 } |
| 7964 |
| 7965 |
| 7966 var h = { |
| 7967 "content-type" : "application/json; charset=utf-8", |
| 7968 }; |
| 7969 var resp = convert.JSON.encode(buildUpload()); |
| 7970 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 7971 }), true); |
| 7972 res.uploadData(arg_accountId, arg_webPropertyId, arg_customDataSourceId).t
hen(unittest.expectAsync(((api.Upload response) { |
| 7973 checkUpload(response); |
| 7974 }))); |
| 7975 }); |
| 7976 |
| 7977 }); |
| 7978 |
| 7979 |
| 7980 unittest.group("resource-ManagementWebPropertyAdWordsLinksResourceApi", () { |
| 7981 unittest.test("method--delete", () { |
| 7982 |
| 7983 var mock = new common_test.HttpServerMock(); |
| 7984 api.ManagementWebPropertyAdWordsLinksResourceApi res = new api.AnalyticsAp
i(mock).management.webPropertyAdWordsLinks; |
| 7985 var arg_accountId = "foo"; |
| 7986 var arg_webPropertyId = "foo"; |
| 7987 var arg_webPropertyAdWordsLinkId = "foo"; |
| 7988 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 7989 var path = (req.url).path; |
| 7990 var pathOffset = 0; |
| 7991 var index; |
| 7992 var subPart; |
| 7993 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 7994 pathOffset += 14; |
| 7995 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 7996 pathOffset += 20; |
| 7997 index = path.indexOf("/webproperties/", pathOffset); |
| 7998 unittest.expect(index >= 0, unittest.isTrue); |
| 7999 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8000 pathOffset = index; |
| 8001 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8002 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8003 pathOffset += 15; |
| 8004 index = path.indexOf("/entityAdWordsLinks/", pathOffset); |
| 8005 unittest.expect(index >= 0, unittest.isTrue); |
| 8006 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8007 pathOffset = index; |
| 8008 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8009 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("/entityAdWordsLinks/")); |
| 8010 pathOffset += 20; |
| 8011 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 8012 pathOffset = path.length; |
| 8013 unittest.expect(subPart, unittest.equals("$arg_webPropertyAdWordsLinkId"
)); |
| 8014 |
| 8015 var query = (req.url).query; |
| 8016 var queryOffset = 0; |
| 8017 var queryMap = {}; |
| 8018 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8019 parseBool(n) { |
| 8020 if (n == "true") return true; |
| 8021 if (n == "false") return false; |
| 8022 if (n == null) return null; |
| 8023 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8024 } |
| 8025 if (query.length > 0) { |
| 8026 for (var part in query.split("&")) { |
| 8027 var keyvalue = part.split("="); |
| 8028 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8029 } |
| 8030 } |
| 8031 |
| 8032 |
| 8033 var h = { |
| 8034 "content-type" : "application/json; charset=utf-8", |
| 8035 }; |
| 8036 var resp = ""; |
| 8037 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8038 }), true); |
| 8039 res.delete(arg_accountId, arg_webPropertyId, arg_webPropertyAdWordsLinkId)
.then(unittest.expectAsync((_) {})); |
| 8040 }); |
| 8041 |
| 8042 unittest.test("method--get", () { |
| 8043 |
| 8044 var mock = new common_test.HttpServerMock(); |
| 8045 api.ManagementWebPropertyAdWordsLinksResourceApi res = new api.AnalyticsAp
i(mock).management.webPropertyAdWordsLinks; |
| 8046 var arg_accountId = "foo"; |
| 8047 var arg_webPropertyId = "foo"; |
| 8048 var arg_webPropertyAdWordsLinkId = "foo"; |
| 8049 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8050 var path = (req.url).path; |
| 8051 var pathOffset = 0; |
| 8052 var index; |
| 8053 var subPart; |
| 8054 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8055 pathOffset += 14; |
| 8056 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8057 pathOffset += 20; |
| 8058 index = path.indexOf("/webproperties/", pathOffset); |
| 8059 unittest.expect(index >= 0, unittest.isTrue); |
| 8060 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8061 pathOffset = index; |
| 8062 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8063 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8064 pathOffset += 15; |
| 8065 index = path.indexOf("/entityAdWordsLinks/", pathOffset); |
| 8066 unittest.expect(index >= 0, unittest.isTrue); |
| 8067 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8068 pathOffset = index; |
| 8069 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8070 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("/entityAdWordsLinks/")); |
| 8071 pathOffset += 20; |
| 8072 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 8073 pathOffset = path.length; |
| 8074 unittest.expect(subPart, unittest.equals("$arg_webPropertyAdWordsLinkId"
)); |
| 8075 |
| 8076 var query = (req.url).query; |
| 8077 var queryOffset = 0; |
| 8078 var queryMap = {}; |
| 8079 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8080 parseBool(n) { |
| 8081 if (n == "true") return true; |
| 8082 if (n == "false") return false; |
| 8083 if (n == null) return null; |
| 8084 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8085 } |
| 8086 if (query.length > 0) { |
| 8087 for (var part in query.split("&")) { |
| 8088 var keyvalue = part.split("="); |
| 8089 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8090 } |
| 8091 } |
| 8092 |
| 8093 |
| 8094 var h = { |
| 8095 "content-type" : "application/json; charset=utf-8", |
| 8096 }; |
| 8097 var resp = convert.JSON.encode(buildEntityAdWordsLink()); |
| 8098 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8099 }), true); |
| 8100 res.get(arg_accountId, arg_webPropertyId, arg_webPropertyAdWordsLinkId).th
en(unittest.expectAsync(((api.EntityAdWordsLink response) { |
| 8101 checkEntityAdWordsLink(response); |
| 8102 }))); |
| 8103 }); |
| 8104 |
| 8105 unittest.test("method--insert", () { |
| 8106 |
| 8107 var mock = new common_test.HttpServerMock(); |
| 8108 api.ManagementWebPropertyAdWordsLinksResourceApi res = new api.AnalyticsAp
i(mock).management.webPropertyAdWordsLinks; |
| 8109 var arg_request = buildEntityAdWordsLink(); |
| 8110 var arg_accountId = "foo"; |
| 8111 var arg_webPropertyId = "foo"; |
| 8112 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8113 var obj = new api.EntityAdWordsLink.fromJson(json); |
| 8114 checkEntityAdWordsLink(obj); |
| 8115 |
| 8116 var path = (req.url).path; |
| 8117 var pathOffset = 0; |
| 8118 var index; |
| 8119 var subPart; |
| 8120 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8121 pathOffset += 14; |
| 8122 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8123 pathOffset += 20; |
| 8124 index = path.indexOf("/webproperties/", pathOffset); |
| 8125 unittest.expect(index >= 0, unittest.isTrue); |
| 8126 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8127 pathOffset = index; |
| 8128 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8129 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8130 pathOffset += 15; |
| 8131 index = path.indexOf("/entityAdWordsLinks", pathOffset); |
| 8132 unittest.expect(index >= 0, unittest.isTrue); |
| 8133 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8134 pathOffset = index; |
| 8135 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8136 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/entityAdWordsLinks")); |
| 8137 pathOffset += 19; |
| 8138 |
| 8139 var query = (req.url).query; |
| 8140 var queryOffset = 0; |
| 8141 var queryMap = {}; |
| 8142 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8143 parseBool(n) { |
| 8144 if (n == "true") return true; |
| 8145 if (n == "false") return false; |
| 8146 if (n == null) return null; |
| 8147 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8148 } |
| 8149 if (query.length > 0) { |
| 8150 for (var part in query.split("&")) { |
| 8151 var keyvalue = part.split("="); |
| 8152 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8153 } |
| 8154 } |
| 8155 |
| 8156 |
| 8157 var h = { |
| 8158 "content-type" : "application/json; charset=utf-8", |
| 8159 }; |
| 8160 var resp = convert.JSON.encode(buildEntityAdWordsLink()); |
| 8161 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8162 }), true); |
| 8163 res.insert(arg_request, arg_accountId, arg_webPropertyId).then(unittest.ex
pectAsync(((api.EntityAdWordsLink response) { |
| 8164 checkEntityAdWordsLink(response); |
| 8165 }))); |
| 8166 }); |
| 8167 |
| 8168 unittest.test("method--list", () { |
| 8169 |
| 8170 var mock = new common_test.HttpServerMock(); |
| 8171 api.ManagementWebPropertyAdWordsLinksResourceApi res = new api.AnalyticsAp
i(mock).management.webPropertyAdWordsLinks; |
| 8172 var arg_accountId = "foo"; |
| 8173 var arg_webPropertyId = "foo"; |
| 8174 var arg_max_results = 42; |
| 8175 var arg_start_index = 42; |
| 8176 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8177 var path = (req.url).path; |
| 8178 var pathOffset = 0; |
| 8179 var index; |
| 8180 var subPart; |
| 8181 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8182 pathOffset += 14; |
| 8183 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8184 pathOffset += 20; |
| 8185 index = path.indexOf("/webproperties/", pathOffset); |
| 8186 unittest.expect(index >= 0, unittest.isTrue); |
| 8187 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8188 pathOffset = index; |
| 8189 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8190 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8191 pathOffset += 15; |
| 8192 index = path.indexOf("/entityAdWordsLinks", pathOffset); |
| 8193 unittest.expect(index >= 0, unittest.isTrue); |
| 8194 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8195 pathOffset = index; |
| 8196 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8197 unittest.expect(path.substring(pathOffset, pathOffset + 19), unittest.eq
uals("/entityAdWordsLinks")); |
| 8198 pathOffset += 19; |
| 8199 |
| 8200 var query = (req.url).query; |
| 8201 var queryOffset = 0; |
| 8202 var queryMap = {}; |
| 8203 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8204 parseBool(n) { |
| 8205 if (n == "true") return true; |
| 8206 if (n == "false") return false; |
| 8207 if (n == null) return null; |
| 8208 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8209 } |
| 8210 if (query.length > 0) { |
| 8211 for (var part in query.split("&")) { |
| 8212 var keyvalue = part.split("="); |
| 8213 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8214 } |
| 8215 } |
| 8216 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 8217 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 8218 |
| 8219 |
| 8220 var h = { |
| 8221 "content-type" : "application/json; charset=utf-8", |
| 8222 }; |
| 8223 var resp = convert.JSON.encode(buildEntityAdWordsLinks()); |
| 8224 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8225 }), true); |
| 8226 res.list(arg_accountId, arg_webPropertyId, max_results: arg_max_results, s
tart_index: arg_start_index).then(unittest.expectAsync(((api.EntityAdWordsLinks
response) { |
| 8227 checkEntityAdWordsLinks(response); |
| 8228 }))); |
| 8229 }); |
| 8230 |
| 8231 unittest.test("method--patch", () { |
| 8232 |
| 8233 var mock = new common_test.HttpServerMock(); |
| 8234 api.ManagementWebPropertyAdWordsLinksResourceApi res = new api.AnalyticsAp
i(mock).management.webPropertyAdWordsLinks; |
| 8235 var arg_request = buildEntityAdWordsLink(); |
| 8236 var arg_accountId = "foo"; |
| 8237 var arg_webPropertyId = "foo"; |
| 8238 var arg_webPropertyAdWordsLinkId = "foo"; |
| 8239 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8240 var obj = new api.EntityAdWordsLink.fromJson(json); |
| 8241 checkEntityAdWordsLink(obj); |
| 8242 |
| 8243 var path = (req.url).path; |
| 8244 var pathOffset = 0; |
| 8245 var index; |
| 8246 var subPart; |
| 8247 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8248 pathOffset += 14; |
| 8249 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8250 pathOffset += 20; |
| 8251 index = path.indexOf("/webproperties/", pathOffset); |
| 8252 unittest.expect(index >= 0, unittest.isTrue); |
| 8253 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8254 pathOffset = index; |
| 8255 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8256 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8257 pathOffset += 15; |
| 8258 index = path.indexOf("/entityAdWordsLinks/", pathOffset); |
| 8259 unittest.expect(index >= 0, unittest.isTrue); |
| 8260 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8261 pathOffset = index; |
| 8262 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8263 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("/entityAdWordsLinks/")); |
| 8264 pathOffset += 20; |
| 8265 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 8266 pathOffset = path.length; |
| 8267 unittest.expect(subPart, unittest.equals("$arg_webPropertyAdWordsLinkId"
)); |
| 8268 |
| 8269 var query = (req.url).query; |
| 8270 var queryOffset = 0; |
| 8271 var queryMap = {}; |
| 8272 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8273 parseBool(n) { |
| 8274 if (n == "true") return true; |
| 8275 if (n == "false") return false; |
| 8276 if (n == null) return null; |
| 8277 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8278 } |
| 8279 if (query.length > 0) { |
| 8280 for (var part in query.split("&")) { |
| 8281 var keyvalue = part.split("="); |
| 8282 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8283 } |
| 8284 } |
| 8285 |
| 8286 |
| 8287 var h = { |
| 8288 "content-type" : "application/json; charset=utf-8", |
| 8289 }; |
| 8290 var resp = convert.JSON.encode(buildEntityAdWordsLink()); |
| 8291 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8292 }), true); |
| 8293 res.patch(arg_request, arg_accountId, arg_webPropertyId, arg_webPropertyAd
WordsLinkId).then(unittest.expectAsync(((api.EntityAdWordsLink response) { |
| 8294 checkEntityAdWordsLink(response); |
| 8295 }))); |
| 8296 }); |
| 8297 |
| 8298 unittest.test("method--update", () { |
| 8299 |
| 8300 var mock = new common_test.HttpServerMock(); |
| 8301 api.ManagementWebPropertyAdWordsLinksResourceApi res = new api.AnalyticsAp
i(mock).management.webPropertyAdWordsLinks; |
| 8302 var arg_request = buildEntityAdWordsLink(); |
| 8303 var arg_accountId = "foo"; |
| 8304 var arg_webPropertyId = "foo"; |
| 8305 var arg_webPropertyAdWordsLinkId = "foo"; |
| 8306 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8307 var obj = new api.EntityAdWordsLink.fromJson(json); |
| 8308 checkEntityAdWordsLink(obj); |
| 8309 |
| 8310 var path = (req.url).path; |
| 8311 var pathOffset = 0; |
| 8312 var index; |
| 8313 var subPart; |
| 8314 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8315 pathOffset += 14; |
| 8316 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8317 pathOffset += 20; |
| 8318 index = path.indexOf("/webproperties/", pathOffset); |
| 8319 unittest.expect(index >= 0, unittest.isTrue); |
| 8320 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8321 pathOffset = index; |
| 8322 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8323 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8324 pathOffset += 15; |
| 8325 index = path.indexOf("/entityAdWordsLinks/", pathOffset); |
| 8326 unittest.expect(index >= 0, unittest.isTrue); |
| 8327 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8328 pathOffset = index; |
| 8329 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8330 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("/entityAdWordsLinks/")); |
| 8331 pathOffset += 20; |
| 8332 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 8333 pathOffset = path.length; |
| 8334 unittest.expect(subPart, unittest.equals("$arg_webPropertyAdWordsLinkId"
)); |
| 8335 |
| 8336 var query = (req.url).query; |
| 8337 var queryOffset = 0; |
| 8338 var queryMap = {}; |
| 8339 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8340 parseBool(n) { |
| 8341 if (n == "true") return true; |
| 8342 if (n == "false") return false; |
| 8343 if (n == null) return null; |
| 8344 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8345 } |
| 8346 if (query.length > 0) { |
| 8347 for (var part in query.split("&")) { |
| 8348 var keyvalue = part.split("="); |
| 8349 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8350 } |
| 8351 } |
| 8352 |
| 8353 |
| 8354 var h = { |
| 8355 "content-type" : "application/json; charset=utf-8", |
| 8356 }; |
| 8357 var resp = convert.JSON.encode(buildEntityAdWordsLink()); |
| 8358 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8359 }), true); |
| 8360 res.update(arg_request, arg_accountId, arg_webPropertyId, arg_webPropertyA
dWordsLinkId).then(unittest.expectAsync(((api.EntityAdWordsLink response) { |
| 8361 checkEntityAdWordsLink(response); |
| 8362 }))); |
| 8363 }); |
| 8364 |
| 8365 }); |
| 8366 |
| 8367 |
| 8368 unittest.group("resource-ManagementWebpropertiesResourceApi", () { |
| 8369 unittest.test("method--get", () { |
| 8370 |
| 8371 var mock = new common_test.HttpServerMock(); |
| 8372 api.ManagementWebpropertiesResourceApi res = new api.AnalyticsApi(mock).ma
nagement.webproperties; |
| 8373 var arg_accountId = "foo"; |
| 8374 var arg_webPropertyId = "foo"; |
| 8375 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8376 var path = (req.url).path; |
| 8377 var pathOffset = 0; |
| 8378 var index; |
| 8379 var subPart; |
| 8380 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8381 pathOffset += 14; |
| 8382 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8383 pathOffset += 20; |
| 8384 index = path.indexOf("/webproperties/", pathOffset); |
| 8385 unittest.expect(index >= 0, unittest.isTrue); |
| 8386 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8387 pathOffset = index; |
| 8388 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8389 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8390 pathOffset += 15; |
| 8391 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 8392 pathOffset = path.length; |
| 8393 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8394 |
| 8395 var query = (req.url).query; |
| 8396 var queryOffset = 0; |
| 8397 var queryMap = {}; |
| 8398 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8399 parseBool(n) { |
| 8400 if (n == "true") return true; |
| 8401 if (n == "false") return false; |
| 8402 if (n == null) return null; |
| 8403 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8404 } |
| 8405 if (query.length > 0) { |
| 8406 for (var part in query.split("&")) { |
| 8407 var keyvalue = part.split("="); |
| 8408 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8409 } |
| 8410 } |
| 8411 |
| 8412 |
| 8413 var h = { |
| 8414 "content-type" : "application/json; charset=utf-8", |
| 8415 }; |
| 8416 var resp = convert.JSON.encode(buildWebproperty()); |
| 8417 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8418 }), true); |
| 8419 res.get(arg_accountId, arg_webPropertyId).then(unittest.expectAsync(((api.
Webproperty response) { |
| 8420 checkWebproperty(response); |
| 8421 }))); |
| 8422 }); |
| 8423 |
| 8424 unittest.test("method--insert", () { |
| 8425 |
| 8426 var mock = new common_test.HttpServerMock(); |
| 8427 api.ManagementWebpropertiesResourceApi res = new api.AnalyticsApi(mock).ma
nagement.webproperties; |
| 8428 var arg_request = buildWebproperty(); |
| 8429 var arg_accountId = "foo"; |
| 8430 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8431 var obj = new api.Webproperty.fromJson(json); |
| 8432 checkWebproperty(obj); |
| 8433 |
| 8434 var path = (req.url).path; |
| 8435 var pathOffset = 0; |
| 8436 var index; |
| 8437 var subPart; |
| 8438 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8439 pathOffset += 14; |
| 8440 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8441 pathOffset += 20; |
| 8442 index = path.indexOf("/webproperties", pathOffset); |
| 8443 unittest.expect(index >= 0, unittest.isTrue); |
| 8444 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8445 pathOffset = index; |
| 8446 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8447 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/webproperties")); |
| 8448 pathOffset += 14; |
| 8449 |
| 8450 var query = (req.url).query; |
| 8451 var queryOffset = 0; |
| 8452 var queryMap = {}; |
| 8453 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8454 parseBool(n) { |
| 8455 if (n == "true") return true; |
| 8456 if (n == "false") return false; |
| 8457 if (n == null) return null; |
| 8458 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8459 } |
| 8460 if (query.length > 0) { |
| 8461 for (var part in query.split("&")) { |
| 8462 var keyvalue = part.split("="); |
| 8463 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8464 } |
| 8465 } |
| 8466 |
| 8467 |
| 8468 var h = { |
| 8469 "content-type" : "application/json; charset=utf-8", |
| 8470 }; |
| 8471 var resp = convert.JSON.encode(buildWebproperty()); |
| 8472 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8473 }), true); |
| 8474 res.insert(arg_request, arg_accountId).then(unittest.expectAsync(((api.Web
property response) { |
| 8475 checkWebproperty(response); |
| 8476 }))); |
| 8477 }); |
| 8478 |
| 8479 unittest.test("method--list", () { |
| 8480 |
| 8481 var mock = new common_test.HttpServerMock(); |
| 8482 api.ManagementWebpropertiesResourceApi res = new api.AnalyticsApi(mock).ma
nagement.webproperties; |
| 8483 var arg_accountId = "foo"; |
| 8484 var arg_max_results = 42; |
| 8485 var arg_start_index = 42; |
| 8486 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8487 var path = (req.url).path; |
| 8488 var pathOffset = 0; |
| 8489 var index; |
| 8490 var subPart; |
| 8491 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8492 pathOffset += 14; |
| 8493 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8494 pathOffset += 20; |
| 8495 index = path.indexOf("/webproperties", pathOffset); |
| 8496 unittest.expect(index >= 0, unittest.isTrue); |
| 8497 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8498 pathOffset = index; |
| 8499 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8500 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/webproperties")); |
| 8501 pathOffset += 14; |
| 8502 |
| 8503 var query = (req.url).query; |
| 8504 var queryOffset = 0; |
| 8505 var queryMap = {}; |
| 8506 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8507 parseBool(n) { |
| 8508 if (n == "true") return true; |
| 8509 if (n == "false") return false; |
| 8510 if (n == null) return null; |
| 8511 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8512 } |
| 8513 if (query.length > 0) { |
| 8514 for (var part in query.split("&")) { |
| 8515 var keyvalue = part.split("="); |
| 8516 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8517 } |
| 8518 } |
| 8519 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 8520 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 8521 |
| 8522 |
| 8523 var h = { |
| 8524 "content-type" : "application/json; charset=utf-8", |
| 8525 }; |
| 8526 var resp = convert.JSON.encode(buildWebproperties()); |
| 8527 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8528 }), true); |
| 8529 res.list(arg_accountId, max_results: arg_max_results, start_index: arg_sta
rt_index).then(unittest.expectAsync(((api.Webproperties response) { |
| 8530 checkWebproperties(response); |
| 8531 }))); |
| 8532 }); |
| 8533 |
| 8534 unittest.test("method--patch", () { |
| 8535 |
| 8536 var mock = new common_test.HttpServerMock(); |
| 8537 api.ManagementWebpropertiesResourceApi res = new api.AnalyticsApi(mock).ma
nagement.webproperties; |
| 8538 var arg_request = buildWebproperty(); |
| 8539 var arg_accountId = "foo"; |
| 8540 var arg_webPropertyId = "foo"; |
| 8541 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8542 var obj = new api.Webproperty.fromJson(json); |
| 8543 checkWebproperty(obj); |
| 8544 |
| 8545 var path = (req.url).path; |
| 8546 var pathOffset = 0; |
| 8547 var index; |
| 8548 var subPart; |
| 8549 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8550 pathOffset += 14; |
| 8551 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8552 pathOffset += 20; |
| 8553 index = path.indexOf("/webproperties/", pathOffset); |
| 8554 unittest.expect(index >= 0, unittest.isTrue); |
| 8555 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8556 pathOffset = index; |
| 8557 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8558 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8559 pathOffset += 15; |
| 8560 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 8561 pathOffset = path.length; |
| 8562 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8563 |
| 8564 var query = (req.url).query; |
| 8565 var queryOffset = 0; |
| 8566 var queryMap = {}; |
| 8567 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8568 parseBool(n) { |
| 8569 if (n == "true") return true; |
| 8570 if (n == "false") return false; |
| 8571 if (n == null) return null; |
| 8572 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8573 } |
| 8574 if (query.length > 0) { |
| 8575 for (var part in query.split("&")) { |
| 8576 var keyvalue = part.split("="); |
| 8577 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8578 } |
| 8579 } |
| 8580 |
| 8581 |
| 8582 var h = { |
| 8583 "content-type" : "application/json; charset=utf-8", |
| 8584 }; |
| 8585 var resp = convert.JSON.encode(buildWebproperty()); |
| 8586 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8587 }), true); |
| 8588 res.patch(arg_request, arg_accountId, arg_webPropertyId).then(unittest.exp
ectAsync(((api.Webproperty response) { |
| 8589 checkWebproperty(response); |
| 8590 }))); |
| 8591 }); |
| 8592 |
| 8593 unittest.test("method--update", () { |
| 8594 |
| 8595 var mock = new common_test.HttpServerMock(); |
| 8596 api.ManagementWebpropertiesResourceApi res = new api.AnalyticsApi(mock).ma
nagement.webproperties; |
| 8597 var arg_request = buildWebproperty(); |
| 8598 var arg_accountId = "foo"; |
| 8599 var arg_webPropertyId = "foo"; |
| 8600 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8601 var obj = new api.Webproperty.fromJson(json); |
| 8602 checkWebproperty(obj); |
| 8603 |
| 8604 var path = (req.url).path; |
| 8605 var pathOffset = 0; |
| 8606 var index; |
| 8607 var subPart; |
| 8608 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8609 pathOffset += 14; |
| 8610 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8611 pathOffset += 20; |
| 8612 index = path.indexOf("/webproperties/", pathOffset); |
| 8613 unittest.expect(index >= 0, unittest.isTrue); |
| 8614 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8615 pathOffset = index; |
| 8616 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8617 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8618 pathOffset += 15; |
| 8619 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 8620 pathOffset = path.length; |
| 8621 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8622 |
| 8623 var query = (req.url).query; |
| 8624 var queryOffset = 0; |
| 8625 var queryMap = {}; |
| 8626 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8627 parseBool(n) { |
| 8628 if (n == "true") return true; |
| 8629 if (n == "false") return false; |
| 8630 if (n == null) return null; |
| 8631 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8632 } |
| 8633 if (query.length > 0) { |
| 8634 for (var part in query.split("&")) { |
| 8635 var keyvalue = part.split("="); |
| 8636 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8637 } |
| 8638 } |
| 8639 |
| 8640 |
| 8641 var h = { |
| 8642 "content-type" : "application/json; charset=utf-8", |
| 8643 }; |
| 8644 var resp = convert.JSON.encode(buildWebproperty()); |
| 8645 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8646 }), true); |
| 8647 res.update(arg_request, arg_accountId, arg_webPropertyId).then(unittest.ex
pectAsync(((api.Webproperty response) { |
| 8648 checkWebproperty(response); |
| 8649 }))); |
| 8650 }); |
| 8651 |
| 8652 }); |
| 8653 |
| 8654 |
| 8655 unittest.group("resource-ManagementWebpropertyUserLinksResourceApi", () { |
| 8656 unittest.test("method--delete", () { |
| 8657 |
| 8658 var mock = new common_test.HttpServerMock(); |
| 8659 api.ManagementWebpropertyUserLinksResourceApi res = new api.AnalyticsApi(m
ock).management.webpropertyUserLinks; |
| 8660 var arg_accountId = "foo"; |
| 8661 var arg_webPropertyId = "foo"; |
| 8662 var arg_linkId = "foo"; |
| 8663 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8664 var path = (req.url).path; |
| 8665 var pathOffset = 0; |
| 8666 var index; |
| 8667 var subPart; |
| 8668 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8669 pathOffset += 14; |
| 8670 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8671 pathOffset += 20; |
| 8672 index = path.indexOf("/webproperties/", pathOffset); |
| 8673 unittest.expect(index >= 0, unittest.isTrue); |
| 8674 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8675 pathOffset = index; |
| 8676 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8677 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8678 pathOffset += 15; |
| 8679 index = path.indexOf("/entityUserLinks/", pathOffset); |
| 8680 unittest.expect(index >= 0, unittest.isTrue); |
| 8681 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8682 pathOffset = index; |
| 8683 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8684 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/entityUserLinks/")); |
| 8685 pathOffset += 17; |
| 8686 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 8687 pathOffset = path.length; |
| 8688 unittest.expect(subPart, unittest.equals("$arg_linkId")); |
| 8689 |
| 8690 var query = (req.url).query; |
| 8691 var queryOffset = 0; |
| 8692 var queryMap = {}; |
| 8693 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8694 parseBool(n) { |
| 8695 if (n == "true") return true; |
| 8696 if (n == "false") return false; |
| 8697 if (n == null) return null; |
| 8698 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8699 } |
| 8700 if (query.length > 0) { |
| 8701 for (var part in query.split("&")) { |
| 8702 var keyvalue = part.split("="); |
| 8703 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8704 } |
| 8705 } |
| 8706 |
| 8707 |
| 8708 var h = { |
| 8709 "content-type" : "application/json; charset=utf-8", |
| 8710 }; |
| 8711 var resp = ""; |
| 8712 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8713 }), true); |
| 8714 res.delete(arg_accountId, arg_webPropertyId, arg_linkId).then(unittest.exp
ectAsync((_) {})); |
| 8715 }); |
| 8716 |
| 8717 unittest.test("method--insert", () { |
| 8718 |
| 8719 var mock = new common_test.HttpServerMock(); |
| 8720 api.ManagementWebpropertyUserLinksResourceApi res = new api.AnalyticsApi(m
ock).management.webpropertyUserLinks; |
| 8721 var arg_request = buildEntityUserLink(); |
| 8722 var arg_accountId = "foo"; |
| 8723 var arg_webPropertyId = "foo"; |
| 8724 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8725 var obj = new api.EntityUserLink.fromJson(json); |
| 8726 checkEntityUserLink(obj); |
| 8727 |
| 8728 var path = (req.url).path; |
| 8729 var pathOffset = 0; |
| 8730 var index; |
| 8731 var subPart; |
| 8732 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8733 pathOffset += 14; |
| 8734 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8735 pathOffset += 20; |
| 8736 index = path.indexOf("/webproperties/", pathOffset); |
| 8737 unittest.expect(index >= 0, unittest.isTrue); |
| 8738 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8739 pathOffset = index; |
| 8740 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8741 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8742 pathOffset += 15; |
| 8743 index = path.indexOf("/entityUserLinks", pathOffset); |
| 8744 unittest.expect(index >= 0, unittest.isTrue); |
| 8745 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8746 pathOffset = index; |
| 8747 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8748 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/entityUserLinks")); |
| 8749 pathOffset += 16; |
| 8750 |
| 8751 var query = (req.url).query; |
| 8752 var queryOffset = 0; |
| 8753 var queryMap = {}; |
| 8754 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8755 parseBool(n) { |
| 8756 if (n == "true") return true; |
| 8757 if (n == "false") return false; |
| 8758 if (n == null) return null; |
| 8759 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8760 } |
| 8761 if (query.length > 0) { |
| 8762 for (var part in query.split("&")) { |
| 8763 var keyvalue = part.split("="); |
| 8764 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8765 } |
| 8766 } |
| 8767 |
| 8768 |
| 8769 var h = { |
| 8770 "content-type" : "application/json; charset=utf-8", |
| 8771 }; |
| 8772 var resp = convert.JSON.encode(buildEntityUserLink()); |
| 8773 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8774 }), true); |
| 8775 res.insert(arg_request, arg_accountId, arg_webPropertyId).then(unittest.ex
pectAsync(((api.EntityUserLink response) { |
| 8776 checkEntityUserLink(response); |
| 8777 }))); |
| 8778 }); |
| 8779 |
| 8780 unittest.test("method--list", () { |
| 8781 |
| 8782 var mock = new common_test.HttpServerMock(); |
| 8783 api.ManagementWebpropertyUserLinksResourceApi res = new api.AnalyticsApi(m
ock).management.webpropertyUserLinks; |
| 8784 var arg_accountId = "foo"; |
| 8785 var arg_webPropertyId = "foo"; |
| 8786 var arg_max_results = 42; |
| 8787 var arg_start_index = 42; |
| 8788 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8789 var path = (req.url).path; |
| 8790 var pathOffset = 0; |
| 8791 var index; |
| 8792 var subPart; |
| 8793 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8794 pathOffset += 14; |
| 8795 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8796 pathOffset += 20; |
| 8797 index = path.indexOf("/webproperties/", pathOffset); |
| 8798 unittest.expect(index >= 0, unittest.isTrue); |
| 8799 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8800 pathOffset = index; |
| 8801 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8802 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8803 pathOffset += 15; |
| 8804 index = path.indexOf("/entityUserLinks", pathOffset); |
| 8805 unittest.expect(index >= 0, unittest.isTrue); |
| 8806 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8807 pathOffset = index; |
| 8808 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8809 unittest.expect(path.substring(pathOffset, pathOffset + 16), unittest.eq
uals("/entityUserLinks")); |
| 8810 pathOffset += 16; |
| 8811 |
| 8812 var query = (req.url).query; |
| 8813 var queryOffset = 0; |
| 8814 var queryMap = {}; |
| 8815 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8816 parseBool(n) { |
| 8817 if (n == "true") return true; |
| 8818 if (n == "false") return false; |
| 8819 if (n == null) return null; |
| 8820 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8821 } |
| 8822 if (query.length > 0) { |
| 8823 for (var part in query.split("&")) { |
| 8824 var keyvalue = part.split("="); |
| 8825 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8826 } |
| 8827 } |
| 8828 unittest.expect(core.int.parse(queryMap["max-results"].first), unittest.
equals(arg_max_results)); |
| 8829 unittest.expect(core.int.parse(queryMap["start-index"].first), unittest.
equals(arg_start_index)); |
| 8830 |
| 8831 |
| 8832 var h = { |
| 8833 "content-type" : "application/json; charset=utf-8", |
| 8834 }; |
| 8835 var resp = convert.JSON.encode(buildEntityUserLinks()); |
| 8836 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8837 }), true); |
| 8838 res.list(arg_accountId, arg_webPropertyId, max_results: arg_max_results, s
tart_index: arg_start_index).then(unittest.expectAsync(((api.EntityUserLinks res
ponse) { |
| 8839 checkEntityUserLinks(response); |
| 8840 }))); |
| 8841 }); |
| 8842 |
| 8843 unittest.test("method--update", () { |
| 8844 |
| 8845 var mock = new common_test.HttpServerMock(); |
| 8846 api.ManagementWebpropertyUserLinksResourceApi res = new api.AnalyticsApi(m
ock).management.webpropertyUserLinks; |
| 8847 var arg_request = buildEntityUserLink(); |
| 8848 var arg_accountId = "foo"; |
| 8849 var arg_webPropertyId = "foo"; |
| 8850 var arg_linkId = "foo"; |
| 8851 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8852 var obj = new api.EntityUserLink.fromJson(json); |
| 8853 checkEntityUserLink(obj); |
| 8854 |
| 8855 var path = (req.url).path; |
| 8856 var pathOffset = 0; |
| 8857 var index; |
| 8858 var subPart; |
| 8859 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8860 pathOffset += 14; |
| 8861 unittest.expect(path.substring(pathOffset, pathOffset + 20), unittest.eq
uals("management/accounts/")); |
| 8862 pathOffset += 20; |
| 8863 index = path.indexOf("/webproperties/", pathOffset); |
| 8864 unittest.expect(index >= 0, unittest.isTrue); |
| 8865 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8866 pathOffset = index; |
| 8867 unittest.expect(subPart, unittest.equals("$arg_accountId")); |
| 8868 unittest.expect(path.substring(pathOffset, pathOffset + 15), unittest.eq
uals("/webproperties/")); |
| 8869 pathOffset += 15; |
| 8870 index = path.indexOf("/entityUserLinks/", pathOffset); |
| 8871 unittest.expect(index >= 0, unittest.isTrue); |
| 8872 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8873 pathOffset = index; |
| 8874 unittest.expect(subPart, unittest.equals("$arg_webPropertyId")); |
| 8875 unittest.expect(path.substring(pathOffset, pathOffset + 17), unittest.eq
uals("/entityUserLinks/")); |
| 8876 pathOffset += 17; |
| 8877 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 8878 pathOffset = path.length; |
| 8879 unittest.expect(subPart, unittest.equals("$arg_linkId")); |
| 8880 |
| 8881 var query = (req.url).query; |
| 8882 var queryOffset = 0; |
| 8883 var queryMap = {}; |
| 8884 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8885 parseBool(n) { |
| 8886 if (n == "true") return true; |
| 8887 if (n == "false") return false; |
| 8888 if (n == null) return null; |
| 8889 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8890 } |
| 8891 if (query.length > 0) { |
| 8892 for (var part in query.split("&")) { |
| 8893 var keyvalue = part.split("="); |
| 8894 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8895 } |
| 8896 } |
| 8897 |
| 8898 |
| 8899 var h = { |
| 8900 "content-type" : "application/json; charset=utf-8", |
| 8901 }; |
| 8902 var resp = convert.JSON.encode(buildEntityUserLink()); |
| 8903 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8904 }), true); |
| 8905 res.update(arg_request, arg_accountId, arg_webPropertyId, arg_linkId).then
(unittest.expectAsync(((api.EntityUserLink response) { |
| 8906 checkEntityUserLink(response); |
| 8907 }))); |
| 8908 }); |
| 8909 |
| 8910 }); |
| 8911 |
| 8912 |
| 8913 unittest.group("resource-MetadataColumnsResourceApi", () { |
| 8914 unittest.test("method--list", () { |
| 8915 |
| 8916 var mock = new common_test.HttpServerMock(); |
| 8917 api.MetadataColumnsResourceApi res = new api.AnalyticsApi(mock).metadata.c
olumns; |
| 8918 var arg_reportType = "foo"; |
| 8919 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8920 var path = (req.url).path; |
| 8921 var pathOffset = 0; |
| 8922 var index; |
| 8923 var subPart; |
| 8924 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8925 pathOffset += 14; |
| 8926 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("metadata/")); |
| 8927 pathOffset += 9; |
| 8928 index = path.indexOf("/columns", pathOffset); |
| 8929 unittest.expect(index >= 0, unittest.isTrue); |
| 8930 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 8931 pathOffset = index; |
| 8932 unittest.expect(subPart, unittest.equals("$arg_reportType")); |
| 8933 unittest.expect(path.substring(pathOffset, pathOffset + 8), unittest.equ
als("/columns")); |
| 8934 pathOffset += 8; |
| 8935 |
| 8936 var query = (req.url).query; |
| 8937 var queryOffset = 0; |
| 8938 var queryMap = {}; |
| 8939 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8940 parseBool(n) { |
| 8941 if (n == "true") return true; |
| 8942 if (n == "false") return false; |
| 8943 if (n == null) return null; |
| 8944 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8945 } |
| 8946 if (query.length > 0) { |
| 8947 for (var part in query.split("&")) { |
| 8948 var keyvalue = part.split("="); |
| 8949 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 8950 } |
| 8951 } |
| 8952 |
| 8953 |
| 8954 var h = { |
| 8955 "content-type" : "application/json; charset=utf-8", |
| 8956 }; |
| 8957 var resp = convert.JSON.encode(buildColumns()); |
| 8958 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 8959 }), true); |
| 8960 res.list(arg_reportType).then(unittest.expectAsync(((api.Columns response)
{ |
| 8961 checkColumns(response); |
| 8962 }))); |
| 8963 }); |
| 8964 |
| 8965 }); |
| 8966 |
| 8967 |
| 8968 unittest.group("resource-ProvisioningResourceApi", () { |
| 8969 unittest.test("method--createAccountTicket", () { |
| 8970 |
| 8971 var mock = new common_test.HttpServerMock(); |
| 8972 api.ProvisioningResourceApi res = new api.AnalyticsApi(mock).provisioning; |
| 8973 var arg_request = buildAccountTicket(); |
| 8974 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 8975 var obj = new api.AccountTicket.fromJson(json); |
| 8976 checkAccountTicket(obj); |
| 8977 |
| 8978 var path = (req.url).path; |
| 8979 var pathOffset = 0; |
| 8980 var index; |
| 8981 var subPart; |
| 8982 unittest.expect(path.substring(pathOffset, pathOffset + 14), unittest.eq
uals("/analytics/v3/")); |
| 8983 pathOffset += 14; |
| 8984 unittest.expect(path.substring(pathOffset, pathOffset + 32), unittest.eq
uals("provisioning/createAccountTicket")); |
| 8985 pathOffset += 32; |
| 8986 |
| 8987 var query = (req.url).query; |
| 8988 var queryOffset = 0; |
| 8989 var queryMap = {}; |
| 8990 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 8991 parseBool(n) { |
| 8992 if (n == "true") return true; |
| 8993 if (n == "false") return false; |
| 8994 if (n == null) return null; |
| 8995 throw new core.ArgumentError("Invalid boolean: $n"); |
| 8996 } |
| 8997 if (query.length > 0) { |
| 8998 for (var part in query.split("&")) { |
| 8999 var keyvalue = part.split("="); |
| 9000 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 9001 } |
| 9002 } |
| 9003 |
| 9004 |
| 9005 var h = { |
| 9006 "content-type" : "application/json; charset=utf-8", |
| 9007 }; |
| 9008 var resp = convert.JSON.encode(buildAccountTicket()); |
| 9009 return new async.Future.value(common_test.stringResponse(200, h, resp)); |
| 9010 }), true); |
| 9011 res.createAccountTicket(arg_request).then(unittest.expectAsync(((api.Accou
ntTicket response) { |
| 9012 checkAccountTicket(response); |
| 9013 }))); |
| 9014 }); |
| 9015 |
| 9016 }); |
| 9017 |
| 9018 |
| 9019 } |
| 9020 |
OLD | NEW |