OLD | NEW |
(Empty) | |
| 1 library googleapis.serviceuser.v1.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 |
| 12 import 'package:googleapis/serviceuser/v1.dart' as api; |
| 13 |
| 14 class HttpServerMock extends http.BaseClient { |
| 15 core.Function _callback; |
| 16 core.bool _expectJson; |
| 17 |
| 18 void register(core.Function callback, core.bool expectJson) { |
| 19 _callback = callback; |
| 20 _expectJson = expectJson; |
| 21 } |
| 22 |
| 23 async.Future<http.StreamedResponse> send(http.BaseRequest request) { |
| 24 if (_expectJson) { |
| 25 return request.finalize() |
| 26 .transform(convert.UTF8.decoder) |
| 27 .join('') |
| 28 .then((core.String jsonString) { |
| 29 if (jsonString.isEmpty) { |
| 30 return _callback(request, null); |
| 31 } else { |
| 32 return _callback(request, convert.JSON.decode(jsonString)); |
| 33 } |
| 34 }); |
| 35 } else { |
| 36 var stream = request.finalize(); |
| 37 if (stream == null) { |
| 38 return _callback(request, []); |
| 39 } else { |
| 40 return stream.toBytes().then((data) { |
| 41 return _callback(request, data); |
| 42 }); |
| 43 } |
| 44 } |
| 45 } |
| 46 } |
| 47 |
| 48 http.StreamedResponse stringResponse( |
| 49 core.int status, core.Map headers, core.String body) { |
| 50 var stream = new async.Stream.fromIterable([convert.UTF8.encode(body)]); |
| 51 return new http.StreamedResponse(stream, status, headers: headers); |
| 52 } |
| 53 |
| 54 buildUnnamed1731() { |
| 55 var o = new core.List<api.Method>(); |
| 56 o.add(buildMethod()); |
| 57 o.add(buildMethod()); |
| 58 return o; |
| 59 } |
| 60 |
| 61 checkUnnamed1731(core.List<api.Method> o) { |
| 62 unittest.expect(o, unittest.hasLength(2)); |
| 63 checkMethod(o[0]); |
| 64 checkMethod(o[1]); |
| 65 } |
| 66 |
| 67 buildUnnamed1732() { |
| 68 var o = new core.List<api.Mixin>(); |
| 69 o.add(buildMixin()); |
| 70 o.add(buildMixin()); |
| 71 return o; |
| 72 } |
| 73 |
| 74 checkUnnamed1732(core.List<api.Mixin> o) { |
| 75 unittest.expect(o, unittest.hasLength(2)); |
| 76 checkMixin(o[0]); |
| 77 checkMixin(o[1]); |
| 78 } |
| 79 |
| 80 buildUnnamed1733() { |
| 81 var o = new core.List<api.Option>(); |
| 82 o.add(buildOption()); |
| 83 o.add(buildOption()); |
| 84 return o; |
| 85 } |
| 86 |
| 87 checkUnnamed1733(core.List<api.Option> o) { |
| 88 unittest.expect(o, unittest.hasLength(2)); |
| 89 checkOption(o[0]); |
| 90 checkOption(o[1]); |
| 91 } |
| 92 |
| 93 core.int buildCounterApi = 0; |
| 94 buildApi() { |
| 95 var o = new api.Api(); |
| 96 buildCounterApi++; |
| 97 if (buildCounterApi < 3) { |
| 98 o.methods = buildUnnamed1731(); |
| 99 o.mixins = buildUnnamed1732(); |
| 100 o.name = "foo"; |
| 101 o.options = buildUnnamed1733(); |
| 102 o.sourceContext = buildSourceContext(); |
| 103 o.syntax = "foo"; |
| 104 o.version = "foo"; |
| 105 } |
| 106 buildCounterApi--; |
| 107 return o; |
| 108 } |
| 109 |
| 110 checkApi(api.Api o) { |
| 111 buildCounterApi++; |
| 112 if (buildCounterApi < 3) { |
| 113 checkUnnamed1731(o.methods); |
| 114 checkUnnamed1732(o.mixins); |
| 115 unittest.expect(o.name, unittest.equals('foo')); |
| 116 checkUnnamed1733(o.options); |
| 117 checkSourceContext(o.sourceContext); |
| 118 unittest.expect(o.syntax, unittest.equals('foo')); |
| 119 unittest.expect(o.version, unittest.equals('foo')); |
| 120 } |
| 121 buildCounterApi--; |
| 122 } |
| 123 |
| 124 core.int buildCounterAuthProvider = 0; |
| 125 buildAuthProvider() { |
| 126 var o = new api.AuthProvider(); |
| 127 buildCounterAuthProvider++; |
| 128 if (buildCounterAuthProvider < 3) { |
| 129 o.audiences = "foo"; |
| 130 o.id = "foo"; |
| 131 o.issuer = "foo"; |
| 132 o.jwksUri = "foo"; |
| 133 } |
| 134 buildCounterAuthProvider--; |
| 135 return o; |
| 136 } |
| 137 |
| 138 checkAuthProvider(api.AuthProvider o) { |
| 139 buildCounterAuthProvider++; |
| 140 if (buildCounterAuthProvider < 3) { |
| 141 unittest.expect(o.audiences, unittest.equals('foo')); |
| 142 unittest.expect(o.id, unittest.equals('foo')); |
| 143 unittest.expect(o.issuer, unittest.equals('foo')); |
| 144 unittest.expect(o.jwksUri, unittest.equals('foo')); |
| 145 } |
| 146 buildCounterAuthProvider--; |
| 147 } |
| 148 |
| 149 core.int buildCounterAuthRequirement = 0; |
| 150 buildAuthRequirement() { |
| 151 var o = new api.AuthRequirement(); |
| 152 buildCounterAuthRequirement++; |
| 153 if (buildCounterAuthRequirement < 3) { |
| 154 o.audiences = "foo"; |
| 155 o.providerId = "foo"; |
| 156 } |
| 157 buildCounterAuthRequirement--; |
| 158 return o; |
| 159 } |
| 160 |
| 161 checkAuthRequirement(api.AuthRequirement o) { |
| 162 buildCounterAuthRequirement++; |
| 163 if (buildCounterAuthRequirement < 3) { |
| 164 unittest.expect(o.audiences, unittest.equals('foo')); |
| 165 unittest.expect(o.providerId, unittest.equals('foo')); |
| 166 } |
| 167 buildCounterAuthRequirement--; |
| 168 } |
| 169 |
| 170 buildUnnamed1734() { |
| 171 var o = new core.List<api.AuthProvider>(); |
| 172 o.add(buildAuthProvider()); |
| 173 o.add(buildAuthProvider()); |
| 174 return o; |
| 175 } |
| 176 |
| 177 checkUnnamed1734(core.List<api.AuthProvider> o) { |
| 178 unittest.expect(o, unittest.hasLength(2)); |
| 179 checkAuthProvider(o[0]); |
| 180 checkAuthProvider(o[1]); |
| 181 } |
| 182 |
| 183 buildUnnamed1735() { |
| 184 var o = new core.List<api.AuthenticationRule>(); |
| 185 o.add(buildAuthenticationRule()); |
| 186 o.add(buildAuthenticationRule()); |
| 187 return o; |
| 188 } |
| 189 |
| 190 checkUnnamed1735(core.List<api.AuthenticationRule> o) { |
| 191 unittest.expect(o, unittest.hasLength(2)); |
| 192 checkAuthenticationRule(o[0]); |
| 193 checkAuthenticationRule(o[1]); |
| 194 } |
| 195 |
| 196 core.int buildCounterAuthentication = 0; |
| 197 buildAuthentication() { |
| 198 var o = new api.Authentication(); |
| 199 buildCounterAuthentication++; |
| 200 if (buildCounterAuthentication < 3) { |
| 201 o.providers = buildUnnamed1734(); |
| 202 o.rules = buildUnnamed1735(); |
| 203 } |
| 204 buildCounterAuthentication--; |
| 205 return o; |
| 206 } |
| 207 |
| 208 checkAuthentication(api.Authentication o) { |
| 209 buildCounterAuthentication++; |
| 210 if (buildCounterAuthentication < 3) { |
| 211 checkUnnamed1734(o.providers); |
| 212 checkUnnamed1735(o.rules); |
| 213 } |
| 214 buildCounterAuthentication--; |
| 215 } |
| 216 |
| 217 buildUnnamed1736() { |
| 218 var o = new core.List<api.AuthRequirement>(); |
| 219 o.add(buildAuthRequirement()); |
| 220 o.add(buildAuthRequirement()); |
| 221 return o; |
| 222 } |
| 223 |
| 224 checkUnnamed1736(core.List<api.AuthRequirement> o) { |
| 225 unittest.expect(o, unittest.hasLength(2)); |
| 226 checkAuthRequirement(o[0]); |
| 227 checkAuthRequirement(o[1]); |
| 228 } |
| 229 |
| 230 core.int buildCounterAuthenticationRule = 0; |
| 231 buildAuthenticationRule() { |
| 232 var o = new api.AuthenticationRule(); |
| 233 buildCounterAuthenticationRule++; |
| 234 if (buildCounterAuthenticationRule < 3) { |
| 235 o.allowWithoutCredential = true; |
| 236 o.oauth = buildOAuthRequirements(); |
| 237 o.requirements = buildUnnamed1736(); |
| 238 o.selector = "foo"; |
| 239 } |
| 240 buildCounterAuthenticationRule--; |
| 241 return o; |
| 242 } |
| 243 |
| 244 checkAuthenticationRule(api.AuthenticationRule o) { |
| 245 buildCounterAuthenticationRule++; |
| 246 if (buildCounterAuthenticationRule < 3) { |
| 247 unittest.expect(o.allowWithoutCredential, unittest.isTrue); |
| 248 checkOAuthRequirements(o.oauth); |
| 249 checkUnnamed1736(o.requirements); |
| 250 unittest.expect(o.selector, unittest.equals('foo')); |
| 251 } |
| 252 buildCounterAuthenticationRule--; |
| 253 } |
| 254 |
| 255 buildUnnamed1737() { |
| 256 var o = new core.List<api.BackendRule>(); |
| 257 o.add(buildBackendRule()); |
| 258 o.add(buildBackendRule()); |
| 259 return o; |
| 260 } |
| 261 |
| 262 checkUnnamed1737(core.List<api.BackendRule> o) { |
| 263 unittest.expect(o, unittest.hasLength(2)); |
| 264 checkBackendRule(o[0]); |
| 265 checkBackendRule(o[1]); |
| 266 } |
| 267 |
| 268 core.int buildCounterBackend = 0; |
| 269 buildBackend() { |
| 270 var o = new api.Backend(); |
| 271 buildCounterBackend++; |
| 272 if (buildCounterBackend < 3) { |
| 273 o.rules = buildUnnamed1737(); |
| 274 } |
| 275 buildCounterBackend--; |
| 276 return o; |
| 277 } |
| 278 |
| 279 checkBackend(api.Backend o) { |
| 280 buildCounterBackend++; |
| 281 if (buildCounterBackend < 3) { |
| 282 checkUnnamed1737(o.rules); |
| 283 } |
| 284 buildCounterBackend--; |
| 285 } |
| 286 |
| 287 core.int buildCounterBackendRule = 0; |
| 288 buildBackendRule() { |
| 289 var o = new api.BackendRule(); |
| 290 buildCounterBackendRule++; |
| 291 if (buildCounterBackendRule < 3) { |
| 292 o.address = "foo"; |
| 293 o.deadline = 42.0; |
| 294 o.selector = "foo"; |
| 295 } |
| 296 buildCounterBackendRule--; |
| 297 return o; |
| 298 } |
| 299 |
| 300 checkBackendRule(api.BackendRule o) { |
| 301 buildCounterBackendRule++; |
| 302 if (buildCounterBackendRule < 3) { |
| 303 unittest.expect(o.address, unittest.equals('foo')); |
| 304 unittest.expect(o.deadline, unittest.equals(42.0)); |
| 305 unittest.expect(o.selector, unittest.equals('foo')); |
| 306 } |
| 307 buildCounterBackendRule--; |
| 308 } |
| 309 |
| 310 buildUnnamed1738() { |
| 311 var o = new core.List<api.ContextRule>(); |
| 312 o.add(buildContextRule()); |
| 313 o.add(buildContextRule()); |
| 314 return o; |
| 315 } |
| 316 |
| 317 checkUnnamed1738(core.List<api.ContextRule> o) { |
| 318 unittest.expect(o, unittest.hasLength(2)); |
| 319 checkContextRule(o[0]); |
| 320 checkContextRule(o[1]); |
| 321 } |
| 322 |
| 323 core.int buildCounterContext = 0; |
| 324 buildContext() { |
| 325 var o = new api.Context(); |
| 326 buildCounterContext++; |
| 327 if (buildCounterContext < 3) { |
| 328 o.rules = buildUnnamed1738(); |
| 329 } |
| 330 buildCounterContext--; |
| 331 return o; |
| 332 } |
| 333 |
| 334 checkContext(api.Context o) { |
| 335 buildCounterContext++; |
| 336 if (buildCounterContext < 3) { |
| 337 checkUnnamed1738(o.rules); |
| 338 } |
| 339 buildCounterContext--; |
| 340 } |
| 341 |
| 342 buildUnnamed1739() { |
| 343 var o = new core.List<core.String>(); |
| 344 o.add("foo"); |
| 345 o.add("foo"); |
| 346 return o; |
| 347 } |
| 348 |
| 349 checkUnnamed1739(core.List<core.String> o) { |
| 350 unittest.expect(o, unittest.hasLength(2)); |
| 351 unittest.expect(o[0], unittest.equals('foo')); |
| 352 unittest.expect(o[1], unittest.equals('foo')); |
| 353 } |
| 354 |
| 355 buildUnnamed1740() { |
| 356 var o = new core.List<core.String>(); |
| 357 o.add("foo"); |
| 358 o.add("foo"); |
| 359 return o; |
| 360 } |
| 361 |
| 362 checkUnnamed1740(core.List<core.String> o) { |
| 363 unittest.expect(o, unittest.hasLength(2)); |
| 364 unittest.expect(o[0], unittest.equals('foo')); |
| 365 unittest.expect(o[1], unittest.equals('foo')); |
| 366 } |
| 367 |
| 368 core.int buildCounterContextRule = 0; |
| 369 buildContextRule() { |
| 370 var o = new api.ContextRule(); |
| 371 buildCounterContextRule++; |
| 372 if (buildCounterContextRule < 3) { |
| 373 o.provided = buildUnnamed1739(); |
| 374 o.requested = buildUnnamed1740(); |
| 375 o.selector = "foo"; |
| 376 } |
| 377 buildCounterContextRule--; |
| 378 return o; |
| 379 } |
| 380 |
| 381 checkContextRule(api.ContextRule o) { |
| 382 buildCounterContextRule++; |
| 383 if (buildCounterContextRule < 3) { |
| 384 checkUnnamed1739(o.provided); |
| 385 checkUnnamed1740(o.requested); |
| 386 unittest.expect(o.selector, unittest.equals('foo')); |
| 387 } |
| 388 buildCounterContextRule--; |
| 389 } |
| 390 |
| 391 core.int buildCounterControl = 0; |
| 392 buildControl() { |
| 393 var o = new api.Control(); |
| 394 buildCounterControl++; |
| 395 if (buildCounterControl < 3) { |
| 396 o.environment = "foo"; |
| 397 } |
| 398 buildCounterControl--; |
| 399 return o; |
| 400 } |
| 401 |
| 402 checkControl(api.Control o) { |
| 403 buildCounterControl++; |
| 404 if (buildCounterControl < 3) { |
| 405 unittest.expect(o.environment, unittest.equals('foo')); |
| 406 } |
| 407 buildCounterControl--; |
| 408 } |
| 409 |
| 410 buildUnnamed1741() { |
| 411 var o = new core.List<api.CustomErrorRule>(); |
| 412 o.add(buildCustomErrorRule()); |
| 413 o.add(buildCustomErrorRule()); |
| 414 return o; |
| 415 } |
| 416 |
| 417 checkUnnamed1741(core.List<api.CustomErrorRule> o) { |
| 418 unittest.expect(o, unittest.hasLength(2)); |
| 419 checkCustomErrorRule(o[0]); |
| 420 checkCustomErrorRule(o[1]); |
| 421 } |
| 422 |
| 423 buildUnnamed1742() { |
| 424 var o = new core.List<core.String>(); |
| 425 o.add("foo"); |
| 426 o.add("foo"); |
| 427 return o; |
| 428 } |
| 429 |
| 430 checkUnnamed1742(core.List<core.String> o) { |
| 431 unittest.expect(o, unittest.hasLength(2)); |
| 432 unittest.expect(o[0], unittest.equals('foo')); |
| 433 unittest.expect(o[1], unittest.equals('foo')); |
| 434 } |
| 435 |
| 436 core.int buildCounterCustomError = 0; |
| 437 buildCustomError() { |
| 438 var o = new api.CustomError(); |
| 439 buildCounterCustomError++; |
| 440 if (buildCounterCustomError < 3) { |
| 441 o.rules = buildUnnamed1741(); |
| 442 o.types = buildUnnamed1742(); |
| 443 } |
| 444 buildCounterCustomError--; |
| 445 return o; |
| 446 } |
| 447 |
| 448 checkCustomError(api.CustomError o) { |
| 449 buildCounterCustomError++; |
| 450 if (buildCounterCustomError < 3) { |
| 451 checkUnnamed1741(o.rules); |
| 452 checkUnnamed1742(o.types); |
| 453 } |
| 454 buildCounterCustomError--; |
| 455 } |
| 456 |
| 457 core.int buildCounterCustomErrorRule = 0; |
| 458 buildCustomErrorRule() { |
| 459 var o = new api.CustomErrorRule(); |
| 460 buildCounterCustomErrorRule++; |
| 461 if (buildCounterCustomErrorRule < 3) { |
| 462 o.isErrorType = true; |
| 463 o.selector = "foo"; |
| 464 } |
| 465 buildCounterCustomErrorRule--; |
| 466 return o; |
| 467 } |
| 468 |
| 469 checkCustomErrorRule(api.CustomErrorRule o) { |
| 470 buildCounterCustomErrorRule++; |
| 471 if (buildCounterCustomErrorRule < 3) { |
| 472 unittest.expect(o.isErrorType, unittest.isTrue); |
| 473 unittest.expect(o.selector, unittest.equals('foo')); |
| 474 } |
| 475 buildCounterCustomErrorRule--; |
| 476 } |
| 477 |
| 478 core.int buildCounterCustomHttpPattern = 0; |
| 479 buildCustomHttpPattern() { |
| 480 var o = new api.CustomHttpPattern(); |
| 481 buildCounterCustomHttpPattern++; |
| 482 if (buildCounterCustomHttpPattern < 3) { |
| 483 o.kind = "foo"; |
| 484 o.path = "foo"; |
| 485 } |
| 486 buildCounterCustomHttpPattern--; |
| 487 return o; |
| 488 } |
| 489 |
| 490 checkCustomHttpPattern(api.CustomHttpPattern o) { |
| 491 buildCounterCustomHttpPattern++; |
| 492 if (buildCounterCustomHttpPattern < 3) { |
| 493 unittest.expect(o.kind, unittest.equals('foo')); |
| 494 unittest.expect(o.path, unittest.equals('foo')); |
| 495 } |
| 496 buildCounterCustomHttpPattern--; |
| 497 } |
| 498 |
| 499 core.int buildCounterDisableServiceRequest = 0; |
| 500 buildDisableServiceRequest() { |
| 501 var o = new api.DisableServiceRequest(); |
| 502 buildCounterDisableServiceRequest++; |
| 503 if (buildCounterDisableServiceRequest < 3) { |
| 504 } |
| 505 buildCounterDisableServiceRequest--; |
| 506 return o; |
| 507 } |
| 508 |
| 509 checkDisableServiceRequest(api.DisableServiceRequest o) { |
| 510 buildCounterDisableServiceRequest++; |
| 511 if (buildCounterDisableServiceRequest < 3) { |
| 512 } |
| 513 buildCounterDisableServiceRequest--; |
| 514 } |
| 515 |
| 516 buildUnnamed1743() { |
| 517 var o = new core.List<api.Page>(); |
| 518 o.add(buildPage()); |
| 519 o.add(buildPage()); |
| 520 return o; |
| 521 } |
| 522 |
| 523 checkUnnamed1743(core.List<api.Page> o) { |
| 524 unittest.expect(o, unittest.hasLength(2)); |
| 525 checkPage(o[0]); |
| 526 checkPage(o[1]); |
| 527 } |
| 528 |
| 529 buildUnnamed1744() { |
| 530 var o = new core.List<api.DocumentationRule>(); |
| 531 o.add(buildDocumentationRule()); |
| 532 o.add(buildDocumentationRule()); |
| 533 return o; |
| 534 } |
| 535 |
| 536 checkUnnamed1744(core.List<api.DocumentationRule> o) { |
| 537 unittest.expect(o, unittest.hasLength(2)); |
| 538 checkDocumentationRule(o[0]); |
| 539 checkDocumentationRule(o[1]); |
| 540 } |
| 541 |
| 542 core.int buildCounterDocumentation = 0; |
| 543 buildDocumentation() { |
| 544 var o = new api.Documentation(); |
| 545 buildCounterDocumentation++; |
| 546 if (buildCounterDocumentation < 3) { |
| 547 o.documentationRootUrl = "foo"; |
| 548 o.overview = "foo"; |
| 549 o.pages = buildUnnamed1743(); |
| 550 o.rules = buildUnnamed1744(); |
| 551 o.summary = "foo"; |
| 552 } |
| 553 buildCounterDocumentation--; |
| 554 return o; |
| 555 } |
| 556 |
| 557 checkDocumentation(api.Documentation o) { |
| 558 buildCounterDocumentation++; |
| 559 if (buildCounterDocumentation < 3) { |
| 560 unittest.expect(o.documentationRootUrl, unittest.equals('foo')); |
| 561 unittest.expect(o.overview, unittest.equals('foo')); |
| 562 checkUnnamed1743(o.pages); |
| 563 checkUnnamed1744(o.rules); |
| 564 unittest.expect(o.summary, unittest.equals('foo')); |
| 565 } |
| 566 buildCounterDocumentation--; |
| 567 } |
| 568 |
| 569 core.int buildCounterDocumentationRule = 0; |
| 570 buildDocumentationRule() { |
| 571 var o = new api.DocumentationRule(); |
| 572 buildCounterDocumentationRule++; |
| 573 if (buildCounterDocumentationRule < 3) { |
| 574 o.deprecationDescription = "foo"; |
| 575 o.description = "foo"; |
| 576 o.selector = "foo"; |
| 577 } |
| 578 buildCounterDocumentationRule--; |
| 579 return o; |
| 580 } |
| 581 |
| 582 checkDocumentationRule(api.DocumentationRule o) { |
| 583 buildCounterDocumentationRule++; |
| 584 if (buildCounterDocumentationRule < 3) { |
| 585 unittest.expect(o.deprecationDescription, unittest.equals('foo')); |
| 586 unittest.expect(o.description, unittest.equals('foo')); |
| 587 unittest.expect(o.selector, unittest.equals('foo')); |
| 588 } |
| 589 buildCounterDocumentationRule--; |
| 590 } |
| 591 |
| 592 core.int buildCounterEnableServiceRequest = 0; |
| 593 buildEnableServiceRequest() { |
| 594 var o = new api.EnableServiceRequest(); |
| 595 buildCounterEnableServiceRequest++; |
| 596 if (buildCounterEnableServiceRequest < 3) { |
| 597 } |
| 598 buildCounterEnableServiceRequest--; |
| 599 return o; |
| 600 } |
| 601 |
| 602 checkEnableServiceRequest(api.EnableServiceRequest o) { |
| 603 buildCounterEnableServiceRequest++; |
| 604 if (buildCounterEnableServiceRequest < 3) { |
| 605 } |
| 606 buildCounterEnableServiceRequest--; |
| 607 } |
| 608 |
| 609 core.int buildCounterEnabledService = 0; |
| 610 buildEnabledService() { |
| 611 var o = new api.EnabledService(); |
| 612 buildCounterEnabledService++; |
| 613 if (buildCounterEnabledService < 3) { |
| 614 o.service = buildService(); |
| 615 } |
| 616 buildCounterEnabledService--; |
| 617 return o; |
| 618 } |
| 619 |
| 620 checkEnabledService(api.EnabledService o) { |
| 621 buildCounterEnabledService++; |
| 622 if (buildCounterEnabledService < 3) { |
| 623 checkService(o.service); |
| 624 } |
| 625 buildCounterEnabledService--; |
| 626 } |
| 627 |
| 628 buildUnnamed1745() { |
| 629 var o = new core.List<core.String>(); |
| 630 o.add("foo"); |
| 631 o.add("foo"); |
| 632 return o; |
| 633 } |
| 634 |
| 635 checkUnnamed1745(core.List<core.String> o) { |
| 636 unittest.expect(o, unittest.hasLength(2)); |
| 637 unittest.expect(o[0], unittest.equals('foo')); |
| 638 unittest.expect(o[1], unittest.equals('foo')); |
| 639 } |
| 640 |
| 641 buildUnnamed1746() { |
| 642 var o = new core.List<core.String>(); |
| 643 o.add("foo"); |
| 644 o.add("foo"); |
| 645 return o; |
| 646 } |
| 647 |
| 648 checkUnnamed1746(core.List<core.String> o) { |
| 649 unittest.expect(o, unittest.hasLength(2)); |
| 650 unittest.expect(o[0], unittest.equals('foo')); |
| 651 unittest.expect(o[1], unittest.equals('foo')); |
| 652 } |
| 653 |
| 654 buildUnnamed1747() { |
| 655 var o = new core.List<core.String>(); |
| 656 o.add("foo"); |
| 657 o.add("foo"); |
| 658 return o; |
| 659 } |
| 660 |
| 661 checkUnnamed1747(core.List<core.String> o) { |
| 662 unittest.expect(o, unittest.hasLength(2)); |
| 663 unittest.expect(o[0], unittest.equals('foo')); |
| 664 unittest.expect(o[1], unittest.equals('foo')); |
| 665 } |
| 666 |
| 667 core.int buildCounterEndpoint = 0; |
| 668 buildEndpoint() { |
| 669 var o = new api.Endpoint(); |
| 670 buildCounterEndpoint++; |
| 671 if (buildCounterEndpoint < 3) { |
| 672 o.aliases = buildUnnamed1745(); |
| 673 o.allowCors = true; |
| 674 o.apis = buildUnnamed1746(); |
| 675 o.features = buildUnnamed1747(); |
| 676 o.name = "foo"; |
| 677 } |
| 678 buildCounterEndpoint--; |
| 679 return o; |
| 680 } |
| 681 |
| 682 checkEndpoint(api.Endpoint o) { |
| 683 buildCounterEndpoint++; |
| 684 if (buildCounterEndpoint < 3) { |
| 685 checkUnnamed1745(o.aliases); |
| 686 unittest.expect(o.allowCors, unittest.isTrue); |
| 687 checkUnnamed1746(o.apis); |
| 688 checkUnnamed1747(o.features); |
| 689 unittest.expect(o.name, unittest.equals('foo')); |
| 690 } |
| 691 buildCounterEndpoint--; |
| 692 } |
| 693 |
| 694 buildUnnamed1748() { |
| 695 var o = new core.List<api.EnumValue>(); |
| 696 o.add(buildEnumValue()); |
| 697 o.add(buildEnumValue()); |
| 698 return o; |
| 699 } |
| 700 |
| 701 checkUnnamed1748(core.List<api.EnumValue> o) { |
| 702 unittest.expect(o, unittest.hasLength(2)); |
| 703 checkEnumValue(o[0]); |
| 704 checkEnumValue(o[1]); |
| 705 } |
| 706 |
| 707 buildUnnamed1749() { |
| 708 var o = new core.List<api.Option>(); |
| 709 o.add(buildOption()); |
| 710 o.add(buildOption()); |
| 711 return o; |
| 712 } |
| 713 |
| 714 checkUnnamed1749(core.List<api.Option> o) { |
| 715 unittest.expect(o, unittest.hasLength(2)); |
| 716 checkOption(o[0]); |
| 717 checkOption(o[1]); |
| 718 } |
| 719 |
| 720 core.int buildCounterEnum = 0; |
| 721 buildEnum() { |
| 722 var o = new api.Enum(); |
| 723 buildCounterEnum++; |
| 724 if (buildCounterEnum < 3) { |
| 725 o.enumvalue = buildUnnamed1748(); |
| 726 o.name = "foo"; |
| 727 o.options = buildUnnamed1749(); |
| 728 o.sourceContext = buildSourceContext(); |
| 729 o.syntax = "foo"; |
| 730 } |
| 731 buildCounterEnum--; |
| 732 return o; |
| 733 } |
| 734 |
| 735 checkEnum(api.Enum o) { |
| 736 buildCounterEnum++; |
| 737 if (buildCounterEnum < 3) { |
| 738 checkUnnamed1748(o.enumvalue); |
| 739 unittest.expect(o.name, unittest.equals('foo')); |
| 740 checkUnnamed1749(o.options); |
| 741 checkSourceContext(o.sourceContext); |
| 742 unittest.expect(o.syntax, unittest.equals('foo')); |
| 743 } |
| 744 buildCounterEnum--; |
| 745 } |
| 746 |
| 747 buildUnnamed1750() { |
| 748 var o = new core.List<api.Option>(); |
| 749 o.add(buildOption()); |
| 750 o.add(buildOption()); |
| 751 return o; |
| 752 } |
| 753 |
| 754 checkUnnamed1750(core.List<api.Option> o) { |
| 755 unittest.expect(o, unittest.hasLength(2)); |
| 756 checkOption(o[0]); |
| 757 checkOption(o[1]); |
| 758 } |
| 759 |
| 760 core.int buildCounterEnumValue = 0; |
| 761 buildEnumValue() { |
| 762 var o = new api.EnumValue(); |
| 763 buildCounterEnumValue++; |
| 764 if (buildCounterEnumValue < 3) { |
| 765 o.name = "foo"; |
| 766 o.number = 42; |
| 767 o.options = buildUnnamed1750(); |
| 768 } |
| 769 buildCounterEnumValue--; |
| 770 return o; |
| 771 } |
| 772 |
| 773 checkEnumValue(api.EnumValue o) { |
| 774 buildCounterEnumValue++; |
| 775 if (buildCounterEnumValue < 3) { |
| 776 unittest.expect(o.name, unittest.equals('foo')); |
| 777 unittest.expect(o.number, unittest.equals(42)); |
| 778 checkUnnamed1750(o.options); |
| 779 } |
| 780 buildCounterEnumValue--; |
| 781 } |
| 782 |
| 783 buildUnnamed1751() { |
| 784 var o = new core.List<api.Option>(); |
| 785 o.add(buildOption()); |
| 786 o.add(buildOption()); |
| 787 return o; |
| 788 } |
| 789 |
| 790 checkUnnamed1751(core.List<api.Option> o) { |
| 791 unittest.expect(o, unittest.hasLength(2)); |
| 792 checkOption(o[0]); |
| 793 checkOption(o[1]); |
| 794 } |
| 795 |
| 796 core.int buildCounterField = 0; |
| 797 buildField() { |
| 798 var o = new api.Field(); |
| 799 buildCounterField++; |
| 800 if (buildCounterField < 3) { |
| 801 o.cardinality = "foo"; |
| 802 o.defaultValue = "foo"; |
| 803 o.jsonName = "foo"; |
| 804 o.kind = "foo"; |
| 805 o.name = "foo"; |
| 806 o.number = 42; |
| 807 o.oneofIndex = 42; |
| 808 o.options = buildUnnamed1751(); |
| 809 o.packed = true; |
| 810 o.typeUrl = "foo"; |
| 811 } |
| 812 buildCounterField--; |
| 813 return o; |
| 814 } |
| 815 |
| 816 checkField(api.Field o) { |
| 817 buildCounterField++; |
| 818 if (buildCounterField < 3) { |
| 819 unittest.expect(o.cardinality, unittest.equals('foo')); |
| 820 unittest.expect(o.defaultValue, unittest.equals('foo')); |
| 821 unittest.expect(o.jsonName, unittest.equals('foo')); |
| 822 unittest.expect(o.kind, unittest.equals('foo')); |
| 823 unittest.expect(o.name, unittest.equals('foo')); |
| 824 unittest.expect(o.number, unittest.equals(42)); |
| 825 unittest.expect(o.oneofIndex, unittest.equals(42)); |
| 826 checkUnnamed1751(o.options); |
| 827 unittest.expect(o.packed, unittest.isTrue); |
| 828 unittest.expect(o.typeUrl, unittest.equals('foo')); |
| 829 } |
| 830 buildCounterField--; |
| 831 } |
| 832 |
| 833 buildUnnamed1752() { |
| 834 var o = new core.List<api.HttpRule>(); |
| 835 o.add(buildHttpRule()); |
| 836 o.add(buildHttpRule()); |
| 837 return o; |
| 838 } |
| 839 |
| 840 checkUnnamed1752(core.List<api.HttpRule> o) { |
| 841 unittest.expect(o, unittest.hasLength(2)); |
| 842 checkHttpRule(o[0]); |
| 843 checkHttpRule(o[1]); |
| 844 } |
| 845 |
| 846 core.int buildCounterHttp = 0; |
| 847 buildHttp() { |
| 848 var o = new api.Http(); |
| 849 buildCounterHttp++; |
| 850 if (buildCounterHttp < 3) { |
| 851 o.rules = buildUnnamed1752(); |
| 852 } |
| 853 buildCounterHttp--; |
| 854 return o; |
| 855 } |
| 856 |
| 857 checkHttp(api.Http o) { |
| 858 buildCounterHttp++; |
| 859 if (buildCounterHttp < 3) { |
| 860 checkUnnamed1752(o.rules); |
| 861 } |
| 862 buildCounterHttp--; |
| 863 } |
| 864 |
| 865 buildUnnamed1753() { |
| 866 var o = new core.List<api.HttpRule>(); |
| 867 o.add(buildHttpRule()); |
| 868 o.add(buildHttpRule()); |
| 869 return o; |
| 870 } |
| 871 |
| 872 checkUnnamed1753(core.List<api.HttpRule> o) { |
| 873 unittest.expect(o, unittest.hasLength(2)); |
| 874 checkHttpRule(o[0]); |
| 875 checkHttpRule(o[1]); |
| 876 } |
| 877 |
| 878 core.int buildCounterHttpRule = 0; |
| 879 buildHttpRule() { |
| 880 var o = new api.HttpRule(); |
| 881 buildCounterHttpRule++; |
| 882 if (buildCounterHttpRule < 3) { |
| 883 o.additionalBindings = buildUnnamed1753(); |
| 884 o.body = "foo"; |
| 885 o.custom = buildCustomHttpPattern(); |
| 886 o.delete = "foo"; |
| 887 o.get = "foo"; |
| 888 o.mediaDownload = buildMediaDownload(); |
| 889 o.mediaUpload = buildMediaUpload(); |
| 890 o.patch = "foo"; |
| 891 o.post = "foo"; |
| 892 o.put = "foo"; |
| 893 o.responseBody = "foo"; |
| 894 o.selector = "foo"; |
| 895 } |
| 896 buildCounterHttpRule--; |
| 897 return o; |
| 898 } |
| 899 |
| 900 checkHttpRule(api.HttpRule o) { |
| 901 buildCounterHttpRule++; |
| 902 if (buildCounterHttpRule < 3) { |
| 903 checkUnnamed1753(o.additionalBindings); |
| 904 unittest.expect(o.body, unittest.equals('foo')); |
| 905 checkCustomHttpPattern(o.custom); |
| 906 unittest.expect(o.delete, unittest.equals('foo')); |
| 907 unittest.expect(o.get, unittest.equals('foo')); |
| 908 checkMediaDownload(o.mediaDownload); |
| 909 checkMediaUpload(o.mediaUpload); |
| 910 unittest.expect(o.patch, unittest.equals('foo')); |
| 911 unittest.expect(o.post, unittest.equals('foo')); |
| 912 unittest.expect(o.put, unittest.equals('foo')); |
| 913 unittest.expect(o.responseBody, unittest.equals('foo')); |
| 914 unittest.expect(o.selector, unittest.equals('foo')); |
| 915 } |
| 916 buildCounterHttpRule--; |
| 917 } |
| 918 |
| 919 core.int buildCounterLabelDescriptor = 0; |
| 920 buildLabelDescriptor() { |
| 921 var o = new api.LabelDescriptor(); |
| 922 buildCounterLabelDescriptor++; |
| 923 if (buildCounterLabelDescriptor < 3) { |
| 924 o.description = "foo"; |
| 925 o.key = "foo"; |
| 926 o.valueType = "foo"; |
| 927 } |
| 928 buildCounterLabelDescriptor--; |
| 929 return o; |
| 930 } |
| 931 |
| 932 checkLabelDescriptor(api.LabelDescriptor o) { |
| 933 buildCounterLabelDescriptor++; |
| 934 if (buildCounterLabelDescriptor < 3) { |
| 935 unittest.expect(o.description, unittest.equals('foo')); |
| 936 unittest.expect(o.key, unittest.equals('foo')); |
| 937 unittest.expect(o.valueType, unittest.equals('foo')); |
| 938 } |
| 939 buildCounterLabelDescriptor--; |
| 940 } |
| 941 |
| 942 buildUnnamed1754() { |
| 943 var o = new core.List<api.EnabledService>(); |
| 944 o.add(buildEnabledService()); |
| 945 o.add(buildEnabledService()); |
| 946 return o; |
| 947 } |
| 948 |
| 949 checkUnnamed1754(core.List<api.EnabledService> o) { |
| 950 unittest.expect(o, unittest.hasLength(2)); |
| 951 checkEnabledService(o[0]); |
| 952 checkEnabledService(o[1]); |
| 953 } |
| 954 |
| 955 core.int buildCounterListEnabledServicesResponse = 0; |
| 956 buildListEnabledServicesResponse() { |
| 957 var o = new api.ListEnabledServicesResponse(); |
| 958 buildCounterListEnabledServicesResponse++; |
| 959 if (buildCounterListEnabledServicesResponse < 3) { |
| 960 o.nextPageToken = "foo"; |
| 961 o.services = buildUnnamed1754(); |
| 962 } |
| 963 buildCounterListEnabledServicesResponse--; |
| 964 return o; |
| 965 } |
| 966 |
| 967 checkListEnabledServicesResponse(api.ListEnabledServicesResponse o) { |
| 968 buildCounterListEnabledServicesResponse++; |
| 969 if (buildCounterListEnabledServicesResponse < 3) { |
| 970 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 971 checkUnnamed1754(o.services); |
| 972 } |
| 973 buildCounterListEnabledServicesResponse--; |
| 974 } |
| 975 |
| 976 buildUnnamed1755() { |
| 977 var o = new core.List<api.LabelDescriptor>(); |
| 978 o.add(buildLabelDescriptor()); |
| 979 o.add(buildLabelDescriptor()); |
| 980 return o; |
| 981 } |
| 982 |
| 983 checkUnnamed1755(core.List<api.LabelDescriptor> o) { |
| 984 unittest.expect(o, unittest.hasLength(2)); |
| 985 checkLabelDescriptor(o[0]); |
| 986 checkLabelDescriptor(o[1]); |
| 987 } |
| 988 |
| 989 core.int buildCounterLogDescriptor = 0; |
| 990 buildLogDescriptor() { |
| 991 var o = new api.LogDescriptor(); |
| 992 buildCounterLogDescriptor++; |
| 993 if (buildCounterLogDescriptor < 3) { |
| 994 o.description = "foo"; |
| 995 o.displayName = "foo"; |
| 996 o.labels = buildUnnamed1755(); |
| 997 o.name = "foo"; |
| 998 } |
| 999 buildCounterLogDescriptor--; |
| 1000 return o; |
| 1001 } |
| 1002 |
| 1003 checkLogDescriptor(api.LogDescriptor o) { |
| 1004 buildCounterLogDescriptor++; |
| 1005 if (buildCounterLogDescriptor < 3) { |
| 1006 unittest.expect(o.description, unittest.equals('foo')); |
| 1007 unittest.expect(o.displayName, unittest.equals('foo')); |
| 1008 checkUnnamed1755(o.labels); |
| 1009 unittest.expect(o.name, unittest.equals('foo')); |
| 1010 } |
| 1011 buildCounterLogDescriptor--; |
| 1012 } |
| 1013 |
| 1014 buildUnnamed1756() { |
| 1015 var o = new core.List<api.LoggingDestination>(); |
| 1016 o.add(buildLoggingDestination()); |
| 1017 o.add(buildLoggingDestination()); |
| 1018 return o; |
| 1019 } |
| 1020 |
| 1021 checkUnnamed1756(core.List<api.LoggingDestination> o) { |
| 1022 unittest.expect(o, unittest.hasLength(2)); |
| 1023 checkLoggingDestination(o[0]); |
| 1024 checkLoggingDestination(o[1]); |
| 1025 } |
| 1026 |
| 1027 buildUnnamed1757() { |
| 1028 var o = new core.List<api.LoggingDestination>(); |
| 1029 o.add(buildLoggingDestination()); |
| 1030 o.add(buildLoggingDestination()); |
| 1031 return o; |
| 1032 } |
| 1033 |
| 1034 checkUnnamed1757(core.List<api.LoggingDestination> o) { |
| 1035 unittest.expect(o, unittest.hasLength(2)); |
| 1036 checkLoggingDestination(o[0]); |
| 1037 checkLoggingDestination(o[1]); |
| 1038 } |
| 1039 |
| 1040 core.int buildCounterLogging = 0; |
| 1041 buildLogging() { |
| 1042 var o = new api.Logging(); |
| 1043 buildCounterLogging++; |
| 1044 if (buildCounterLogging < 3) { |
| 1045 o.consumerDestinations = buildUnnamed1756(); |
| 1046 o.producerDestinations = buildUnnamed1757(); |
| 1047 } |
| 1048 buildCounterLogging--; |
| 1049 return o; |
| 1050 } |
| 1051 |
| 1052 checkLogging(api.Logging o) { |
| 1053 buildCounterLogging++; |
| 1054 if (buildCounterLogging < 3) { |
| 1055 checkUnnamed1756(o.consumerDestinations); |
| 1056 checkUnnamed1757(o.producerDestinations); |
| 1057 } |
| 1058 buildCounterLogging--; |
| 1059 } |
| 1060 |
| 1061 buildUnnamed1758() { |
| 1062 var o = new core.List<core.String>(); |
| 1063 o.add("foo"); |
| 1064 o.add("foo"); |
| 1065 return o; |
| 1066 } |
| 1067 |
| 1068 checkUnnamed1758(core.List<core.String> o) { |
| 1069 unittest.expect(o, unittest.hasLength(2)); |
| 1070 unittest.expect(o[0], unittest.equals('foo')); |
| 1071 unittest.expect(o[1], unittest.equals('foo')); |
| 1072 } |
| 1073 |
| 1074 core.int buildCounterLoggingDestination = 0; |
| 1075 buildLoggingDestination() { |
| 1076 var o = new api.LoggingDestination(); |
| 1077 buildCounterLoggingDestination++; |
| 1078 if (buildCounterLoggingDestination < 3) { |
| 1079 o.logs = buildUnnamed1758(); |
| 1080 o.monitoredResource = "foo"; |
| 1081 } |
| 1082 buildCounterLoggingDestination--; |
| 1083 return o; |
| 1084 } |
| 1085 |
| 1086 checkLoggingDestination(api.LoggingDestination o) { |
| 1087 buildCounterLoggingDestination++; |
| 1088 if (buildCounterLoggingDestination < 3) { |
| 1089 checkUnnamed1758(o.logs); |
| 1090 unittest.expect(o.monitoredResource, unittest.equals('foo')); |
| 1091 } |
| 1092 buildCounterLoggingDestination--; |
| 1093 } |
| 1094 |
| 1095 core.int buildCounterMediaDownload = 0; |
| 1096 buildMediaDownload() { |
| 1097 var o = new api.MediaDownload(); |
| 1098 buildCounterMediaDownload++; |
| 1099 if (buildCounterMediaDownload < 3) { |
| 1100 o.enabled = true; |
| 1101 } |
| 1102 buildCounterMediaDownload--; |
| 1103 return o; |
| 1104 } |
| 1105 |
| 1106 checkMediaDownload(api.MediaDownload o) { |
| 1107 buildCounterMediaDownload++; |
| 1108 if (buildCounterMediaDownload < 3) { |
| 1109 unittest.expect(o.enabled, unittest.isTrue); |
| 1110 } |
| 1111 buildCounterMediaDownload--; |
| 1112 } |
| 1113 |
| 1114 core.int buildCounterMediaUpload = 0; |
| 1115 buildMediaUpload() { |
| 1116 var o = new api.MediaUpload(); |
| 1117 buildCounterMediaUpload++; |
| 1118 if (buildCounterMediaUpload < 3) { |
| 1119 o.enabled = true; |
| 1120 } |
| 1121 buildCounterMediaUpload--; |
| 1122 return o; |
| 1123 } |
| 1124 |
| 1125 checkMediaUpload(api.MediaUpload o) { |
| 1126 buildCounterMediaUpload++; |
| 1127 if (buildCounterMediaUpload < 3) { |
| 1128 unittest.expect(o.enabled, unittest.isTrue); |
| 1129 } |
| 1130 buildCounterMediaUpload--; |
| 1131 } |
| 1132 |
| 1133 buildUnnamed1759() { |
| 1134 var o = new core.List<api.Option>(); |
| 1135 o.add(buildOption()); |
| 1136 o.add(buildOption()); |
| 1137 return o; |
| 1138 } |
| 1139 |
| 1140 checkUnnamed1759(core.List<api.Option> o) { |
| 1141 unittest.expect(o, unittest.hasLength(2)); |
| 1142 checkOption(o[0]); |
| 1143 checkOption(o[1]); |
| 1144 } |
| 1145 |
| 1146 core.int buildCounterMethod = 0; |
| 1147 buildMethod() { |
| 1148 var o = new api.Method(); |
| 1149 buildCounterMethod++; |
| 1150 if (buildCounterMethod < 3) { |
| 1151 o.name = "foo"; |
| 1152 o.options = buildUnnamed1759(); |
| 1153 o.requestStreaming = true; |
| 1154 o.requestTypeUrl = "foo"; |
| 1155 o.responseStreaming = true; |
| 1156 o.responseTypeUrl = "foo"; |
| 1157 o.syntax = "foo"; |
| 1158 } |
| 1159 buildCounterMethod--; |
| 1160 return o; |
| 1161 } |
| 1162 |
| 1163 checkMethod(api.Method o) { |
| 1164 buildCounterMethod++; |
| 1165 if (buildCounterMethod < 3) { |
| 1166 unittest.expect(o.name, unittest.equals('foo')); |
| 1167 checkUnnamed1759(o.options); |
| 1168 unittest.expect(o.requestStreaming, unittest.isTrue); |
| 1169 unittest.expect(o.requestTypeUrl, unittest.equals('foo')); |
| 1170 unittest.expect(o.responseStreaming, unittest.isTrue); |
| 1171 unittest.expect(o.responseTypeUrl, unittest.equals('foo')); |
| 1172 unittest.expect(o.syntax, unittest.equals('foo')); |
| 1173 } |
| 1174 buildCounterMethod--; |
| 1175 } |
| 1176 |
| 1177 buildUnnamed1760() { |
| 1178 var o = new core.List<api.LabelDescriptor>(); |
| 1179 o.add(buildLabelDescriptor()); |
| 1180 o.add(buildLabelDescriptor()); |
| 1181 return o; |
| 1182 } |
| 1183 |
| 1184 checkUnnamed1760(core.List<api.LabelDescriptor> o) { |
| 1185 unittest.expect(o, unittest.hasLength(2)); |
| 1186 checkLabelDescriptor(o[0]); |
| 1187 checkLabelDescriptor(o[1]); |
| 1188 } |
| 1189 |
| 1190 core.int buildCounterMetricDescriptor = 0; |
| 1191 buildMetricDescriptor() { |
| 1192 var o = new api.MetricDescriptor(); |
| 1193 buildCounterMetricDescriptor++; |
| 1194 if (buildCounterMetricDescriptor < 3) { |
| 1195 o.description = "foo"; |
| 1196 o.displayName = "foo"; |
| 1197 o.labels = buildUnnamed1760(); |
| 1198 o.metricKind = "foo"; |
| 1199 o.name = "foo"; |
| 1200 o.type = "foo"; |
| 1201 o.unit = "foo"; |
| 1202 o.valueType = "foo"; |
| 1203 } |
| 1204 buildCounterMetricDescriptor--; |
| 1205 return o; |
| 1206 } |
| 1207 |
| 1208 checkMetricDescriptor(api.MetricDescriptor o) { |
| 1209 buildCounterMetricDescriptor++; |
| 1210 if (buildCounterMetricDescriptor < 3) { |
| 1211 unittest.expect(o.description, unittest.equals('foo')); |
| 1212 unittest.expect(o.displayName, unittest.equals('foo')); |
| 1213 checkUnnamed1760(o.labels); |
| 1214 unittest.expect(o.metricKind, unittest.equals('foo')); |
| 1215 unittest.expect(o.name, unittest.equals('foo')); |
| 1216 unittest.expect(o.type, unittest.equals('foo')); |
| 1217 unittest.expect(o.unit, unittest.equals('foo')); |
| 1218 unittest.expect(o.valueType, unittest.equals('foo')); |
| 1219 } |
| 1220 buildCounterMetricDescriptor--; |
| 1221 } |
| 1222 |
| 1223 core.int buildCounterMixin = 0; |
| 1224 buildMixin() { |
| 1225 var o = new api.Mixin(); |
| 1226 buildCounterMixin++; |
| 1227 if (buildCounterMixin < 3) { |
| 1228 o.name = "foo"; |
| 1229 o.root = "foo"; |
| 1230 } |
| 1231 buildCounterMixin--; |
| 1232 return o; |
| 1233 } |
| 1234 |
| 1235 checkMixin(api.Mixin o) { |
| 1236 buildCounterMixin++; |
| 1237 if (buildCounterMixin < 3) { |
| 1238 unittest.expect(o.name, unittest.equals('foo')); |
| 1239 unittest.expect(o.root, unittest.equals('foo')); |
| 1240 } |
| 1241 buildCounterMixin--; |
| 1242 } |
| 1243 |
| 1244 buildUnnamed1761() { |
| 1245 var o = new core.List<api.LabelDescriptor>(); |
| 1246 o.add(buildLabelDescriptor()); |
| 1247 o.add(buildLabelDescriptor()); |
| 1248 return o; |
| 1249 } |
| 1250 |
| 1251 checkUnnamed1761(core.List<api.LabelDescriptor> o) { |
| 1252 unittest.expect(o, unittest.hasLength(2)); |
| 1253 checkLabelDescriptor(o[0]); |
| 1254 checkLabelDescriptor(o[1]); |
| 1255 } |
| 1256 |
| 1257 core.int buildCounterMonitoredResourceDescriptor = 0; |
| 1258 buildMonitoredResourceDescriptor() { |
| 1259 var o = new api.MonitoredResourceDescriptor(); |
| 1260 buildCounterMonitoredResourceDescriptor++; |
| 1261 if (buildCounterMonitoredResourceDescriptor < 3) { |
| 1262 o.description = "foo"; |
| 1263 o.displayName = "foo"; |
| 1264 o.labels = buildUnnamed1761(); |
| 1265 o.name = "foo"; |
| 1266 o.type = "foo"; |
| 1267 } |
| 1268 buildCounterMonitoredResourceDescriptor--; |
| 1269 return o; |
| 1270 } |
| 1271 |
| 1272 checkMonitoredResourceDescriptor(api.MonitoredResourceDescriptor o) { |
| 1273 buildCounterMonitoredResourceDescriptor++; |
| 1274 if (buildCounterMonitoredResourceDescriptor < 3) { |
| 1275 unittest.expect(o.description, unittest.equals('foo')); |
| 1276 unittest.expect(o.displayName, unittest.equals('foo')); |
| 1277 checkUnnamed1761(o.labels); |
| 1278 unittest.expect(o.name, unittest.equals('foo')); |
| 1279 unittest.expect(o.type, unittest.equals('foo')); |
| 1280 } |
| 1281 buildCounterMonitoredResourceDescriptor--; |
| 1282 } |
| 1283 |
| 1284 buildUnnamed1762() { |
| 1285 var o = new core.List<api.MonitoringDestination>(); |
| 1286 o.add(buildMonitoringDestination()); |
| 1287 o.add(buildMonitoringDestination()); |
| 1288 return o; |
| 1289 } |
| 1290 |
| 1291 checkUnnamed1762(core.List<api.MonitoringDestination> o) { |
| 1292 unittest.expect(o, unittest.hasLength(2)); |
| 1293 checkMonitoringDestination(o[0]); |
| 1294 checkMonitoringDestination(o[1]); |
| 1295 } |
| 1296 |
| 1297 buildUnnamed1763() { |
| 1298 var o = new core.List<api.MonitoringDestination>(); |
| 1299 o.add(buildMonitoringDestination()); |
| 1300 o.add(buildMonitoringDestination()); |
| 1301 return o; |
| 1302 } |
| 1303 |
| 1304 checkUnnamed1763(core.List<api.MonitoringDestination> o) { |
| 1305 unittest.expect(o, unittest.hasLength(2)); |
| 1306 checkMonitoringDestination(o[0]); |
| 1307 checkMonitoringDestination(o[1]); |
| 1308 } |
| 1309 |
| 1310 core.int buildCounterMonitoring = 0; |
| 1311 buildMonitoring() { |
| 1312 var o = new api.Monitoring(); |
| 1313 buildCounterMonitoring++; |
| 1314 if (buildCounterMonitoring < 3) { |
| 1315 o.consumerDestinations = buildUnnamed1762(); |
| 1316 o.producerDestinations = buildUnnamed1763(); |
| 1317 } |
| 1318 buildCounterMonitoring--; |
| 1319 return o; |
| 1320 } |
| 1321 |
| 1322 checkMonitoring(api.Monitoring o) { |
| 1323 buildCounterMonitoring++; |
| 1324 if (buildCounterMonitoring < 3) { |
| 1325 checkUnnamed1762(o.consumerDestinations); |
| 1326 checkUnnamed1763(o.producerDestinations); |
| 1327 } |
| 1328 buildCounterMonitoring--; |
| 1329 } |
| 1330 |
| 1331 buildUnnamed1764() { |
| 1332 var o = new core.List<core.String>(); |
| 1333 o.add("foo"); |
| 1334 o.add("foo"); |
| 1335 return o; |
| 1336 } |
| 1337 |
| 1338 checkUnnamed1764(core.List<core.String> o) { |
| 1339 unittest.expect(o, unittest.hasLength(2)); |
| 1340 unittest.expect(o[0], unittest.equals('foo')); |
| 1341 unittest.expect(o[1], unittest.equals('foo')); |
| 1342 } |
| 1343 |
| 1344 core.int buildCounterMonitoringDestination = 0; |
| 1345 buildMonitoringDestination() { |
| 1346 var o = new api.MonitoringDestination(); |
| 1347 buildCounterMonitoringDestination++; |
| 1348 if (buildCounterMonitoringDestination < 3) { |
| 1349 o.metrics = buildUnnamed1764(); |
| 1350 o.monitoredResource = "foo"; |
| 1351 } |
| 1352 buildCounterMonitoringDestination--; |
| 1353 return o; |
| 1354 } |
| 1355 |
| 1356 checkMonitoringDestination(api.MonitoringDestination o) { |
| 1357 buildCounterMonitoringDestination++; |
| 1358 if (buildCounterMonitoringDestination < 3) { |
| 1359 checkUnnamed1764(o.metrics); |
| 1360 unittest.expect(o.monitoredResource, unittest.equals('foo')); |
| 1361 } |
| 1362 buildCounterMonitoringDestination--; |
| 1363 } |
| 1364 |
| 1365 core.int buildCounterOAuthRequirements = 0; |
| 1366 buildOAuthRequirements() { |
| 1367 var o = new api.OAuthRequirements(); |
| 1368 buildCounterOAuthRequirements++; |
| 1369 if (buildCounterOAuthRequirements < 3) { |
| 1370 o.canonicalScopes = "foo"; |
| 1371 } |
| 1372 buildCounterOAuthRequirements--; |
| 1373 return o; |
| 1374 } |
| 1375 |
| 1376 checkOAuthRequirements(api.OAuthRequirements o) { |
| 1377 buildCounterOAuthRequirements++; |
| 1378 if (buildCounterOAuthRequirements < 3) { |
| 1379 unittest.expect(o.canonicalScopes, unittest.equals('foo')); |
| 1380 } |
| 1381 buildCounterOAuthRequirements--; |
| 1382 } |
| 1383 |
| 1384 buildUnnamed1765() { |
| 1385 var o = new core.Map<core.String, core.Object>(); |
| 1386 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1387 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1388 return o; |
| 1389 } |
| 1390 |
| 1391 checkUnnamed1765(core.Map<core.String, core.Object> o) { |
| 1392 unittest.expect(o, unittest.hasLength(2)); |
| 1393 var casted1 = (o["x"]) as core.Map; unittest.expect(casted1, unittest.hasLengt
h(3)); unittest.expect(casted1["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted1["bool"], unittest.equals(true)); unittest.expect(casted1["string"],
unittest.equals('foo')); |
| 1394 var casted2 = (o["y"]) as core.Map; unittest.expect(casted2, unittest.hasLengt
h(3)); unittest.expect(casted2["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted2["bool"], unittest.equals(true)); unittest.expect(casted2["string"],
unittest.equals('foo')); |
| 1395 } |
| 1396 |
| 1397 buildUnnamed1766() { |
| 1398 var o = new core.Map<core.String, core.Object>(); |
| 1399 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1400 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1401 return o; |
| 1402 } |
| 1403 |
| 1404 checkUnnamed1766(core.Map<core.String, core.Object> o) { |
| 1405 unittest.expect(o, unittest.hasLength(2)); |
| 1406 var casted3 = (o["x"]) as core.Map; unittest.expect(casted3, unittest.hasLengt
h(3)); unittest.expect(casted3["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted3["bool"], unittest.equals(true)); unittest.expect(casted3["string"],
unittest.equals('foo')); |
| 1407 var casted4 = (o["y"]) as core.Map; unittest.expect(casted4, unittest.hasLengt
h(3)); unittest.expect(casted4["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted4["bool"], unittest.equals(true)); unittest.expect(casted4["string"],
unittest.equals('foo')); |
| 1408 } |
| 1409 |
| 1410 core.int buildCounterOperation = 0; |
| 1411 buildOperation() { |
| 1412 var o = new api.Operation(); |
| 1413 buildCounterOperation++; |
| 1414 if (buildCounterOperation < 3) { |
| 1415 o.done = true; |
| 1416 o.error = buildStatus(); |
| 1417 o.metadata = buildUnnamed1765(); |
| 1418 o.name = "foo"; |
| 1419 o.response = buildUnnamed1766(); |
| 1420 } |
| 1421 buildCounterOperation--; |
| 1422 return o; |
| 1423 } |
| 1424 |
| 1425 checkOperation(api.Operation o) { |
| 1426 buildCounterOperation++; |
| 1427 if (buildCounterOperation < 3) { |
| 1428 unittest.expect(o.done, unittest.isTrue); |
| 1429 checkStatus(o.error); |
| 1430 checkUnnamed1765(o.metadata); |
| 1431 unittest.expect(o.name, unittest.equals('foo')); |
| 1432 checkUnnamed1766(o.response); |
| 1433 } |
| 1434 buildCounterOperation--; |
| 1435 } |
| 1436 |
| 1437 buildUnnamed1767() { |
| 1438 var o = new core.Map<core.String, core.Object>(); |
| 1439 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1440 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1441 return o; |
| 1442 } |
| 1443 |
| 1444 checkUnnamed1767(core.Map<core.String, core.Object> o) { |
| 1445 unittest.expect(o, unittest.hasLength(2)); |
| 1446 var casted5 = (o["x"]) as core.Map; unittest.expect(casted5, unittest.hasLengt
h(3)); unittest.expect(casted5["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted5["bool"], unittest.equals(true)); unittest.expect(casted5["string"],
unittest.equals('foo')); |
| 1447 var casted6 = (o["y"]) as core.Map; unittest.expect(casted6, unittest.hasLengt
h(3)); unittest.expect(casted6["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted6["bool"], unittest.equals(true)); unittest.expect(casted6["string"],
unittest.equals('foo')); |
| 1448 } |
| 1449 |
| 1450 core.int buildCounterOption = 0; |
| 1451 buildOption() { |
| 1452 var o = new api.Option(); |
| 1453 buildCounterOption++; |
| 1454 if (buildCounterOption < 3) { |
| 1455 o.name = "foo"; |
| 1456 o.value = buildUnnamed1767(); |
| 1457 } |
| 1458 buildCounterOption--; |
| 1459 return o; |
| 1460 } |
| 1461 |
| 1462 checkOption(api.Option o) { |
| 1463 buildCounterOption++; |
| 1464 if (buildCounterOption < 3) { |
| 1465 unittest.expect(o.name, unittest.equals('foo')); |
| 1466 checkUnnamed1767(o.value); |
| 1467 } |
| 1468 buildCounterOption--; |
| 1469 } |
| 1470 |
| 1471 buildUnnamed1768() { |
| 1472 var o = new core.List<api.Page>(); |
| 1473 o.add(buildPage()); |
| 1474 o.add(buildPage()); |
| 1475 return o; |
| 1476 } |
| 1477 |
| 1478 checkUnnamed1768(core.List<api.Page> o) { |
| 1479 unittest.expect(o, unittest.hasLength(2)); |
| 1480 checkPage(o[0]); |
| 1481 checkPage(o[1]); |
| 1482 } |
| 1483 |
| 1484 core.int buildCounterPage = 0; |
| 1485 buildPage() { |
| 1486 var o = new api.Page(); |
| 1487 buildCounterPage++; |
| 1488 if (buildCounterPage < 3) { |
| 1489 o.content = "foo"; |
| 1490 o.name = "foo"; |
| 1491 o.subpages = buildUnnamed1768(); |
| 1492 } |
| 1493 buildCounterPage--; |
| 1494 return o; |
| 1495 } |
| 1496 |
| 1497 checkPage(api.Page o) { |
| 1498 buildCounterPage++; |
| 1499 if (buildCounterPage < 3) { |
| 1500 unittest.expect(o.content, unittest.equals('foo')); |
| 1501 unittest.expect(o.name, unittest.equals('foo')); |
| 1502 checkUnnamed1768(o.subpages); |
| 1503 } |
| 1504 buildCounterPage--; |
| 1505 } |
| 1506 |
| 1507 buildUnnamed1769() { |
| 1508 var o = new core.List<api.Api>(); |
| 1509 o.add(buildApi()); |
| 1510 o.add(buildApi()); |
| 1511 return o; |
| 1512 } |
| 1513 |
| 1514 checkUnnamed1769(core.List<api.Api> o) { |
| 1515 unittest.expect(o, unittest.hasLength(2)); |
| 1516 checkApi(o[0]); |
| 1517 checkApi(o[1]); |
| 1518 } |
| 1519 |
| 1520 buildUnnamed1770() { |
| 1521 var o = new core.List<api.Endpoint>(); |
| 1522 o.add(buildEndpoint()); |
| 1523 o.add(buildEndpoint()); |
| 1524 return o; |
| 1525 } |
| 1526 |
| 1527 checkUnnamed1770(core.List<api.Endpoint> o) { |
| 1528 unittest.expect(o, unittest.hasLength(2)); |
| 1529 checkEndpoint(o[0]); |
| 1530 checkEndpoint(o[1]); |
| 1531 } |
| 1532 |
| 1533 buildUnnamed1771() { |
| 1534 var o = new core.List<api.Enum>(); |
| 1535 o.add(buildEnum()); |
| 1536 o.add(buildEnum()); |
| 1537 return o; |
| 1538 } |
| 1539 |
| 1540 checkUnnamed1771(core.List<api.Enum> o) { |
| 1541 unittest.expect(o, unittest.hasLength(2)); |
| 1542 checkEnum(o[0]); |
| 1543 checkEnum(o[1]); |
| 1544 } |
| 1545 |
| 1546 buildUnnamed1772() { |
| 1547 var o = new core.List<api.LogDescriptor>(); |
| 1548 o.add(buildLogDescriptor()); |
| 1549 o.add(buildLogDescriptor()); |
| 1550 return o; |
| 1551 } |
| 1552 |
| 1553 checkUnnamed1772(core.List<api.LogDescriptor> o) { |
| 1554 unittest.expect(o, unittest.hasLength(2)); |
| 1555 checkLogDescriptor(o[0]); |
| 1556 checkLogDescriptor(o[1]); |
| 1557 } |
| 1558 |
| 1559 buildUnnamed1773() { |
| 1560 var o = new core.List<api.MetricDescriptor>(); |
| 1561 o.add(buildMetricDescriptor()); |
| 1562 o.add(buildMetricDescriptor()); |
| 1563 return o; |
| 1564 } |
| 1565 |
| 1566 checkUnnamed1773(core.List<api.MetricDescriptor> o) { |
| 1567 unittest.expect(o, unittest.hasLength(2)); |
| 1568 checkMetricDescriptor(o[0]); |
| 1569 checkMetricDescriptor(o[1]); |
| 1570 } |
| 1571 |
| 1572 buildUnnamed1774() { |
| 1573 var o = new core.List<api.MonitoredResourceDescriptor>(); |
| 1574 o.add(buildMonitoredResourceDescriptor()); |
| 1575 o.add(buildMonitoredResourceDescriptor()); |
| 1576 return o; |
| 1577 } |
| 1578 |
| 1579 checkUnnamed1774(core.List<api.MonitoredResourceDescriptor> o) { |
| 1580 unittest.expect(o, unittest.hasLength(2)); |
| 1581 checkMonitoredResourceDescriptor(o[0]); |
| 1582 checkMonitoredResourceDescriptor(o[1]); |
| 1583 } |
| 1584 |
| 1585 buildUnnamed1775() { |
| 1586 var o = new core.List<api.Type>(); |
| 1587 o.add(buildType()); |
| 1588 o.add(buildType()); |
| 1589 return o; |
| 1590 } |
| 1591 |
| 1592 checkUnnamed1775(core.List<api.Type> o) { |
| 1593 unittest.expect(o, unittest.hasLength(2)); |
| 1594 checkType(o[0]); |
| 1595 checkType(o[1]); |
| 1596 } |
| 1597 |
| 1598 buildUnnamed1776() { |
| 1599 var o = new core.List<api.Type>(); |
| 1600 o.add(buildType()); |
| 1601 o.add(buildType()); |
| 1602 return o; |
| 1603 } |
| 1604 |
| 1605 checkUnnamed1776(core.List<api.Type> o) { |
| 1606 unittest.expect(o, unittest.hasLength(2)); |
| 1607 checkType(o[0]); |
| 1608 checkType(o[1]); |
| 1609 } |
| 1610 |
| 1611 core.int buildCounterService = 0; |
| 1612 buildService() { |
| 1613 var o = new api.Service(); |
| 1614 buildCounterService++; |
| 1615 if (buildCounterService < 3) { |
| 1616 o.apis = buildUnnamed1769(); |
| 1617 o.authentication = buildAuthentication(); |
| 1618 o.backend = buildBackend(); |
| 1619 o.configVersion = 42; |
| 1620 o.context = buildContext(); |
| 1621 o.control = buildControl(); |
| 1622 o.customError = buildCustomError(); |
| 1623 o.documentation = buildDocumentation(); |
| 1624 o.endpoints = buildUnnamed1770(); |
| 1625 o.enums = buildUnnamed1771(); |
| 1626 o.http = buildHttp(); |
| 1627 o.id = "foo"; |
| 1628 o.logging = buildLogging(); |
| 1629 o.logs = buildUnnamed1772(); |
| 1630 o.metrics = buildUnnamed1773(); |
| 1631 o.monitoredResources = buildUnnamed1774(); |
| 1632 o.monitoring = buildMonitoring(); |
| 1633 o.name = "foo"; |
| 1634 o.producerProjectId = "foo"; |
| 1635 o.systemParameters = buildSystemParameters(); |
| 1636 o.systemTypes = buildUnnamed1775(); |
| 1637 o.title = "foo"; |
| 1638 o.types = buildUnnamed1776(); |
| 1639 o.usage = buildUsage(); |
| 1640 o.visibility = buildVisibility(); |
| 1641 } |
| 1642 buildCounterService--; |
| 1643 return o; |
| 1644 } |
| 1645 |
| 1646 checkService(api.Service o) { |
| 1647 buildCounterService++; |
| 1648 if (buildCounterService < 3) { |
| 1649 checkUnnamed1769(o.apis); |
| 1650 checkAuthentication(o.authentication); |
| 1651 checkBackend(o.backend); |
| 1652 unittest.expect(o.configVersion, unittest.equals(42)); |
| 1653 checkContext(o.context); |
| 1654 checkControl(o.control); |
| 1655 checkCustomError(o.customError); |
| 1656 checkDocumentation(o.documentation); |
| 1657 checkUnnamed1770(o.endpoints); |
| 1658 checkUnnamed1771(o.enums); |
| 1659 checkHttp(o.http); |
| 1660 unittest.expect(o.id, unittest.equals('foo')); |
| 1661 checkLogging(o.logging); |
| 1662 checkUnnamed1772(o.logs); |
| 1663 checkUnnamed1773(o.metrics); |
| 1664 checkUnnamed1774(o.monitoredResources); |
| 1665 checkMonitoring(o.monitoring); |
| 1666 unittest.expect(o.name, unittest.equals('foo')); |
| 1667 unittest.expect(o.producerProjectId, unittest.equals('foo')); |
| 1668 checkSystemParameters(o.systemParameters); |
| 1669 checkUnnamed1775(o.systemTypes); |
| 1670 unittest.expect(o.title, unittest.equals('foo')); |
| 1671 checkUnnamed1776(o.types); |
| 1672 checkUsage(o.usage); |
| 1673 checkVisibility(o.visibility); |
| 1674 } |
| 1675 buildCounterService--; |
| 1676 } |
| 1677 |
| 1678 core.int buildCounterSourceContext = 0; |
| 1679 buildSourceContext() { |
| 1680 var o = new api.SourceContext(); |
| 1681 buildCounterSourceContext++; |
| 1682 if (buildCounterSourceContext < 3) { |
| 1683 o.fileName = "foo"; |
| 1684 } |
| 1685 buildCounterSourceContext--; |
| 1686 return o; |
| 1687 } |
| 1688 |
| 1689 checkSourceContext(api.SourceContext o) { |
| 1690 buildCounterSourceContext++; |
| 1691 if (buildCounterSourceContext < 3) { |
| 1692 unittest.expect(o.fileName, unittest.equals('foo')); |
| 1693 } |
| 1694 buildCounterSourceContext--; |
| 1695 } |
| 1696 |
| 1697 buildUnnamed1777() { |
| 1698 var o = new core.Map<core.String, core.Object>(); |
| 1699 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1700 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1701 return o; |
| 1702 } |
| 1703 |
| 1704 checkUnnamed1777(core.Map<core.String, core.Object> o) { |
| 1705 unittest.expect(o, unittest.hasLength(2)); |
| 1706 var casted7 = (o["x"]) as core.Map; unittest.expect(casted7, unittest.hasLengt
h(3)); unittest.expect(casted7["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted7["bool"], unittest.equals(true)); unittest.expect(casted7["string"],
unittest.equals('foo')); |
| 1707 var casted8 = (o["y"]) as core.Map; unittest.expect(casted8, unittest.hasLengt
h(3)); unittest.expect(casted8["list"], unittest.equals([1, 2, 3])); unittest.ex
pect(casted8["bool"], unittest.equals(true)); unittest.expect(casted8["string"],
unittest.equals('foo')); |
| 1708 } |
| 1709 |
| 1710 buildUnnamed1778() { |
| 1711 var o = new core.List<core.Map<core.String, core.Object>>(); |
| 1712 o.add(buildUnnamed1777()); |
| 1713 o.add(buildUnnamed1777()); |
| 1714 return o; |
| 1715 } |
| 1716 |
| 1717 checkUnnamed1778(core.List<core.Map<core.String, core.Object>> o) { |
| 1718 unittest.expect(o, unittest.hasLength(2)); |
| 1719 checkUnnamed1777(o[0]); |
| 1720 checkUnnamed1777(o[1]); |
| 1721 } |
| 1722 |
| 1723 core.int buildCounterStatus = 0; |
| 1724 buildStatus() { |
| 1725 var o = new api.Status(); |
| 1726 buildCounterStatus++; |
| 1727 if (buildCounterStatus < 3) { |
| 1728 o.code = 42; |
| 1729 o.details = buildUnnamed1778(); |
| 1730 o.message = "foo"; |
| 1731 } |
| 1732 buildCounterStatus--; |
| 1733 return o; |
| 1734 } |
| 1735 |
| 1736 checkStatus(api.Status o) { |
| 1737 buildCounterStatus++; |
| 1738 if (buildCounterStatus < 3) { |
| 1739 unittest.expect(o.code, unittest.equals(42)); |
| 1740 checkUnnamed1778(o.details); |
| 1741 unittest.expect(o.message, unittest.equals('foo')); |
| 1742 } |
| 1743 buildCounterStatus--; |
| 1744 } |
| 1745 |
| 1746 core.int buildCounterSystemParameter = 0; |
| 1747 buildSystemParameter() { |
| 1748 var o = new api.SystemParameter(); |
| 1749 buildCounterSystemParameter++; |
| 1750 if (buildCounterSystemParameter < 3) { |
| 1751 o.httpHeader = "foo"; |
| 1752 o.name = "foo"; |
| 1753 o.urlQueryParameter = "foo"; |
| 1754 } |
| 1755 buildCounterSystemParameter--; |
| 1756 return o; |
| 1757 } |
| 1758 |
| 1759 checkSystemParameter(api.SystemParameter o) { |
| 1760 buildCounterSystemParameter++; |
| 1761 if (buildCounterSystemParameter < 3) { |
| 1762 unittest.expect(o.httpHeader, unittest.equals('foo')); |
| 1763 unittest.expect(o.name, unittest.equals('foo')); |
| 1764 unittest.expect(o.urlQueryParameter, unittest.equals('foo')); |
| 1765 } |
| 1766 buildCounterSystemParameter--; |
| 1767 } |
| 1768 |
| 1769 buildUnnamed1779() { |
| 1770 var o = new core.List<api.SystemParameter>(); |
| 1771 o.add(buildSystemParameter()); |
| 1772 o.add(buildSystemParameter()); |
| 1773 return o; |
| 1774 } |
| 1775 |
| 1776 checkUnnamed1779(core.List<api.SystemParameter> o) { |
| 1777 unittest.expect(o, unittest.hasLength(2)); |
| 1778 checkSystemParameter(o[0]); |
| 1779 checkSystemParameter(o[1]); |
| 1780 } |
| 1781 |
| 1782 core.int buildCounterSystemParameterRule = 0; |
| 1783 buildSystemParameterRule() { |
| 1784 var o = new api.SystemParameterRule(); |
| 1785 buildCounterSystemParameterRule++; |
| 1786 if (buildCounterSystemParameterRule < 3) { |
| 1787 o.parameters = buildUnnamed1779(); |
| 1788 o.selector = "foo"; |
| 1789 } |
| 1790 buildCounterSystemParameterRule--; |
| 1791 return o; |
| 1792 } |
| 1793 |
| 1794 checkSystemParameterRule(api.SystemParameterRule o) { |
| 1795 buildCounterSystemParameterRule++; |
| 1796 if (buildCounterSystemParameterRule < 3) { |
| 1797 checkUnnamed1779(o.parameters); |
| 1798 unittest.expect(o.selector, unittest.equals('foo')); |
| 1799 } |
| 1800 buildCounterSystemParameterRule--; |
| 1801 } |
| 1802 |
| 1803 buildUnnamed1780() { |
| 1804 var o = new core.List<api.SystemParameterRule>(); |
| 1805 o.add(buildSystemParameterRule()); |
| 1806 o.add(buildSystemParameterRule()); |
| 1807 return o; |
| 1808 } |
| 1809 |
| 1810 checkUnnamed1780(core.List<api.SystemParameterRule> o) { |
| 1811 unittest.expect(o, unittest.hasLength(2)); |
| 1812 checkSystemParameterRule(o[0]); |
| 1813 checkSystemParameterRule(o[1]); |
| 1814 } |
| 1815 |
| 1816 core.int buildCounterSystemParameters = 0; |
| 1817 buildSystemParameters() { |
| 1818 var o = new api.SystemParameters(); |
| 1819 buildCounterSystemParameters++; |
| 1820 if (buildCounterSystemParameters < 3) { |
| 1821 o.rules = buildUnnamed1780(); |
| 1822 } |
| 1823 buildCounterSystemParameters--; |
| 1824 return o; |
| 1825 } |
| 1826 |
| 1827 checkSystemParameters(api.SystemParameters o) { |
| 1828 buildCounterSystemParameters++; |
| 1829 if (buildCounterSystemParameters < 3) { |
| 1830 checkUnnamed1780(o.rules); |
| 1831 } |
| 1832 buildCounterSystemParameters--; |
| 1833 } |
| 1834 |
| 1835 buildUnnamed1781() { |
| 1836 var o = new core.List<api.Field>(); |
| 1837 o.add(buildField()); |
| 1838 o.add(buildField()); |
| 1839 return o; |
| 1840 } |
| 1841 |
| 1842 checkUnnamed1781(core.List<api.Field> o) { |
| 1843 unittest.expect(o, unittest.hasLength(2)); |
| 1844 checkField(o[0]); |
| 1845 checkField(o[1]); |
| 1846 } |
| 1847 |
| 1848 buildUnnamed1782() { |
| 1849 var o = new core.List<core.String>(); |
| 1850 o.add("foo"); |
| 1851 o.add("foo"); |
| 1852 return o; |
| 1853 } |
| 1854 |
| 1855 checkUnnamed1782(core.List<core.String> o) { |
| 1856 unittest.expect(o, unittest.hasLength(2)); |
| 1857 unittest.expect(o[0], unittest.equals('foo')); |
| 1858 unittest.expect(o[1], unittest.equals('foo')); |
| 1859 } |
| 1860 |
| 1861 buildUnnamed1783() { |
| 1862 var o = new core.List<api.Option>(); |
| 1863 o.add(buildOption()); |
| 1864 o.add(buildOption()); |
| 1865 return o; |
| 1866 } |
| 1867 |
| 1868 checkUnnamed1783(core.List<api.Option> o) { |
| 1869 unittest.expect(o, unittest.hasLength(2)); |
| 1870 checkOption(o[0]); |
| 1871 checkOption(o[1]); |
| 1872 } |
| 1873 |
| 1874 core.int buildCounterType = 0; |
| 1875 buildType() { |
| 1876 var o = new api.Type(); |
| 1877 buildCounterType++; |
| 1878 if (buildCounterType < 3) { |
| 1879 o.fields = buildUnnamed1781(); |
| 1880 o.name = "foo"; |
| 1881 o.oneofs = buildUnnamed1782(); |
| 1882 o.options = buildUnnamed1783(); |
| 1883 o.sourceContext = buildSourceContext(); |
| 1884 o.syntax = "foo"; |
| 1885 } |
| 1886 buildCounterType--; |
| 1887 return o; |
| 1888 } |
| 1889 |
| 1890 checkType(api.Type o) { |
| 1891 buildCounterType++; |
| 1892 if (buildCounterType < 3) { |
| 1893 checkUnnamed1781(o.fields); |
| 1894 unittest.expect(o.name, unittest.equals('foo')); |
| 1895 checkUnnamed1782(o.oneofs); |
| 1896 checkUnnamed1783(o.options); |
| 1897 checkSourceContext(o.sourceContext); |
| 1898 unittest.expect(o.syntax, unittest.equals('foo')); |
| 1899 } |
| 1900 buildCounterType--; |
| 1901 } |
| 1902 |
| 1903 buildUnnamed1784() { |
| 1904 var o = new core.List<core.String>(); |
| 1905 o.add("foo"); |
| 1906 o.add("foo"); |
| 1907 return o; |
| 1908 } |
| 1909 |
| 1910 checkUnnamed1784(core.List<core.String> o) { |
| 1911 unittest.expect(o, unittest.hasLength(2)); |
| 1912 unittest.expect(o[0], unittest.equals('foo')); |
| 1913 unittest.expect(o[1], unittest.equals('foo')); |
| 1914 } |
| 1915 |
| 1916 buildUnnamed1785() { |
| 1917 var o = new core.List<api.UsageRule>(); |
| 1918 o.add(buildUsageRule()); |
| 1919 o.add(buildUsageRule()); |
| 1920 return o; |
| 1921 } |
| 1922 |
| 1923 checkUnnamed1785(core.List<api.UsageRule> o) { |
| 1924 unittest.expect(o, unittest.hasLength(2)); |
| 1925 checkUsageRule(o[0]); |
| 1926 checkUsageRule(o[1]); |
| 1927 } |
| 1928 |
| 1929 core.int buildCounterUsage = 0; |
| 1930 buildUsage() { |
| 1931 var o = new api.Usage(); |
| 1932 buildCounterUsage++; |
| 1933 if (buildCounterUsage < 3) { |
| 1934 o.producerNotificationChannel = "foo"; |
| 1935 o.requirements = buildUnnamed1784(); |
| 1936 o.rules = buildUnnamed1785(); |
| 1937 } |
| 1938 buildCounterUsage--; |
| 1939 return o; |
| 1940 } |
| 1941 |
| 1942 checkUsage(api.Usage o) { |
| 1943 buildCounterUsage++; |
| 1944 if (buildCounterUsage < 3) { |
| 1945 unittest.expect(o.producerNotificationChannel, unittest.equals('foo')); |
| 1946 checkUnnamed1784(o.requirements); |
| 1947 checkUnnamed1785(o.rules); |
| 1948 } |
| 1949 buildCounterUsage--; |
| 1950 } |
| 1951 |
| 1952 core.int buildCounterUsageRule = 0; |
| 1953 buildUsageRule() { |
| 1954 var o = new api.UsageRule(); |
| 1955 buildCounterUsageRule++; |
| 1956 if (buildCounterUsageRule < 3) { |
| 1957 o.allowUnregisteredCalls = true; |
| 1958 o.selector = "foo"; |
| 1959 } |
| 1960 buildCounterUsageRule--; |
| 1961 return o; |
| 1962 } |
| 1963 |
| 1964 checkUsageRule(api.UsageRule o) { |
| 1965 buildCounterUsageRule++; |
| 1966 if (buildCounterUsageRule < 3) { |
| 1967 unittest.expect(o.allowUnregisteredCalls, unittest.isTrue); |
| 1968 unittest.expect(o.selector, unittest.equals('foo')); |
| 1969 } |
| 1970 buildCounterUsageRule--; |
| 1971 } |
| 1972 |
| 1973 buildUnnamed1786() { |
| 1974 var o = new core.List<api.VisibilityRule>(); |
| 1975 o.add(buildVisibilityRule()); |
| 1976 o.add(buildVisibilityRule()); |
| 1977 return o; |
| 1978 } |
| 1979 |
| 1980 checkUnnamed1786(core.List<api.VisibilityRule> o) { |
| 1981 unittest.expect(o, unittest.hasLength(2)); |
| 1982 checkVisibilityRule(o[0]); |
| 1983 checkVisibilityRule(o[1]); |
| 1984 } |
| 1985 |
| 1986 core.int buildCounterVisibility = 0; |
| 1987 buildVisibility() { |
| 1988 var o = new api.Visibility(); |
| 1989 buildCounterVisibility++; |
| 1990 if (buildCounterVisibility < 3) { |
| 1991 o.rules = buildUnnamed1786(); |
| 1992 } |
| 1993 buildCounterVisibility--; |
| 1994 return o; |
| 1995 } |
| 1996 |
| 1997 checkVisibility(api.Visibility o) { |
| 1998 buildCounterVisibility++; |
| 1999 if (buildCounterVisibility < 3) { |
| 2000 checkUnnamed1786(o.rules); |
| 2001 } |
| 2002 buildCounterVisibility--; |
| 2003 } |
| 2004 |
| 2005 core.int buildCounterVisibilityRule = 0; |
| 2006 buildVisibilityRule() { |
| 2007 var o = new api.VisibilityRule(); |
| 2008 buildCounterVisibilityRule++; |
| 2009 if (buildCounterVisibilityRule < 3) { |
| 2010 o.restriction = "foo"; |
| 2011 o.selector = "foo"; |
| 2012 } |
| 2013 buildCounterVisibilityRule--; |
| 2014 return o; |
| 2015 } |
| 2016 |
| 2017 checkVisibilityRule(api.VisibilityRule o) { |
| 2018 buildCounterVisibilityRule++; |
| 2019 if (buildCounterVisibilityRule < 3) { |
| 2020 unittest.expect(o.restriction, unittest.equals('foo')); |
| 2021 unittest.expect(o.selector, unittest.equals('foo')); |
| 2022 } |
| 2023 buildCounterVisibilityRule--; |
| 2024 } |
| 2025 |
| 2026 |
| 2027 main() { |
| 2028 unittest.group("obj-schema-Api", () { |
| 2029 unittest.test("to-json--from-json", () { |
| 2030 var o = buildApi(); |
| 2031 var od = new api.Api.fromJson(o.toJson()); |
| 2032 checkApi(od); |
| 2033 }); |
| 2034 }); |
| 2035 |
| 2036 |
| 2037 unittest.group("obj-schema-AuthProvider", () { |
| 2038 unittest.test("to-json--from-json", () { |
| 2039 var o = buildAuthProvider(); |
| 2040 var od = new api.AuthProvider.fromJson(o.toJson()); |
| 2041 checkAuthProvider(od); |
| 2042 }); |
| 2043 }); |
| 2044 |
| 2045 |
| 2046 unittest.group("obj-schema-AuthRequirement", () { |
| 2047 unittest.test("to-json--from-json", () { |
| 2048 var o = buildAuthRequirement(); |
| 2049 var od = new api.AuthRequirement.fromJson(o.toJson()); |
| 2050 checkAuthRequirement(od); |
| 2051 }); |
| 2052 }); |
| 2053 |
| 2054 |
| 2055 unittest.group("obj-schema-Authentication", () { |
| 2056 unittest.test("to-json--from-json", () { |
| 2057 var o = buildAuthentication(); |
| 2058 var od = new api.Authentication.fromJson(o.toJson()); |
| 2059 checkAuthentication(od); |
| 2060 }); |
| 2061 }); |
| 2062 |
| 2063 |
| 2064 unittest.group("obj-schema-AuthenticationRule", () { |
| 2065 unittest.test("to-json--from-json", () { |
| 2066 var o = buildAuthenticationRule(); |
| 2067 var od = new api.AuthenticationRule.fromJson(o.toJson()); |
| 2068 checkAuthenticationRule(od); |
| 2069 }); |
| 2070 }); |
| 2071 |
| 2072 |
| 2073 unittest.group("obj-schema-Backend", () { |
| 2074 unittest.test("to-json--from-json", () { |
| 2075 var o = buildBackend(); |
| 2076 var od = new api.Backend.fromJson(o.toJson()); |
| 2077 checkBackend(od); |
| 2078 }); |
| 2079 }); |
| 2080 |
| 2081 |
| 2082 unittest.group("obj-schema-BackendRule", () { |
| 2083 unittest.test("to-json--from-json", () { |
| 2084 var o = buildBackendRule(); |
| 2085 var od = new api.BackendRule.fromJson(o.toJson()); |
| 2086 checkBackendRule(od); |
| 2087 }); |
| 2088 }); |
| 2089 |
| 2090 |
| 2091 unittest.group("obj-schema-Context", () { |
| 2092 unittest.test("to-json--from-json", () { |
| 2093 var o = buildContext(); |
| 2094 var od = new api.Context.fromJson(o.toJson()); |
| 2095 checkContext(od); |
| 2096 }); |
| 2097 }); |
| 2098 |
| 2099 |
| 2100 unittest.group("obj-schema-ContextRule", () { |
| 2101 unittest.test("to-json--from-json", () { |
| 2102 var o = buildContextRule(); |
| 2103 var od = new api.ContextRule.fromJson(o.toJson()); |
| 2104 checkContextRule(od); |
| 2105 }); |
| 2106 }); |
| 2107 |
| 2108 |
| 2109 unittest.group("obj-schema-Control", () { |
| 2110 unittest.test("to-json--from-json", () { |
| 2111 var o = buildControl(); |
| 2112 var od = new api.Control.fromJson(o.toJson()); |
| 2113 checkControl(od); |
| 2114 }); |
| 2115 }); |
| 2116 |
| 2117 |
| 2118 unittest.group("obj-schema-CustomError", () { |
| 2119 unittest.test("to-json--from-json", () { |
| 2120 var o = buildCustomError(); |
| 2121 var od = new api.CustomError.fromJson(o.toJson()); |
| 2122 checkCustomError(od); |
| 2123 }); |
| 2124 }); |
| 2125 |
| 2126 |
| 2127 unittest.group("obj-schema-CustomErrorRule", () { |
| 2128 unittest.test("to-json--from-json", () { |
| 2129 var o = buildCustomErrorRule(); |
| 2130 var od = new api.CustomErrorRule.fromJson(o.toJson()); |
| 2131 checkCustomErrorRule(od); |
| 2132 }); |
| 2133 }); |
| 2134 |
| 2135 |
| 2136 unittest.group("obj-schema-CustomHttpPattern", () { |
| 2137 unittest.test("to-json--from-json", () { |
| 2138 var o = buildCustomHttpPattern(); |
| 2139 var od = new api.CustomHttpPattern.fromJson(o.toJson()); |
| 2140 checkCustomHttpPattern(od); |
| 2141 }); |
| 2142 }); |
| 2143 |
| 2144 |
| 2145 unittest.group("obj-schema-DisableServiceRequest", () { |
| 2146 unittest.test("to-json--from-json", () { |
| 2147 var o = buildDisableServiceRequest(); |
| 2148 var od = new api.DisableServiceRequest.fromJson(o.toJson()); |
| 2149 checkDisableServiceRequest(od); |
| 2150 }); |
| 2151 }); |
| 2152 |
| 2153 |
| 2154 unittest.group("obj-schema-Documentation", () { |
| 2155 unittest.test("to-json--from-json", () { |
| 2156 var o = buildDocumentation(); |
| 2157 var od = new api.Documentation.fromJson(o.toJson()); |
| 2158 checkDocumentation(od); |
| 2159 }); |
| 2160 }); |
| 2161 |
| 2162 |
| 2163 unittest.group("obj-schema-DocumentationRule", () { |
| 2164 unittest.test("to-json--from-json", () { |
| 2165 var o = buildDocumentationRule(); |
| 2166 var od = new api.DocumentationRule.fromJson(o.toJson()); |
| 2167 checkDocumentationRule(od); |
| 2168 }); |
| 2169 }); |
| 2170 |
| 2171 |
| 2172 unittest.group("obj-schema-EnableServiceRequest", () { |
| 2173 unittest.test("to-json--from-json", () { |
| 2174 var o = buildEnableServiceRequest(); |
| 2175 var od = new api.EnableServiceRequest.fromJson(o.toJson()); |
| 2176 checkEnableServiceRequest(od); |
| 2177 }); |
| 2178 }); |
| 2179 |
| 2180 |
| 2181 unittest.group("obj-schema-EnabledService", () { |
| 2182 unittest.test("to-json--from-json", () { |
| 2183 var o = buildEnabledService(); |
| 2184 var od = new api.EnabledService.fromJson(o.toJson()); |
| 2185 checkEnabledService(od); |
| 2186 }); |
| 2187 }); |
| 2188 |
| 2189 |
| 2190 unittest.group("obj-schema-Endpoint", () { |
| 2191 unittest.test("to-json--from-json", () { |
| 2192 var o = buildEndpoint(); |
| 2193 var od = new api.Endpoint.fromJson(o.toJson()); |
| 2194 checkEndpoint(od); |
| 2195 }); |
| 2196 }); |
| 2197 |
| 2198 |
| 2199 unittest.group("obj-schema-Enum", () { |
| 2200 unittest.test("to-json--from-json", () { |
| 2201 var o = buildEnum(); |
| 2202 var od = new api.Enum.fromJson(o.toJson()); |
| 2203 checkEnum(od); |
| 2204 }); |
| 2205 }); |
| 2206 |
| 2207 |
| 2208 unittest.group("obj-schema-EnumValue", () { |
| 2209 unittest.test("to-json--from-json", () { |
| 2210 var o = buildEnumValue(); |
| 2211 var od = new api.EnumValue.fromJson(o.toJson()); |
| 2212 checkEnumValue(od); |
| 2213 }); |
| 2214 }); |
| 2215 |
| 2216 |
| 2217 unittest.group("obj-schema-Field", () { |
| 2218 unittest.test("to-json--from-json", () { |
| 2219 var o = buildField(); |
| 2220 var od = new api.Field.fromJson(o.toJson()); |
| 2221 checkField(od); |
| 2222 }); |
| 2223 }); |
| 2224 |
| 2225 |
| 2226 unittest.group("obj-schema-Http", () { |
| 2227 unittest.test("to-json--from-json", () { |
| 2228 var o = buildHttp(); |
| 2229 var od = new api.Http.fromJson(o.toJson()); |
| 2230 checkHttp(od); |
| 2231 }); |
| 2232 }); |
| 2233 |
| 2234 |
| 2235 unittest.group("obj-schema-HttpRule", () { |
| 2236 unittest.test("to-json--from-json", () { |
| 2237 var o = buildHttpRule(); |
| 2238 var od = new api.HttpRule.fromJson(o.toJson()); |
| 2239 checkHttpRule(od); |
| 2240 }); |
| 2241 }); |
| 2242 |
| 2243 |
| 2244 unittest.group("obj-schema-LabelDescriptor", () { |
| 2245 unittest.test("to-json--from-json", () { |
| 2246 var o = buildLabelDescriptor(); |
| 2247 var od = new api.LabelDescriptor.fromJson(o.toJson()); |
| 2248 checkLabelDescriptor(od); |
| 2249 }); |
| 2250 }); |
| 2251 |
| 2252 |
| 2253 unittest.group("obj-schema-ListEnabledServicesResponse", () { |
| 2254 unittest.test("to-json--from-json", () { |
| 2255 var o = buildListEnabledServicesResponse(); |
| 2256 var od = new api.ListEnabledServicesResponse.fromJson(o.toJson()); |
| 2257 checkListEnabledServicesResponse(od); |
| 2258 }); |
| 2259 }); |
| 2260 |
| 2261 |
| 2262 unittest.group("obj-schema-LogDescriptor", () { |
| 2263 unittest.test("to-json--from-json", () { |
| 2264 var o = buildLogDescriptor(); |
| 2265 var od = new api.LogDescriptor.fromJson(o.toJson()); |
| 2266 checkLogDescriptor(od); |
| 2267 }); |
| 2268 }); |
| 2269 |
| 2270 |
| 2271 unittest.group("obj-schema-Logging", () { |
| 2272 unittest.test("to-json--from-json", () { |
| 2273 var o = buildLogging(); |
| 2274 var od = new api.Logging.fromJson(o.toJson()); |
| 2275 checkLogging(od); |
| 2276 }); |
| 2277 }); |
| 2278 |
| 2279 |
| 2280 unittest.group("obj-schema-LoggingDestination", () { |
| 2281 unittest.test("to-json--from-json", () { |
| 2282 var o = buildLoggingDestination(); |
| 2283 var od = new api.LoggingDestination.fromJson(o.toJson()); |
| 2284 checkLoggingDestination(od); |
| 2285 }); |
| 2286 }); |
| 2287 |
| 2288 |
| 2289 unittest.group("obj-schema-MediaDownload", () { |
| 2290 unittest.test("to-json--from-json", () { |
| 2291 var o = buildMediaDownload(); |
| 2292 var od = new api.MediaDownload.fromJson(o.toJson()); |
| 2293 checkMediaDownload(od); |
| 2294 }); |
| 2295 }); |
| 2296 |
| 2297 |
| 2298 unittest.group("obj-schema-MediaUpload", () { |
| 2299 unittest.test("to-json--from-json", () { |
| 2300 var o = buildMediaUpload(); |
| 2301 var od = new api.MediaUpload.fromJson(o.toJson()); |
| 2302 checkMediaUpload(od); |
| 2303 }); |
| 2304 }); |
| 2305 |
| 2306 |
| 2307 unittest.group("obj-schema-Method", () { |
| 2308 unittest.test("to-json--from-json", () { |
| 2309 var o = buildMethod(); |
| 2310 var od = new api.Method.fromJson(o.toJson()); |
| 2311 checkMethod(od); |
| 2312 }); |
| 2313 }); |
| 2314 |
| 2315 |
| 2316 unittest.group("obj-schema-MetricDescriptor", () { |
| 2317 unittest.test("to-json--from-json", () { |
| 2318 var o = buildMetricDescriptor(); |
| 2319 var od = new api.MetricDescriptor.fromJson(o.toJson()); |
| 2320 checkMetricDescriptor(od); |
| 2321 }); |
| 2322 }); |
| 2323 |
| 2324 |
| 2325 unittest.group("obj-schema-Mixin", () { |
| 2326 unittest.test("to-json--from-json", () { |
| 2327 var o = buildMixin(); |
| 2328 var od = new api.Mixin.fromJson(o.toJson()); |
| 2329 checkMixin(od); |
| 2330 }); |
| 2331 }); |
| 2332 |
| 2333 |
| 2334 unittest.group("obj-schema-MonitoredResourceDescriptor", () { |
| 2335 unittest.test("to-json--from-json", () { |
| 2336 var o = buildMonitoredResourceDescriptor(); |
| 2337 var od = new api.MonitoredResourceDescriptor.fromJson(o.toJson()); |
| 2338 checkMonitoredResourceDescriptor(od); |
| 2339 }); |
| 2340 }); |
| 2341 |
| 2342 |
| 2343 unittest.group("obj-schema-Monitoring", () { |
| 2344 unittest.test("to-json--from-json", () { |
| 2345 var o = buildMonitoring(); |
| 2346 var od = new api.Monitoring.fromJson(o.toJson()); |
| 2347 checkMonitoring(od); |
| 2348 }); |
| 2349 }); |
| 2350 |
| 2351 |
| 2352 unittest.group("obj-schema-MonitoringDestination", () { |
| 2353 unittest.test("to-json--from-json", () { |
| 2354 var o = buildMonitoringDestination(); |
| 2355 var od = new api.MonitoringDestination.fromJson(o.toJson()); |
| 2356 checkMonitoringDestination(od); |
| 2357 }); |
| 2358 }); |
| 2359 |
| 2360 |
| 2361 unittest.group("obj-schema-OAuthRequirements", () { |
| 2362 unittest.test("to-json--from-json", () { |
| 2363 var o = buildOAuthRequirements(); |
| 2364 var od = new api.OAuthRequirements.fromJson(o.toJson()); |
| 2365 checkOAuthRequirements(od); |
| 2366 }); |
| 2367 }); |
| 2368 |
| 2369 |
| 2370 unittest.group("obj-schema-Operation", () { |
| 2371 unittest.test("to-json--from-json", () { |
| 2372 var o = buildOperation(); |
| 2373 var od = new api.Operation.fromJson(o.toJson()); |
| 2374 checkOperation(od); |
| 2375 }); |
| 2376 }); |
| 2377 |
| 2378 |
| 2379 unittest.group("obj-schema-Option", () { |
| 2380 unittest.test("to-json--from-json", () { |
| 2381 var o = buildOption(); |
| 2382 var od = new api.Option.fromJson(o.toJson()); |
| 2383 checkOption(od); |
| 2384 }); |
| 2385 }); |
| 2386 |
| 2387 |
| 2388 unittest.group("obj-schema-Page", () { |
| 2389 unittest.test("to-json--from-json", () { |
| 2390 var o = buildPage(); |
| 2391 var od = new api.Page.fromJson(o.toJson()); |
| 2392 checkPage(od); |
| 2393 }); |
| 2394 }); |
| 2395 |
| 2396 |
| 2397 unittest.group("obj-schema-Service", () { |
| 2398 unittest.test("to-json--from-json", () { |
| 2399 var o = buildService(); |
| 2400 var od = new api.Service.fromJson(o.toJson()); |
| 2401 checkService(od); |
| 2402 }); |
| 2403 }); |
| 2404 |
| 2405 |
| 2406 unittest.group("obj-schema-SourceContext", () { |
| 2407 unittest.test("to-json--from-json", () { |
| 2408 var o = buildSourceContext(); |
| 2409 var od = new api.SourceContext.fromJson(o.toJson()); |
| 2410 checkSourceContext(od); |
| 2411 }); |
| 2412 }); |
| 2413 |
| 2414 |
| 2415 unittest.group("obj-schema-Status", () { |
| 2416 unittest.test("to-json--from-json", () { |
| 2417 var o = buildStatus(); |
| 2418 var od = new api.Status.fromJson(o.toJson()); |
| 2419 checkStatus(od); |
| 2420 }); |
| 2421 }); |
| 2422 |
| 2423 |
| 2424 unittest.group("obj-schema-SystemParameter", () { |
| 2425 unittest.test("to-json--from-json", () { |
| 2426 var o = buildSystemParameter(); |
| 2427 var od = new api.SystemParameter.fromJson(o.toJson()); |
| 2428 checkSystemParameter(od); |
| 2429 }); |
| 2430 }); |
| 2431 |
| 2432 |
| 2433 unittest.group("obj-schema-SystemParameterRule", () { |
| 2434 unittest.test("to-json--from-json", () { |
| 2435 var o = buildSystemParameterRule(); |
| 2436 var od = new api.SystemParameterRule.fromJson(o.toJson()); |
| 2437 checkSystemParameterRule(od); |
| 2438 }); |
| 2439 }); |
| 2440 |
| 2441 |
| 2442 unittest.group("obj-schema-SystemParameters", () { |
| 2443 unittest.test("to-json--from-json", () { |
| 2444 var o = buildSystemParameters(); |
| 2445 var od = new api.SystemParameters.fromJson(o.toJson()); |
| 2446 checkSystemParameters(od); |
| 2447 }); |
| 2448 }); |
| 2449 |
| 2450 |
| 2451 unittest.group("obj-schema-Type", () { |
| 2452 unittest.test("to-json--from-json", () { |
| 2453 var o = buildType(); |
| 2454 var od = new api.Type.fromJson(o.toJson()); |
| 2455 checkType(od); |
| 2456 }); |
| 2457 }); |
| 2458 |
| 2459 |
| 2460 unittest.group("obj-schema-Usage", () { |
| 2461 unittest.test("to-json--from-json", () { |
| 2462 var o = buildUsage(); |
| 2463 var od = new api.Usage.fromJson(o.toJson()); |
| 2464 checkUsage(od); |
| 2465 }); |
| 2466 }); |
| 2467 |
| 2468 |
| 2469 unittest.group("obj-schema-UsageRule", () { |
| 2470 unittest.test("to-json--from-json", () { |
| 2471 var o = buildUsageRule(); |
| 2472 var od = new api.UsageRule.fromJson(o.toJson()); |
| 2473 checkUsageRule(od); |
| 2474 }); |
| 2475 }); |
| 2476 |
| 2477 |
| 2478 unittest.group("obj-schema-Visibility", () { |
| 2479 unittest.test("to-json--from-json", () { |
| 2480 var o = buildVisibility(); |
| 2481 var od = new api.Visibility.fromJson(o.toJson()); |
| 2482 checkVisibility(od); |
| 2483 }); |
| 2484 }); |
| 2485 |
| 2486 |
| 2487 unittest.group("obj-schema-VisibilityRule", () { |
| 2488 unittest.test("to-json--from-json", () { |
| 2489 var o = buildVisibilityRule(); |
| 2490 var od = new api.VisibilityRule.fromJson(o.toJson()); |
| 2491 checkVisibilityRule(od); |
| 2492 }); |
| 2493 }); |
| 2494 |
| 2495 |
| 2496 unittest.group("resource-ProjectsServicesResourceApi", () { |
| 2497 unittest.test("method--disable", () { |
| 2498 |
| 2499 var mock = new HttpServerMock(); |
| 2500 api.ProjectsServicesResourceApi res = new api.ServiceuserApi(mock).project
s.services; |
| 2501 var arg_request = buildDisableServiceRequest(); |
| 2502 var arg_name = "foo"; |
| 2503 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2504 var obj = new api.DisableServiceRequest.fromJson(json); |
| 2505 checkDisableServiceRequest(obj); |
| 2506 |
| 2507 var path = (req.url).path; |
| 2508 var pathOffset = 0; |
| 2509 var index; |
| 2510 var subPart; |
| 2511 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2512 pathOffset += 1; |
| 2513 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2514 pathOffset += 3; |
| 2515 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2516 |
| 2517 var query = (req.url).query; |
| 2518 var queryOffset = 0; |
| 2519 var queryMap = {}; |
| 2520 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2521 parseBool(n) { |
| 2522 if (n == "true") return true; |
| 2523 if (n == "false") return false; |
| 2524 if (n == null) return null; |
| 2525 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2526 } |
| 2527 if (query.length > 0) { |
| 2528 for (var part in query.split("&")) { |
| 2529 var keyvalue = part.split("="); |
| 2530 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2531 } |
| 2532 } |
| 2533 |
| 2534 |
| 2535 var h = { |
| 2536 "content-type" : "application/json; charset=utf-8", |
| 2537 }; |
| 2538 var resp = convert.JSON.encode(buildOperation()); |
| 2539 return new async.Future.value(stringResponse(200, h, resp)); |
| 2540 }), true); |
| 2541 res.disable(arg_request, arg_name).then(unittest.expectAsync(((api.Operati
on response) { |
| 2542 checkOperation(response); |
| 2543 }))); |
| 2544 }); |
| 2545 |
| 2546 unittest.test("method--enable", () { |
| 2547 |
| 2548 var mock = new HttpServerMock(); |
| 2549 api.ProjectsServicesResourceApi res = new api.ServiceuserApi(mock).project
s.services; |
| 2550 var arg_request = buildEnableServiceRequest(); |
| 2551 var arg_name = "foo"; |
| 2552 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2553 var obj = new api.EnableServiceRequest.fromJson(json); |
| 2554 checkEnableServiceRequest(obj); |
| 2555 |
| 2556 var path = (req.url).path; |
| 2557 var pathOffset = 0; |
| 2558 var index; |
| 2559 var subPart; |
| 2560 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2561 pathOffset += 1; |
| 2562 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2563 pathOffset += 3; |
| 2564 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2565 |
| 2566 var query = (req.url).query; |
| 2567 var queryOffset = 0; |
| 2568 var queryMap = {}; |
| 2569 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2570 parseBool(n) { |
| 2571 if (n == "true") return true; |
| 2572 if (n == "false") return false; |
| 2573 if (n == null) return null; |
| 2574 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2575 } |
| 2576 if (query.length > 0) { |
| 2577 for (var part in query.split("&")) { |
| 2578 var keyvalue = part.split("="); |
| 2579 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2580 } |
| 2581 } |
| 2582 |
| 2583 |
| 2584 var h = { |
| 2585 "content-type" : "application/json; charset=utf-8", |
| 2586 }; |
| 2587 var resp = convert.JSON.encode(buildOperation()); |
| 2588 return new async.Future.value(stringResponse(200, h, resp)); |
| 2589 }), true); |
| 2590 res.enable(arg_request, arg_name).then(unittest.expectAsync(((api.Operatio
n response) { |
| 2591 checkOperation(response); |
| 2592 }))); |
| 2593 }); |
| 2594 |
| 2595 unittest.test("method--list", () { |
| 2596 |
| 2597 var mock = new HttpServerMock(); |
| 2598 api.ProjectsServicesResourceApi res = new api.ServiceuserApi(mock).project
s.services; |
| 2599 var arg_parent = "foo"; |
| 2600 var arg_pageSize = 42; |
| 2601 var arg_pageToken = "foo"; |
| 2602 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2603 var path = (req.url).path; |
| 2604 var pathOffset = 0; |
| 2605 var index; |
| 2606 var subPart; |
| 2607 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2608 pathOffset += 1; |
| 2609 unittest.expect(path.substring(pathOffset, pathOffset + 3), unittest.equ
als("v1/")); |
| 2610 pathOffset += 3; |
| 2611 // NOTE: We cannot test reserved expansions due to the inability to reve
rse the operation; |
| 2612 |
| 2613 var query = (req.url).query; |
| 2614 var queryOffset = 0; |
| 2615 var queryMap = {}; |
| 2616 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2617 parseBool(n) { |
| 2618 if (n == "true") return true; |
| 2619 if (n == "false") return false; |
| 2620 if (n == null) return null; |
| 2621 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2622 } |
| 2623 if (query.length > 0) { |
| 2624 for (var part in query.split("&")) { |
| 2625 var keyvalue = part.split("="); |
| 2626 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2627 } |
| 2628 } |
| 2629 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2630 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2631 |
| 2632 |
| 2633 var h = { |
| 2634 "content-type" : "application/json; charset=utf-8", |
| 2635 }; |
| 2636 var resp = convert.JSON.encode(buildListEnabledServicesResponse()); |
| 2637 return new async.Future.value(stringResponse(200, h, resp)); |
| 2638 }), true); |
| 2639 res.list(arg_parent, pageSize: arg_pageSize, pageToken: arg_pageToken).the
n(unittest.expectAsync(((api.ListEnabledServicesResponse response) { |
| 2640 checkListEnabledServicesResponse(response); |
| 2641 }))); |
| 2642 }); |
| 2643 |
| 2644 }); |
| 2645 |
| 2646 |
| 2647 } |
| 2648 |
OLD | NEW |