OLD | NEW |
(Empty) | |
| 1 library googleapis_beta.appengine.v1beta.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_beta/appengine/v1beta.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 core.int buildCounterApiConfigHandler = 0; |
| 55 buildApiConfigHandler() { |
| 56 var o = new api.ApiConfigHandler(); |
| 57 buildCounterApiConfigHandler++; |
| 58 if (buildCounterApiConfigHandler < 3) { |
| 59 o.authFailAction = "foo"; |
| 60 o.login = "foo"; |
| 61 o.script = "foo"; |
| 62 o.securityLevel = "foo"; |
| 63 o.url = "foo"; |
| 64 } |
| 65 buildCounterApiConfigHandler--; |
| 66 return o; |
| 67 } |
| 68 |
| 69 checkApiConfigHandler(api.ApiConfigHandler o) { |
| 70 buildCounterApiConfigHandler++; |
| 71 if (buildCounterApiConfigHandler < 3) { |
| 72 unittest.expect(o.authFailAction, unittest.equals('foo')); |
| 73 unittest.expect(o.login, unittest.equals('foo')); |
| 74 unittest.expect(o.script, unittest.equals('foo')); |
| 75 unittest.expect(o.securityLevel, unittest.equals('foo')); |
| 76 unittest.expect(o.url, unittest.equals('foo')); |
| 77 } |
| 78 buildCounterApiConfigHandler--; |
| 79 } |
| 80 |
| 81 core.int buildCounterApiEndpointHandler = 0; |
| 82 buildApiEndpointHandler() { |
| 83 var o = new api.ApiEndpointHandler(); |
| 84 buildCounterApiEndpointHandler++; |
| 85 if (buildCounterApiEndpointHandler < 3) { |
| 86 o.scriptPath = "foo"; |
| 87 } |
| 88 buildCounterApiEndpointHandler--; |
| 89 return o; |
| 90 } |
| 91 |
| 92 checkApiEndpointHandler(api.ApiEndpointHandler o) { |
| 93 buildCounterApiEndpointHandler++; |
| 94 if (buildCounterApiEndpointHandler < 3) { |
| 95 unittest.expect(o.scriptPath, unittest.equals('foo')); |
| 96 } |
| 97 buildCounterApiEndpointHandler--; |
| 98 } |
| 99 |
| 100 buildUnnamed3519() { |
| 101 var o = new core.List<api.UrlDispatchRule>(); |
| 102 o.add(buildUrlDispatchRule()); |
| 103 o.add(buildUrlDispatchRule()); |
| 104 return o; |
| 105 } |
| 106 |
| 107 checkUnnamed3519(core.List<api.UrlDispatchRule> o) { |
| 108 unittest.expect(o, unittest.hasLength(2)); |
| 109 checkUrlDispatchRule(o[0]); |
| 110 checkUrlDispatchRule(o[1]); |
| 111 } |
| 112 |
| 113 core.int buildCounterApplication = 0; |
| 114 buildApplication() { |
| 115 var o = new api.Application(); |
| 116 buildCounterApplication++; |
| 117 if (buildCounterApplication < 3) { |
| 118 o.authDomain = "foo"; |
| 119 o.codeBucket = "foo"; |
| 120 o.defaultBucket = "foo"; |
| 121 o.defaultCookieExpiration = "foo"; |
| 122 o.defaultHostname = "foo"; |
| 123 o.dispatchRules = buildUnnamed3519(); |
| 124 o.iap = buildIdentityAwareProxy(); |
| 125 o.id = "foo"; |
| 126 o.locationId = "foo"; |
| 127 o.name = "foo"; |
| 128 } |
| 129 buildCounterApplication--; |
| 130 return o; |
| 131 } |
| 132 |
| 133 checkApplication(api.Application o) { |
| 134 buildCounterApplication++; |
| 135 if (buildCounterApplication < 3) { |
| 136 unittest.expect(o.authDomain, unittest.equals('foo')); |
| 137 unittest.expect(o.codeBucket, unittest.equals('foo')); |
| 138 unittest.expect(o.defaultBucket, unittest.equals('foo')); |
| 139 unittest.expect(o.defaultCookieExpiration, unittest.equals('foo')); |
| 140 unittest.expect(o.defaultHostname, unittest.equals('foo')); |
| 141 checkUnnamed3519(o.dispatchRules); |
| 142 checkIdentityAwareProxy(o.iap); |
| 143 unittest.expect(o.id, unittest.equals('foo')); |
| 144 unittest.expect(o.locationId, unittest.equals('foo')); |
| 145 unittest.expect(o.name, unittest.equals('foo')); |
| 146 } |
| 147 buildCounterApplication--; |
| 148 } |
| 149 |
| 150 core.int buildCounterAutomaticScaling = 0; |
| 151 buildAutomaticScaling() { |
| 152 var o = new api.AutomaticScaling(); |
| 153 buildCounterAutomaticScaling++; |
| 154 if (buildCounterAutomaticScaling < 3) { |
| 155 o.coolDownPeriod = "foo"; |
| 156 o.cpuUtilization = buildCpuUtilization(); |
| 157 o.diskUtilization = buildDiskUtilization(); |
| 158 o.maxConcurrentRequests = 42; |
| 159 o.maxIdleInstances = 42; |
| 160 o.maxPendingLatency = "foo"; |
| 161 o.maxTotalInstances = 42; |
| 162 o.minIdleInstances = 42; |
| 163 o.minPendingLatency = "foo"; |
| 164 o.minTotalInstances = 42; |
| 165 o.networkUtilization = buildNetworkUtilization(); |
| 166 o.requestUtilization = buildRequestUtilization(); |
| 167 } |
| 168 buildCounterAutomaticScaling--; |
| 169 return o; |
| 170 } |
| 171 |
| 172 checkAutomaticScaling(api.AutomaticScaling o) { |
| 173 buildCounterAutomaticScaling++; |
| 174 if (buildCounterAutomaticScaling < 3) { |
| 175 unittest.expect(o.coolDownPeriod, unittest.equals('foo')); |
| 176 checkCpuUtilization(o.cpuUtilization); |
| 177 checkDiskUtilization(o.diskUtilization); |
| 178 unittest.expect(o.maxConcurrentRequests, unittest.equals(42)); |
| 179 unittest.expect(o.maxIdleInstances, unittest.equals(42)); |
| 180 unittest.expect(o.maxPendingLatency, unittest.equals('foo')); |
| 181 unittest.expect(o.maxTotalInstances, unittest.equals(42)); |
| 182 unittest.expect(o.minIdleInstances, unittest.equals(42)); |
| 183 unittest.expect(o.minPendingLatency, unittest.equals('foo')); |
| 184 unittest.expect(o.minTotalInstances, unittest.equals(42)); |
| 185 checkNetworkUtilization(o.networkUtilization); |
| 186 checkRequestUtilization(o.requestUtilization); |
| 187 } |
| 188 buildCounterAutomaticScaling--; |
| 189 } |
| 190 |
| 191 core.int buildCounterBasicScaling = 0; |
| 192 buildBasicScaling() { |
| 193 var o = new api.BasicScaling(); |
| 194 buildCounterBasicScaling++; |
| 195 if (buildCounterBasicScaling < 3) { |
| 196 o.idleTimeout = "foo"; |
| 197 o.maxInstances = 42; |
| 198 } |
| 199 buildCounterBasicScaling--; |
| 200 return o; |
| 201 } |
| 202 |
| 203 checkBasicScaling(api.BasicScaling o) { |
| 204 buildCounterBasicScaling++; |
| 205 if (buildCounterBasicScaling < 3) { |
| 206 unittest.expect(o.idleTimeout, unittest.equals('foo')); |
| 207 unittest.expect(o.maxInstances, unittest.equals(42)); |
| 208 } |
| 209 buildCounterBasicScaling--; |
| 210 } |
| 211 |
| 212 core.int buildCounterContainerInfo = 0; |
| 213 buildContainerInfo() { |
| 214 var o = new api.ContainerInfo(); |
| 215 buildCounterContainerInfo++; |
| 216 if (buildCounterContainerInfo < 3) { |
| 217 o.image = "foo"; |
| 218 } |
| 219 buildCounterContainerInfo--; |
| 220 return o; |
| 221 } |
| 222 |
| 223 checkContainerInfo(api.ContainerInfo o) { |
| 224 buildCounterContainerInfo++; |
| 225 if (buildCounterContainerInfo < 3) { |
| 226 unittest.expect(o.image, unittest.equals('foo')); |
| 227 } |
| 228 buildCounterContainerInfo--; |
| 229 } |
| 230 |
| 231 core.int buildCounterCpuUtilization = 0; |
| 232 buildCpuUtilization() { |
| 233 var o = new api.CpuUtilization(); |
| 234 buildCounterCpuUtilization++; |
| 235 if (buildCounterCpuUtilization < 3) { |
| 236 o.aggregationWindowLength = "foo"; |
| 237 o.targetUtilization = 42.0; |
| 238 } |
| 239 buildCounterCpuUtilization--; |
| 240 return o; |
| 241 } |
| 242 |
| 243 checkCpuUtilization(api.CpuUtilization o) { |
| 244 buildCounterCpuUtilization++; |
| 245 if (buildCounterCpuUtilization < 3) { |
| 246 unittest.expect(o.aggregationWindowLength, unittest.equals('foo')); |
| 247 unittest.expect(o.targetUtilization, unittest.equals(42.0)); |
| 248 } |
| 249 buildCounterCpuUtilization--; |
| 250 } |
| 251 |
| 252 core.int buildCounterDebugInstanceRequest = 0; |
| 253 buildDebugInstanceRequest() { |
| 254 var o = new api.DebugInstanceRequest(); |
| 255 buildCounterDebugInstanceRequest++; |
| 256 if (buildCounterDebugInstanceRequest < 3) { |
| 257 o.sshKey = "foo"; |
| 258 } |
| 259 buildCounterDebugInstanceRequest--; |
| 260 return o; |
| 261 } |
| 262 |
| 263 checkDebugInstanceRequest(api.DebugInstanceRequest o) { |
| 264 buildCounterDebugInstanceRequest++; |
| 265 if (buildCounterDebugInstanceRequest < 3) { |
| 266 unittest.expect(o.sshKey, unittest.equals('foo')); |
| 267 } |
| 268 buildCounterDebugInstanceRequest--; |
| 269 } |
| 270 |
| 271 buildUnnamed3520() { |
| 272 var o = new core.Map<core.String, api.FileInfo>(); |
| 273 o["x"] = buildFileInfo(); |
| 274 o["y"] = buildFileInfo(); |
| 275 return o; |
| 276 } |
| 277 |
| 278 checkUnnamed3520(core.Map<core.String, api.FileInfo> o) { |
| 279 unittest.expect(o, unittest.hasLength(2)); |
| 280 checkFileInfo(o["x"]); |
| 281 checkFileInfo(o["y"]); |
| 282 } |
| 283 |
| 284 core.int buildCounterDeployment = 0; |
| 285 buildDeployment() { |
| 286 var o = new api.Deployment(); |
| 287 buildCounterDeployment++; |
| 288 if (buildCounterDeployment < 3) { |
| 289 o.container = buildContainerInfo(); |
| 290 o.files = buildUnnamed3520(); |
| 291 o.zip = buildZipInfo(); |
| 292 } |
| 293 buildCounterDeployment--; |
| 294 return o; |
| 295 } |
| 296 |
| 297 checkDeployment(api.Deployment o) { |
| 298 buildCounterDeployment++; |
| 299 if (buildCounterDeployment < 3) { |
| 300 checkContainerInfo(o.container); |
| 301 checkUnnamed3520(o.files); |
| 302 checkZipInfo(o.zip); |
| 303 } |
| 304 buildCounterDeployment--; |
| 305 } |
| 306 |
| 307 core.int buildCounterDiskUtilization = 0; |
| 308 buildDiskUtilization() { |
| 309 var o = new api.DiskUtilization(); |
| 310 buildCounterDiskUtilization++; |
| 311 if (buildCounterDiskUtilization < 3) { |
| 312 o.targetReadBytesPerSecond = 42; |
| 313 o.targetReadOpsPerSecond = 42; |
| 314 o.targetWriteBytesPerSecond = 42; |
| 315 o.targetWriteOpsPerSecond = 42; |
| 316 } |
| 317 buildCounterDiskUtilization--; |
| 318 return o; |
| 319 } |
| 320 |
| 321 checkDiskUtilization(api.DiskUtilization o) { |
| 322 buildCounterDiskUtilization++; |
| 323 if (buildCounterDiskUtilization < 3) { |
| 324 unittest.expect(o.targetReadBytesPerSecond, unittest.equals(42)); |
| 325 unittest.expect(o.targetReadOpsPerSecond, unittest.equals(42)); |
| 326 unittest.expect(o.targetWriteBytesPerSecond, unittest.equals(42)); |
| 327 unittest.expect(o.targetWriteOpsPerSecond, unittest.equals(42)); |
| 328 } |
| 329 buildCounterDiskUtilization--; |
| 330 } |
| 331 |
| 332 core.int buildCounterEndpointsApiService = 0; |
| 333 buildEndpointsApiService() { |
| 334 var o = new api.EndpointsApiService(); |
| 335 buildCounterEndpointsApiService++; |
| 336 if (buildCounterEndpointsApiService < 3) { |
| 337 o.configId = "foo"; |
| 338 o.name = "foo"; |
| 339 } |
| 340 buildCounterEndpointsApiService--; |
| 341 return o; |
| 342 } |
| 343 |
| 344 checkEndpointsApiService(api.EndpointsApiService o) { |
| 345 buildCounterEndpointsApiService++; |
| 346 if (buildCounterEndpointsApiService < 3) { |
| 347 unittest.expect(o.configId, unittest.equals('foo')); |
| 348 unittest.expect(o.name, unittest.equals('foo')); |
| 349 } |
| 350 buildCounterEndpointsApiService--; |
| 351 } |
| 352 |
| 353 core.int buildCounterErrorHandler = 0; |
| 354 buildErrorHandler() { |
| 355 var o = new api.ErrorHandler(); |
| 356 buildCounterErrorHandler++; |
| 357 if (buildCounterErrorHandler < 3) { |
| 358 o.errorCode = "foo"; |
| 359 o.mimeType = "foo"; |
| 360 o.staticFile = "foo"; |
| 361 } |
| 362 buildCounterErrorHandler--; |
| 363 return o; |
| 364 } |
| 365 |
| 366 checkErrorHandler(api.ErrorHandler o) { |
| 367 buildCounterErrorHandler++; |
| 368 if (buildCounterErrorHandler < 3) { |
| 369 unittest.expect(o.errorCode, unittest.equals('foo')); |
| 370 unittest.expect(o.mimeType, unittest.equals('foo')); |
| 371 unittest.expect(o.staticFile, unittest.equals('foo')); |
| 372 } |
| 373 buildCounterErrorHandler--; |
| 374 } |
| 375 |
| 376 core.int buildCounterFileInfo = 0; |
| 377 buildFileInfo() { |
| 378 var o = new api.FileInfo(); |
| 379 buildCounterFileInfo++; |
| 380 if (buildCounterFileInfo < 3) { |
| 381 o.mimeType = "foo"; |
| 382 o.sha1Sum = "foo"; |
| 383 o.sourceUrl = "foo"; |
| 384 } |
| 385 buildCounterFileInfo--; |
| 386 return o; |
| 387 } |
| 388 |
| 389 checkFileInfo(api.FileInfo o) { |
| 390 buildCounterFileInfo++; |
| 391 if (buildCounterFileInfo < 3) { |
| 392 unittest.expect(o.mimeType, unittest.equals('foo')); |
| 393 unittest.expect(o.sha1Sum, unittest.equals('foo')); |
| 394 unittest.expect(o.sourceUrl, unittest.equals('foo')); |
| 395 } |
| 396 buildCounterFileInfo--; |
| 397 } |
| 398 |
| 399 core.int buildCounterHealthCheck = 0; |
| 400 buildHealthCheck() { |
| 401 var o = new api.HealthCheck(); |
| 402 buildCounterHealthCheck++; |
| 403 if (buildCounterHealthCheck < 3) { |
| 404 o.checkInterval = "foo"; |
| 405 o.disableHealthCheck = true; |
| 406 o.healthyThreshold = 42; |
| 407 o.host = "foo"; |
| 408 o.restartThreshold = 42; |
| 409 o.timeout = "foo"; |
| 410 o.unhealthyThreshold = 42; |
| 411 } |
| 412 buildCounterHealthCheck--; |
| 413 return o; |
| 414 } |
| 415 |
| 416 checkHealthCheck(api.HealthCheck o) { |
| 417 buildCounterHealthCheck++; |
| 418 if (buildCounterHealthCheck < 3) { |
| 419 unittest.expect(o.checkInterval, unittest.equals('foo')); |
| 420 unittest.expect(o.disableHealthCheck, unittest.isTrue); |
| 421 unittest.expect(o.healthyThreshold, unittest.equals(42)); |
| 422 unittest.expect(o.host, unittest.equals('foo')); |
| 423 unittest.expect(o.restartThreshold, unittest.equals(42)); |
| 424 unittest.expect(o.timeout, unittest.equals('foo')); |
| 425 unittest.expect(o.unhealthyThreshold, unittest.equals(42)); |
| 426 } |
| 427 buildCounterHealthCheck--; |
| 428 } |
| 429 |
| 430 core.int buildCounterIdentityAwareProxy = 0; |
| 431 buildIdentityAwareProxy() { |
| 432 var o = new api.IdentityAwareProxy(); |
| 433 buildCounterIdentityAwareProxy++; |
| 434 if (buildCounterIdentityAwareProxy < 3) { |
| 435 o.enabled = true; |
| 436 o.oauth2ClientId = "foo"; |
| 437 o.oauth2ClientSecret = "foo"; |
| 438 o.oauth2ClientSecretSha256 = "foo"; |
| 439 } |
| 440 buildCounterIdentityAwareProxy--; |
| 441 return o; |
| 442 } |
| 443 |
| 444 checkIdentityAwareProxy(api.IdentityAwareProxy o) { |
| 445 buildCounterIdentityAwareProxy++; |
| 446 if (buildCounterIdentityAwareProxy < 3) { |
| 447 unittest.expect(o.enabled, unittest.isTrue); |
| 448 unittest.expect(o.oauth2ClientId, unittest.equals('foo')); |
| 449 unittest.expect(o.oauth2ClientSecret, unittest.equals('foo')); |
| 450 unittest.expect(o.oauth2ClientSecretSha256, unittest.equals('foo')); |
| 451 } |
| 452 buildCounterIdentityAwareProxy--; |
| 453 } |
| 454 |
| 455 core.int buildCounterInstance = 0; |
| 456 buildInstance() { |
| 457 var o = new api.Instance(); |
| 458 buildCounterInstance++; |
| 459 if (buildCounterInstance < 3) { |
| 460 o.appEngineRelease = "foo"; |
| 461 o.availability = "foo"; |
| 462 o.averageLatency = 42; |
| 463 o.errors = 42; |
| 464 o.id = "foo"; |
| 465 o.memoryUsage = "foo"; |
| 466 o.name = "foo"; |
| 467 o.qps = 42.0; |
| 468 o.requests = 42; |
| 469 o.startTime = "foo"; |
| 470 o.vmDebugEnabled = true; |
| 471 o.vmId = "foo"; |
| 472 o.vmIp = "foo"; |
| 473 o.vmName = "foo"; |
| 474 o.vmStatus = "foo"; |
| 475 o.vmZoneName = "foo"; |
| 476 } |
| 477 buildCounterInstance--; |
| 478 return o; |
| 479 } |
| 480 |
| 481 checkInstance(api.Instance o) { |
| 482 buildCounterInstance++; |
| 483 if (buildCounterInstance < 3) { |
| 484 unittest.expect(o.appEngineRelease, unittest.equals('foo')); |
| 485 unittest.expect(o.availability, unittest.equals('foo')); |
| 486 unittest.expect(o.averageLatency, unittest.equals(42)); |
| 487 unittest.expect(o.errors, unittest.equals(42)); |
| 488 unittest.expect(o.id, unittest.equals('foo')); |
| 489 unittest.expect(o.memoryUsage, unittest.equals('foo')); |
| 490 unittest.expect(o.name, unittest.equals('foo')); |
| 491 unittest.expect(o.qps, unittest.equals(42.0)); |
| 492 unittest.expect(o.requests, unittest.equals(42)); |
| 493 unittest.expect(o.startTime, unittest.equals('foo')); |
| 494 unittest.expect(o.vmDebugEnabled, unittest.isTrue); |
| 495 unittest.expect(o.vmId, unittest.equals('foo')); |
| 496 unittest.expect(o.vmIp, unittest.equals('foo')); |
| 497 unittest.expect(o.vmName, unittest.equals('foo')); |
| 498 unittest.expect(o.vmStatus, unittest.equals('foo')); |
| 499 unittest.expect(o.vmZoneName, unittest.equals('foo')); |
| 500 } |
| 501 buildCounterInstance--; |
| 502 } |
| 503 |
| 504 core.int buildCounterLibrary = 0; |
| 505 buildLibrary() { |
| 506 var o = new api.Library(); |
| 507 buildCounterLibrary++; |
| 508 if (buildCounterLibrary < 3) { |
| 509 o.name = "foo"; |
| 510 o.version = "foo"; |
| 511 } |
| 512 buildCounterLibrary--; |
| 513 return o; |
| 514 } |
| 515 |
| 516 checkLibrary(api.Library o) { |
| 517 buildCounterLibrary++; |
| 518 if (buildCounterLibrary < 3) { |
| 519 unittest.expect(o.name, unittest.equals('foo')); |
| 520 unittest.expect(o.version, unittest.equals('foo')); |
| 521 } |
| 522 buildCounterLibrary--; |
| 523 } |
| 524 |
| 525 buildUnnamed3521() { |
| 526 var o = new core.List<api.Instance>(); |
| 527 o.add(buildInstance()); |
| 528 o.add(buildInstance()); |
| 529 return o; |
| 530 } |
| 531 |
| 532 checkUnnamed3521(core.List<api.Instance> o) { |
| 533 unittest.expect(o, unittest.hasLength(2)); |
| 534 checkInstance(o[0]); |
| 535 checkInstance(o[1]); |
| 536 } |
| 537 |
| 538 core.int buildCounterListInstancesResponse = 0; |
| 539 buildListInstancesResponse() { |
| 540 var o = new api.ListInstancesResponse(); |
| 541 buildCounterListInstancesResponse++; |
| 542 if (buildCounterListInstancesResponse < 3) { |
| 543 o.instances = buildUnnamed3521(); |
| 544 o.nextPageToken = "foo"; |
| 545 } |
| 546 buildCounterListInstancesResponse--; |
| 547 return o; |
| 548 } |
| 549 |
| 550 checkListInstancesResponse(api.ListInstancesResponse o) { |
| 551 buildCounterListInstancesResponse++; |
| 552 if (buildCounterListInstancesResponse < 3) { |
| 553 checkUnnamed3521(o.instances); |
| 554 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 555 } |
| 556 buildCounterListInstancesResponse--; |
| 557 } |
| 558 |
| 559 buildUnnamed3522() { |
| 560 var o = new core.List<api.Location>(); |
| 561 o.add(buildLocation()); |
| 562 o.add(buildLocation()); |
| 563 return o; |
| 564 } |
| 565 |
| 566 checkUnnamed3522(core.List<api.Location> o) { |
| 567 unittest.expect(o, unittest.hasLength(2)); |
| 568 checkLocation(o[0]); |
| 569 checkLocation(o[1]); |
| 570 } |
| 571 |
| 572 core.int buildCounterListLocationsResponse = 0; |
| 573 buildListLocationsResponse() { |
| 574 var o = new api.ListLocationsResponse(); |
| 575 buildCounterListLocationsResponse++; |
| 576 if (buildCounterListLocationsResponse < 3) { |
| 577 o.locations = buildUnnamed3522(); |
| 578 o.nextPageToken = "foo"; |
| 579 } |
| 580 buildCounterListLocationsResponse--; |
| 581 return o; |
| 582 } |
| 583 |
| 584 checkListLocationsResponse(api.ListLocationsResponse o) { |
| 585 buildCounterListLocationsResponse++; |
| 586 if (buildCounterListLocationsResponse < 3) { |
| 587 checkUnnamed3522(o.locations); |
| 588 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 589 } |
| 590 buildCounterListLocationsResponse--; |
| 591 } |
| 592 |
| 593 buildUnnamed3523() { |
| 594 var o = new core.List<api.Operation>(); |
| 595 o.add(buildOperation()); |
| 596 o.add(buildOperation()); |
| 597 return o; |
| 598 } |
| 599 |
| 600 checkUnnamed3523(core.List<api.Operation> o) { |
| 601 unittest.expect(o, unittest.hasLength(2)); |
| 602 checkOperation(o[0]); |
| 603 checkOperation(o[1]); |
| 604 } |
| 605 |
| 606 core.int buildCounterListOperationsResponse = 0; |
| 607 buildListOperationsResponse() { |
| 608 var o = new api.ListOperationsResponse(); |
| 609 buildCounterListOperationsResponse++; |
| 610 if (buildCounterListOperationsResponse < 3) { |
| 611 o.nextPageToken = "foo"; |
| 612 o.operations = buildUnnamed3523(); |
| 613 } |
| 614 buildCounterListOperationsResponse--; |
| 615 return o; |
| 616 } |
| 617 |
| 618 checkListOperationsResponse(api.ListOperationsResponse o) { |
| 619 buildCounterListOperationsResponse++; |
| 620 if (buildCounterListOperationsResponse < 3) { |
| 621 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 622 checkUnnamed3523(o.operations); |
| 623 } |
| 624 buildCounterListOperationsResponse--; |
| 625 } |
| 626 |
| 627 buildUnnamed3524() { |
| 628 var o = new core.List<api.Service>(); |
| 629 o.add(buildService()); |
| 630 o.add(buildService()); |
| 631 return o; |
| 632 } |
| 633 |
| 634 checkUnnamed3524(core.List<api.Service> o) { |
| 635 unittest.expect(o, unittest.hasLength(2)); |
| 636 checkService(o[0]); |
| 637 checkService(o[1]); |
| 638 } |
| 639 |
| 640 core.int buildCounterListServicesResponse = 0; |
| 641 buildListServicesResponse() { |
| 642 var o = new api.ListServicesResponse(); |
| 643 buildCounterListServicesResponse++; |
| 644 if (buildCounterListServicesResponse < 3) { |
| 645 o.nextPageToken = "foo"; |
| 646 o.services = buildUnnamed3524(); |
| 647 } |
| 648 buildCounterListServicesResponse--; |
| 649 return o; |
| 650 } |
| 651 |
| 652 checkListServicesResponse(api.ListServicesResponse o) { |
| 653 buildCounterListServicesResponse++; |
| 654 if (buildCounterListServicesResponse < 3) { |
| 655 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 656 checkUnnamed3524(o.services); |
| 657 } |
| 658 buildCounterListServicesResponse--; |
| 659 } |
| 660 |
| 661 buildUnnamed3525() { |
| 662 var o = new core.List<api.Version>(); |
| 663 o.add(buildVersion()); |
| 664 o.add(buildVersion()); |
| 665 return o; |
| 666 } |
| 667 |
| 668 checkUnnamed3525(core.List<api.Version> o) { |
| 669 unittest.expect(o, unittest.hasLength(2)); |
| 670 checkVersion(o[0]); |
| 671 checkVersion(o[1]); |
| 672 } |
| 673 |
| 674 core.int buildCounterListVersionsResponse = 0; |
| 675 buildListVersionsResponse() { |
| 676 var o = new api.ListVersionsResponse(); |
| 677 buildCounterListVersionsResponse++; |
| 678 if (buildCounterListVersionsResponse < 3) { |
| 679 o.nextPageToken = "foo"; |
| 680 o.versions = buildUnnamed3525(); |
| 681 } |
| 682 buildCounterListVersionsResponse--; |
| 683 return o; |
| 684 } |
| 685 |
| 686 checkListVersionsResponse(api.ListVersionsResponse o) { |
| 687 buildCounterListVersionsResponse++; |
| 688 if (buildCounterListVersionsResponse < 3) { |
| 689 unittest.expect(o.nextPageToken, unittest.equals('foo')); |
| 690 checkUnnamed3525(o.versions); |
| 691 } |
| 692 buildCounterListVersionsResponse--; |
| 693 } |
| 694 |
| 695 core.int buildCounterLivenessCheck = 0; |
| 696 buildLivenessCheck() { |
| 697 var o = new api.LivenessCheck(); |
| 698 buildCounterLivenessCheck++; |
| 699 if (buildCounterLivenessCheck < 3) { |
| 700 o.checkInterval = "foo"; |
| 701 o.healthyThreshold = 42; |
| 702 o.host = "foo"; |
| 703 o.initialDelay = "foo"; |
| 704 o.path = "foo"; |
| 705 o.timeout = "foo"; |
| 706 o.unhealthyThreshold = 42; |
| 707 } |
| 708 buildCounterLivenessCheck--; |
| 709 return o; |
| 710 } |
| 711 |
| 712 checkLivenessCheck(api.LivenessCheck o) { |
| 713 buildCounterLivenessCheck++; |
| 714 if (buildCounterLivenessCheck < 3) { |
| 715 unittest.expect(o.checkInterval, unittest.equals('foo')); |
| 716 unittest.expect(o.healthyThreshold, unittest.equals(42)); |
| 717 unittest.expect(o.host, unittest.equals('foo')); |
| 718 unittest.expect(o.initialDelay, unittest.equals('foo')); |
| 719 unittest.expect(o.path, unittest.equals('foo')); |
| 720 unittest.expect(o.timeout, unittest.equals('foo')); |
| 721 unittest.expect(o.unhealthyThreshold, unittest.equals(42)); |
| 722 } |
| 723 buildCounterLivenessCheck--; |
| 724 } |
| 725 |
| 726 buildUnnamed3526() { |
| 727 var o = new core.Map<core.String, core.String>(); |
| 728 o["x"] = "foo"; |
| 729 o["y"] = "foo"; |
| 730 return o; |
| 731 } |
| 732 |
| 733 checkUnnamed3526(core.Map<core.String, core.String> o) { |
| 734 unittest.expect(o, unittest.hasLength(2)); |
| 735 unittest.expect(o["x"], unittest.equals('foo')); |
| 736 unittest.expect(o["y"], unittest.equals('foo')); |
| 737 } |
| 738 |
| 739 buildUnnamed3527() { |
| 740 var o = new core.Map<core.String, core.Object>(); |
| 741 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 742 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 743 return o; |
| 744 } |
| 745 |
| 746 checkUnnamed3527(core.Map<core.String, core.Object> o) { |
| 747 unittest.expect(o, unittest.hasLength(2)); |
| 748 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')); |
| 749 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')); |
| 750 } |
| 751 |
| 752 core.int buildCounterLocation = 0; |
| 753 buildLocation() { |
| 754 var o = new api.Location(); |
| 755 buildCounterLocation++; |
| 756 if (buildCounterLocation < 3) { |
| 757 o.labels = buildUnnamed3526(); |
| 758 o.locationId = "foo"; |
| 759 o.metadata = buildUnnamed3527(); |
| 760 o.name = "foo"; |
| 761 } |
| 762 buildCounterLocation--; |
| 763 return o; |
| 764 } |
| 765 |
| 766 checkLocation(api.Location o) { |
| 767 buildCounterLocation++; |
| 768 if (buildCounterLocation < 3) { |
| 769 checkUnnamed3526(o.labels); |
| 770 unittest.expect(o.locationId, unittest.equals('foo')); |
| 771 checkUnnamed3527(o.metadata); |
| 772 unittest.expect(o.name, unittest.equals('foo')); |
| 773 } |
| 774 buildCounterLocation--; |
| 775 } |
| 776 |
| 777 core.int buildCounterLocationMetadata = 0; |
| 778 buildLocationMetadata() { |
| 779 var o = new api.LocationMetadata(); |
| 780 buildCounterLocationMetadata++; |
| 781 if (buildCounterLocationMetadata < 3) { |
| 782 o.flexibleEnvironmentAvailable = true; |
| 783 o.standardEnvironmentAvailable = true; |
| 784 } |
| 785 buildCounterLocationMetadata--; |
| 786 return o; |
| 787 } |
| 788 |
| 789 checkLocationMetadata(api.LocationMetadata o) { |
| 790 buildCounterLocationMetadata++; |
| 791 if (buildCounterLocationMetadata < 3) { |
| 792 unittest.expect(o.flexibleEnvironmentAvailable, unittest.isTrue); |
| 793 unittest.expect(o.standardEnvironmentAvailable, unittest.isTrue); |
| 794 } |
| 795 buildCounterLocationMetadata--; |
| 796 } |
| 797 |
| 798 core.int buildCounterManualScaling = 0; |
| 799 buildManualScaling() { |
| 800 var o = new api.ManualScaling(); |
| 801 buildCounterManualScaling++; |
| 802 if (buildCounterManualScaling < 3) { |
| 803 o.instances = 42; |
| 804 } |
| 805 buildCounterManualScaling--; |
| 806 return o; |
| 807 } |
| 808 |
| 809 checkManualScaling(api.ManualScaling o) { |
| 810 buildCounterManualScaling++; |
| 811 if (buildCounterManualScaling < 3) { |
| 812 unittest.expect(o.instances, unittest.equals(42)); |
| 813 } |
| 814 buildCounterManualScaling--; |
| 815 } |
| 816 |
| 817 buildUnnamed3528() { |
| 818 var o = new core.List<core.String>(); |
| 819 o.add("foo"); |
| 820 o.add("foo"); |
| 821 return o; |
| 822 } |
| 823 |
| 824 checkUnnamed3528(core.List<core.String> o) { |
| 825 unittest.expect(o, unittest.hasLength(2)); |
| 826 unittest.expect(o[0], unittest.equals('foo')); |
| 827 unittest.expect(o[1], unittest.equals('foo')); |
| 828 } |
| 829 |
| 830 core.int buildCounterNetwork = 0; |
| 831 buildNetwork() { |
| 832 var o = new api.Network(); |
| 833 buildCounterNetwork++; |
| 834 if (buildCounterNetwork < 3) { |
| 835 o.forwardedPorts = buildUnnamed3528(); |
| 836 o.instanceTag = "foo"; |
| 837 o.name = "foo"; |
| 838 o.subnetworkName = "foo"; |
| 839 } |
| 840 buildCounterNetwork--; |
| 841 return o; |
| 842 } |
| 843 |
| 844 checkNetwork(api.Network o) { |
| 845 buildCounterNetwork++; |
| 846 if (buildCounterNetwork < 3) { |
| 847 checkUnnamed3528(o.forwardedPorts); |
| 848 unittest.expect(o.instanceTag, unittest.equals('foo')); |
| 849 unittest.expect(o.name, unittest.equals('foo')); |
| 850 unittest.expect(o.subnetworkName, unittest.equals('foo')); |
| 851 } |
| 852 buildCounterNetwork--; |
| 853 } |
| 854 |
| 855 core.int buildCounterNetworkUtilization = 0; |
| 856 buildNetworkUtilization() { |
| 857 var o = new api.NetworkUtilization(); |
| 858 buildCounterNetworkUtilization++; |
| 859 if (buildCounterNetworkUtilization < 3) { |
| 860 o.targetReceivedBytesPerSecond = 42; |
| 861 o.targetReceivedPacketsPerSecond = 42; |
| 862 o.targetSentBytesPerSecond = 42; |
| 863 o.targetSentPacketsPerSecond = 42; |
| 864 } |
| 865 buildCounterNetworkUtilization--; |
| 866 return o; |
| 867 } |
| 868 |
| 869 checkNetworkUtilization(api.NetworkUtilization o) { |
| 870 buildCounterNetworkUtilization++; |
| 871 if (buildCounterNetworkUtilization < 3) { |
| 872 unittest.expect(o.targetReceivedBytesPerSecond, unittest.equals(42)); |
| 873 unittest.expect(o.targetReceivedPacketsPerSecond, unittest.equals(42)); |
| 874 unittest.expect(o.targetSentBytesPerSecond, unittest.equals(42)); |
| 875 unittest.expect(o.targetSentPacketsPerSecond, unittest.equals(42)); |
| 876 } |
| 877 buildCounterNetworkUtilization--; |
| 878 } |
| 879 |
| 880 buildUnnamed3529() { |
| 881 var o = new core.Map<core.String, core.Object>(); |
| 882 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 883 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 884 return o; |
| 885 } |
| 886 |
| 887 checkUnnamed3529(core.Map<core.String, core.Object> o) { |
| 888 unittest.expect(o, unittest.hasLength(2)); |
| 889 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')); |
| 890 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')); |
| 891 } |
| 892 |
| 893 buildUnnamed3530() { |
| 894 var o = new core.Map<core.String, core.Object>(); |
| 895 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 896 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 897 return o; |
| 898 } |
| 899 |
| 900 checkUnnamed3530(core.Map<core.String, core.Object> o) { |
| 901 unittest.expect(o, unittest.hasLength(2)); |
| 902 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')); |
| 903 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')); |
| 904 } |
| 905 |
| 906 core.int buildCounterOperation = 0; |
| 907 buildOperation() { |
| 908 var o = new api.Operation(); |
| 909 buildCounterOperation++; |
| 910 if (buildCounterOperation < 3) { |
| 911 o.done = true; |
| 912 o.error = buildStatus(); |
| 913 o.metadata = buildUnnamed3529(); |
| 914 o.name = "foo"; |
| 915 o.response = buildUnnamed3530(); |
| 916 } |
| 917 buildCounterOperation--; |
| 918 return o; |
| 919 } |
| 920 |
| 921 checkOperation(api.Operation o) { |
| 922 buildCounterOperation++; |
| 923 if (buildCounterOperation < 3) { |
| 924 unittest.expect(o.done, unittest.isTrue); |
| 925 checkStatus(o.error); |
| 926 checkUnnamed3529(o.metadata); |
| 927 unittest.expect(o.name, unittest.equals('foo')); |
| 928 checkUnnamed3530(o.response); |
| 929 } |
| 930 buildCounterOperation--; |
| 931 } |
| 932 |
| 933 core.int buildCounterOperationMetadata = 0; |
| 934 buildOperationMetadata() { |
| 935 var o = new api.OperationMetadata(); |
| 936 buildCounterOperationMetadata++; |
| 937 if (buildCounterOperationMetadata < 3) { |
| 938 o.endTime = "foo"; |
| 939 o.insertTime = "foo"; |
| 940 o.method = "foo"; |
| 941 o.operationType = "foo"; |
| 942 o.target = "foo"; |
| 943 o.user = "foo"; |
| 944 } |
| 945 buildCounterOperationMetadata--; |
| 946 return o; |
| 947 } |
| 948 |
| 949 checkOperationMetadata(api.OperationMetadata o) { |
| 950 buildCounterOperationMetadata++; |
| 951 if (buildCounterOperationMetadata < 3) { |
| 952 unittest.expect(o.endTime, unittest.equals('foo')); |
| 953 unittest.expect(o.insertTime, unittest.equals('foo')); |
| 954 unittest.expect(o.method, unittest.equals('foo')); |
| 955 unittest.expect(o.operationType, unittest.equals('foo')); |
| 956 unittest.expect(o.target, unittest.equals('foo')); |
| 957 unittest.expect(o.user, unittest.equals('foo')); |
| 958 } |
| 959 buildCounterOperationMetadata--; |
| 960 } |
| 961 |
| 962 core.int buildCounterOperationMetadataExperimental = 0; |
| 963 buildOperationMetadataExperimental() { |
| 964 var o = new api.OperationMetadataExperimental(); |
| 965 buildCounterOperationMetadataExperimental++; |
| 966 if (buildCounterOperationMetadataExperimental < 3) { |
| 967 o.endTime = "foo"; |
| 968 o.insertTime = "foo"; |
| 969 o.method = "foo"; |
| 970 o.target = "foo"; |
| 971 o.user = "foo"; |
| 972 } |
| 973 buildCounterOperationMetadataExperimental--; |
| 974 return o; |
| 975 } |
| 976 |
| 977 checkOperationMetadataExperimental(api.OperationMetadataExperimental o) { |
| 978 buildCounterOperationMetadataExperimental++; |
| 979 if (buildCounterOperationMetadataExperimental < 3) { |
| 980 unittest.expect(o.endTime, unittest.equals('foo')); |
| 981 unittest.expect(o.insertTime, unittest.equals('foo')); |
| 982 unittest.expect(o.method, unittest.equals('foo')); |
| 983 unittest.expect(o.target, unittest.equals('foo')); |
| 984 unittest.expect(o.user, unittest.equals('foo')); |
| 985 } |
| 986 buildCounterOperationMetadataExperimental--; |
| 987 } |
| 988 |
| 989 buildUnnamed3531() { |
| 990 var o = new core.List<core.String>(); |
| 991 o.add("foo"); |
| 992 o.add("foo"); |
| 993 return o; |
| 994 } |
| 995 |
| 996 checkUnnamed3531(core.List<core.String> o) { |
| 997 unittest.expect(o, unittest.hasLength(2)); |
| 998 unittest.expect(o[0], unittest.equals('foo')); |
| 999 unittest.expect(o[1], unittest.equals('foo')); |
| 1000 } |
| 1001 |
| 1002 core.int buildCounterOperationMetadataV1 = 0; |
| 1003 buildOperationMetadataV1() { |
| 1004 var o = new api.OperationMetadataV1(); |
| 1005 buildCounterOperationMetadataV1++; |
| 1006 if (buildCounterOperationMetadataV1 < 3) { |
| 1007 o.endTime = "foo"; |
| 1008 o.ephemeralMessage = "foo"; |
| 1009 o.insertTime = "foo"; |
| 1010 o.method = "foo"; |
| 1011 o.target = "foo"; |
| 1012 o.user = "foo"; |
| 1013 o.warning = buildUnnamed3531(); |
| 1014 } |
| 1015 buildCounterOperationMetadataV1--; |
| 1016 return o; |
| 1017 } |
| 1018 |
| 1019 checkOperationMetadataV1(api.OperationMetadataV1 o) { |
| 1020 buildCounterOperationMetadataV1++; |
| 1021 if (buildCounterOperationMetadataV1 < 3) { |
| 1022 unittest.expect(o.endTime, unittest.equals('foo')); |
| 1023 unittest.expect(o.ephemeralMessage, unittest.equals('foo')); |
| 1024 unittest.expect(o.insertTime, unittest.equals('foo')); |
| 1025 unittest.expect(o.method, unittest.equals('foo')); |
| 1026 unittest.expect(o.target, unittest.equals('foo')); |
| 1027 unittest.expect(o.user, unittest.equals('foo')); |
| 1028 checkUnnamed3531(o.warning); |
| 1029 } |
| 1030 buildCounterOperationMetadataV1--; |
| 1031 } |
| 1032 |
| 1033 buildUnnamed3532() { |
| 1034 var o = new core.List<core.String>(); |
| 1035 o.add("foo"); |
| 1036 o.add("foo"); |
| 1037 return o; |
| 1038 } |
| 1039 |
| 1040 checkUnnamed3532(core.List<core.String> o) { |
| 1041 unittest.expect(o, unittest.hasLength(2)); |
| 1042 unittest.expect(o[0], unittest.equals('foo')); |
| 1043 unittest.expect(o[1], unittest.equals('foo')); |
| 1044 } |
| 1045 |
| 1046 core.int buildCounterOperationMetadataV1Alpha = 0; |
| 1047 buildOperationMetadataV1Alpha() { |
| 1048 var o = new api.OperationMetadataV1Alpha(); |
| 1049 buildCounterOperationMetadataV1Alpha++; |
| 1050 if (buildCounterOperationMetadataV1Alpha < 3) { |
| 1051 o.endTime = "foo"; |
| 1052 o.ephemeralMessage = "foo"; |
| 1053 o.insertTime = "foo"; |
| 1054 o.method = "foo"; |
| 1055 o.target = "foo"; |
| 1056 o.user = "foo"; |
| 1057 o.warning = buildUnnamed3532(); |
| 1058 } |
| 1059 buildCounterOperationMetadataV1Alpha--; |
| 1060 return o; |
| 1061 } |
| 1062 |
| 1063 checkOperationMetadataV1Alpha(api.OperationMetadataV1Alpha o) { |
| 1064 buildCounterOperationMetadataV1Alpha++; |
| 1065 if (buildCounterOperationMetadataV1Alpha < 3) { |
| 1066 unittest.expect(o.endTime, unittest.equals('foo')); |
| 1067 unittest.expect(o.ephemeralMessage, unittest.equals('foo')); |
| 1068 unittest.expect(o.insertTime, unittest.equals('foo')); |
| 1069 unittest.expect(o.method, unittest.equals('foo')); |
| 1070 unittest.expect(o.target, unittest.equals('foo')); |
| 1071 unittest.expect(o.user, unittest.equals('foo')); |
| 1072 checkUnnamed3532(o.warning); |
| 1073 } |
| 1074 buildCounterOperationMetadataV1Alpha--; |
| 1075 } |
| 1076 |
| 1077 buildUnnamed3533() { |
| 1078 var o = new core.List<core.String>(); |
| 1079 o.add("foo"); |
| 1080 o.add("foo"); |
| 1081 return o; |
| 1082 } |
| 1083 |
| 1084 checkUnnamed3533(core.List<core.String> o) { |
| 1085 unittest.expect(o, unittest.hasLength(2)); |
| 1086 unittest.expect(o[0], unittest.equals('foo')); |
| 1087 unittest.expect(o[1], unittest.equals('foo')); |
| 1088 } |
| 1089 |
| 1090 core.int buildCounterOperationMetadataV1Beta = 0; |
| 1091 buildOperationMetadataV1Beta() { |
| 1092 var o = new api.OperationMetadataV1Beta(); |
| 1093 buildCounterOperationMetadataV1Beta++; |
| 1094 if (buildCounterOperationMetadataV1Beta < 3) { |
| 1095 o.endTime = "foo"; |
| 1096 o.ephemeralMessage = "foo"; |
| 1097 o.insertTime = "foo"; |
| 1098 o.method = "foo"; |
| 1099 o.target = "foo"; |
| 1100 o.user = "foo"; |
| 1101 o.warning = buildUnnamed3533(); |
| 1102 } |
| 1103 buildCounterOperationMetadataV1Beta--; |
| 1104 return o; |
| 1105 } |
| 1106 |
| 1107 checkOperationMetadataV1Beta(api.OperationMetadataV1Beta o) { |
| 1108 buildCounterOperationMetadataV1Beta++; |
| 1109 if (buildCounterOperationMetadataV1Beta < 3) { |
| 1110 unittest.expect(o.endTime, unittest.equals('foo')); |
| 1111 unittest.expect(o.ephemeralMessage, unittest.equals('foo')); |
| 1112 unittest.expect(o.insertTime, unittest.equals('foo')); |
| 1113 unittest.expect(o.method, unittest.equals('foo')); |
| 1114 unittest.expect(o.target, unittest.equals('foo')); |
| 1115 unittest.expect(o.user, unittest.equals('foo')); |
| 1116 checkUnnamed3533(o.warning); |
| 1117 } |
| 1118 buildCounterOperationMetadataV1Beta--; |
| 1119 } |
| 1120 |
| 1121 core.int buildCounterOperationMetadataV1Beta5 = 0; |
| 1122 buildOperationMetadataV1Beta5() { |
| 1123 var o = new api.OperationMetadataV1Beta5(); |
| 1124 buildCounterOperationMetadataV1Beta5++; |
| 1125 if (buildCounterOperationMetadataV1Beta5 < 3) { |
| 1126 o.endTime = "foo"; |
| 1127 o.insertTime = "foo"; |
| 1128 o.method = "foo"; |
| 1129 o.target = "foo"; |
| 1130 o.user = "foo"; |
| 1131 } |
| 1132 buildCounterOperationMetadataV1Beta5--; |
| 1133 return o; |
| 1134 } |
| 1135 |
| 1136 checkOperationMetadataV1Beta5(api.OperationMetadataV1Beta5 o) { |
| 1137 buildCounterOperationMetadataV1Beta5++; |
| 1138 if (buildCounterOperationMetadataV1Beta5 < 3) { |
| 1139 unittest.expect(o.endTime, unittest.equals('foo')); |
| 1140 unittest.expect(o.insertTime, unittest.equals('foo')); |
| 1141 unittest.expect(o.method, unittest.equals('foo')); |
| 1142 unittest.expect(o.target, unittest.equals('foo')); |
| 1143 unittest.expect(o.user, unittest.equals('foo')); |
| 1144 } |
| 1145 buildCounterOperationMetadataV1Beta5--; |
| 1146 } |
| 1147 |
| 1148 core.int buildCounterReadinessCheck = 0; |
| 1149 buildReadinessCheck() { |
| 1150 var o = new api.ReadinessCheck(); |
| 1151 buildCounterReadinessCheck++; |
| 1152 if (buildCounterReadinessCheck < 3) { |
| 1153 o.checkInterval = "foo"; |
| 1154 o.healthyThreshold = 42; |
| 1155 o.host = "foo"; |
| 1156 o.path = "foo"; |
| 1157 o.timeout = "foo"; |
| 1158 o.unhealthyThreshold = 42; |
| 1159 } |
| 1160 buildCounterReadinessCheck--; |
| 1161 return o; |
| 1162 } |
| 1163 |
| 1164 checkReadinessCheck(api.ReadinessCheck o) { |
| 1165 buildCounterReadinessCheck++; |
| 1166 if (buildCounterReadinessCheck < 3) { |
| 1167 unittest.expect(o.checkInterval, unittest.equals('foo')); |
| 1168 unittest.expect(o.healthyThreshold, unittest.equals(42)); |
| 1169 unittest.expect(o.host, unittest.equals('foo')); |
| 1170 unittest.expect(o.path, unittest.equals('foo')); |
| 1171 unittest.expect(o.timeout, unittest.equals('foo')); |
| 1172 unittest.expect(o.unhealthyThreshold, unittest.equals(42)); |
| 1173 } |
| 1174 buildCounterReadinessCheck--; |
| 1175 } |
| 1176 |
| 1177 core.int buildCounterRepairApplicationRequest = 0; |
| 1178 buildRepairApplicationRequest() { |
| 1179 var o = new api.RepairApplicationRequest(); |
| 1180 buildCounterRepairApplicationRequest++; |
| 1181 if (buildCounterRepairApplicationRequest < 3) { |
| 1182 } |
| 1183 buildCounterRepairApplicationRequest--; |
| 1184 return o; |
| 1185 } |
| 1186 |
| 1187 checkRepairApplicationRequest(api.RepairApplicationRequest o) { |
| 1188 buildCounterRepairApplicationRequest++; |
| 1189 if (buildCounterRepairApplicationRequest < 3) { |
| 1190 } |
| 1191 buildCounterRepairApplicationRequest--; |
| 1192 } |
| 1193 |
| 1194 core.int buildCounterRequestUtilization = 0; |
| 1195 buildRequestUtilization() { |
| 1196 var o = new api.RequestUtilization(); |
| 1197 buildCounterRequestUtilization++; |
| 1198 if (buildCounterRequestUtilization < 3) { |
| 1199 o.targetConcurrentRequests = 42; |
| 1200 o.targetRequestCountPerSecond = 42; |
| 1201 } |
| 1202 buildCounterRequestUtilization--; |
| 1203 return o; |
| 1204 } |
| 1205 |
| 1206 checkRequestUtilization(api.RequestUtilization o) { |
| 1207 buildCounterRequestUtilization++; |
| 1208 if (buildCounterRequestUtilization < 3) { |
| 1209 unittest.expect(o.targetConcurrentRequests, unittest.equals(42)); |
| 1210 unittest.expect(o.targetRequestCountPerSecond, unittest.equals(42)); |
| 1211 } |
| 1212 buildCounterRequestUtilization--; |
| 1213 } |
| 1214 |
| 1215 buildUnnamed3534() { |
| 1216 var o = new core.List<api.Volume>(); |
| 1217 o.add(buildVolume()); |
| 1218 o.add(buildVolume()); |
| 1219 return o; |
| 1220 } |
| 1221 |
| 1222 checkUnnamed3534(core.List<api.Volume> o) { |
| 1223 unittest.expect(o, unittest.hasLength(2)); |
| 1224 checkVolume(o[0]); |
| 1225 checkVolume(o[1]); |
| 1226 } |
| 1227 |
| 1228 core.int buildCounterResources = 0; |
| 1229 buildResources() { |
| 1230 var o = new api.Resources(); |
| 1231 buildCounterResources++; |
| 1232 if (buildCounterResources < 3) { |
| 1233 o.cpu = 42.0; |
| 1234 o.diskGb = 42.0; |
| 1235 o.memoryGb = 42.0; |
| 1236 o.volumes = buildUnnamed3534(); |
| 1237 } |
| 1238 buildCounterResources--; |
| 1239 return o; |
| 1240 } |
| 1241 |
| 1242 checkResources(api.Resources o) { |
| 1243 buildCounterResources++; |
| 1244 if (buildCounterResources < 3) { |
| 1245 unittest.expect(o.cpu, unittest.equals(42.0)); |
| 1246 unittest.expect(o.diskGb, unittest.equals(42.0)); |
| 1247 unittest.expect(o.memoryGb, unittest.equals(42.0)); |
| 1248 checkUnnamed3534(o.volumes); |
| 1249 } |
| 1250 buildCounterResources--; |
| 1251 } |
| 1252 |
| 1253 core.int buildCounterScriptHandler = 0; |
| 1254 buildScriptHandler() { |
| 1255 var o = new api.ScriptHandler(); |
| 1256 buildCounterScriptHandler++; |
| 1257 if (buildCounterScriptHandler < 3) { |
| 1258 o.scriptPath = "foo"; |
| 1259 } |
| 1260 buildCounterScriptHandler--; |
| 1261 return o; |
| 1262 } |
| 1263 |
| 1264 checkScriptHandler(api.ScriptHandler o) { |
| 1265 buildCounterScriptHandler++; |
| 1266 if (buildCounterScriptHandler < 3) { |
| 1267 unittest.expect(o.scriptPath, unittest.equals('foo')); |
| 1268 } |
| 1269 buildCounterScriptHandler--; |
| 1270 } |
| 1271 |
| 1272 core.int buildCounterService = 0; |
| 1273 buildService() { |
| 1274 var o = new api.Service(); |
| 1275 buildCounterService++; |
| 1276 if (buildCounterService < 3) { |
| 1277 o.id = "foo"; |
| 1278 o.name = "foo"; |
| 1279 o.split = buildTrafficSplit(); |
| 1280 } |
| 1281 buildCounterService--; |
| 1282 return o; |
| 1283 } |
| 1284 |
| 1285 checkService(api.Service o) { |
| 1286 buildCounterService++; |
| 1287 if (buildCounterService < 3) { |
| 1288 unittest.expect(o.id, unittest.equals('foo')); |
| 1289 unittest.expect(o.name, unittest.equals('foo')); |
| 1290 checkTrafficSplit(o.split); |
| 1291 } |
| 1292 buildCounterService--; |
| 1293 } |
| 1294 |
| 1295 buildUnnamed3535() { |
| 1296 var o = new core.Map<core.String, core.String>(); |
| 1297 o["x"] = "foo"; |
| 1298 o["y"] = "foo"; |
| 1299 return o; |
| 1300 } |
| 1301 |
| 1302 checkUnnamed3535(core.Map<core.String, core.String> o) { |
| 1303 unittest.expect(o, unittest.hasLength(2)); |
| 1304 unittest.expect(o["x"], unittest.equals('foo')); |
| 1305 unittest.expect(o["y"], unittest.equals('foo')); |
| 1306 } |
| 1307 |
| 1308 core.int buildCounterStaticFilesHandler = 0; |
| 1309 buildStaticFilesHandler() { |
| 1310 var o = new api.StaticFilesHandler(); |
| 1311 buildCounterStaticFilesHandler++; |
| 1312 if (buildCounterStaticFilesHandler < 3) { |
| 1313 o.applicationReadable = true; |
| 1314 o.expiration = "foo"; |
| 1315 o.httpHeaders = buildUnnamed3535(); |
| 1316 o.mimeType = "foo"; |
| 1317 o.path = "foo"; |
| 1318 o.requireMatchingFile = true; |
| 1319 o.uploadPathRegex = "foo"; |
| 1320 } |
| 1321 buildCounterStaticFilesHandler--; |
| 1322 return o; |
| 1323 } |
| 1324 |
| 1325 checkStaticFilesHandler(api.StaticFilesHandler o) { |
| 1326 buildCounterStaticFilesHandler++; |
| 1327 if (buildCounterStaticFilesHandler < 3) { |
| 1328 unittest.expect(o.applicationReadable, unittest.isTrue); |
| 1329 unittest.expect(o.expiration, unittest.equals('foo')); |
| 1330 checkUnnamed3535(o.httpHeaders); |
| 1331 unittest.expect(o.mimeType, unittest.equals('foo')); |
| 1332 unittest.expect(o.path, unittest.equals('foo')); |
| 1333 unittest.expect(o.requireMatchingFile, unittest.isTrue); |
| 1334 unittest.expect(o.uploadPathRegex, unittest.equals('foo')); |
| 1335 } |
| 1336 buildCounterStaticFilesHandler--; |
| 1337 } |
| 1338 |
| 1339 buildUnnamed3536() { |
| 1340 var o = new core.Map<core.String, core.Object>(); |
| 1341 o["x"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1342 o["y"] = {'list' : [1, 2, 3], 'bool' : true, 'string' : 'foo'}; |
| 1343 return o; |
| 1344 } |
| 1345 |
| 1346 checkUnnamed3536(core.Map<core.String, core.Object> o) { |
| 1347 unittest.expect(o, unittest.hasLength(2)); |
| 1348 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')); |
| 1349 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')); |
| 1350 } |
| 1351 |
| 1352 buildUnnamed3537() { |
| 1353 var o = new core.List<core.Map<core.String, core.Object>>(); |
| 1354 o.add(buildUnnamed3536()); |
| 1355 o.add(buildUnnamed3536()); |
| 1356 return o; |
| 1357 } |
| 1358 |
| 1359 checkUnnamed3537(core.List<core.Map<core.String, core.Object>> o) { |
| 1360 unittest.expect(o, unittest.hasLength(2)); |
| 1361 checkUnnamed3536(o[0]); |
| 1362 checkUnnamed3536(o[1]); |
| 1363 } |
| 1364 |
| 1365 core.int buildCounterStatus = 0; |
| 1366 buildStatus() { |
| 1367 var o = new api.Status(); |
| 1368 buildCounterStatus++; |
| 1369 if (buildCounterStatus < 3) { |
| 1370 o.code = 42; |
| 1371 o.details = buildUnnamed3537(); |
| 1372 o.message = "foo"; |
| 1373 } |
| 1374 buildCounterStatus--; |
| 1375 return o; |
| 1376 } |
| 1377 |
| 1378 checkStatus(api.Status o) { |
| 1379 buildCounterStatus++; |
| 1380 if (buildCounterStatus < 3) { |
| 1381 unittest.expect(o.code, unittest.equals(42)); |
| 1382 checkUnnamed3537(o.details); |
| 1383 unittest.expect(o.message, unittest.equals('foo')); |
| 1384 } |
| 1385 buildCounterStatus--; |
| 1386 } |
| 1387 |
| 1388 buildUnnamed3538() { |
| 1389 var o = new core.Map<core.String, core.double>(); |
| 1390 o["x"] = 42.0; |
| 1391 o["y"] = 42.0; |
| 1392 return o; |
| 1393 } |
| 1394 |
| 1395 checkUnnamed3538(core.Map<core.String, core.double> o) { |
| 1396 unittest.expect(o, unittest.hasLength(2)); |
| 1397 unittest.expect(o["x"], unittest.equals(42.0)); |
| 1398 unittest.expect(o["y"], unittest.equals(42.0)); |
| 1399 } |
| 1400 |
| 1401 core.int buildCounterTrafficSplit = 0; |
| 1402 buildTrafficSplit() { |
| 1403 var o = new api.TrafficSplit(); |
| 1404 buildCounterTrafficSplit++; |
| 1405 if (buildCounterTrafficSplit < 3) { |
| 1406 o.allocations = buildUnnamed3538(); |
| 1407 o.shardBy = "foo"; |
| 1408 } |
| 1409 buildCounterTrafficSplit--; |
| 1410 return o; |
| 1411 } |
| 1412 |
| 1413 checkTrafficSplit(api.TrafficSplit o) { |
| 1414 buildCounterTrafficSplit++; |
| 1415 if (buildCounterTrafficSplit < 3) { |
| 1416 checkUnnamed3538(o.allocations); |
| 1417 unittest.expect(o.shardBy, unittest.equals('foo')); |
| 1418 } |
| 1419 buildCounterTrafficSplit--; |
| 1420 } |
| 1421 |
| 1422 core.int buildCounterUrlDispatchRule = 0; |
| 1423 buildUrlDispatchRule() { |
| 1424 var o = new api.UrlDispatchRule(); |
| 1425 buildCounterUrlDispatchRule++; |
| 1426 if (buildCounterUrlDispatchRule < 3) { |
| 1427 o.domain = "foo"; |
| 1428 o.path = "foo"; |
| 1429 o.service = "foo"; |
| 1430 } |
| 1431 buildCounterUrlDispatchRule--; |
| 1432 return o; |
| 1433 } |
| 1434 |
| 1435 checkUrlDispatchRule(api.UrlDispatchRule o) { |
| 1436 buildCounterUrlDispatchRule++; |
| 1437 if (buildCounterUrlDispatchRule < 3) { |
| 1438 unittest.expect(o.domain, unittest.equals('foo')); |
| 1439 unittest.expect(o.path, unittest.equals('foo')); |
| 1440 unittest.expect(o.service, unittest.equals('foo')); |
| 1441 } |
| 1442 buildCounterUrlDispatchRule--; |
| 1443 } |
| 1444 |
| 1445 core.int buildCounterUrlMap = 0; |
| 1446 buildUrlMap() { |
| 1447 var o = new api.UrlMap(); |
| 1448 buildCounterUrlMap++; |
| 1449 if (buildCounterUrlMap < 3) { |
| 1450 o.apiEndpoint = buildApiEndpointHandler(); |
| 1451 o.authFailAction = "foo"; |
| 1452 o.login = "foo"; |
| 1453 o.redirectHttpResponseCode = "foo"; |
| 1454 o.script = buildScriptHandler(); |
| 1455 o.securityLevel = "foo"; |
| 1456 o.staticFiles = buildStaticFilesHandler(); |
| 1457 o.urlRegex = "foo"; |
| 1458 } |
| 1459 buildCounterUrlMap--; |
| 1460 return o; |
| 1461 } |
| 1462 |
| 1463 checkUrlMap(api.UrlMap o) { |
| 1464 buildCounterUrlMap++; |
| 1465 if (buildCounterUrlMap < 3) { |
| 1466 checkApiEndpointHandler(o.apiEndpoint); |
| 1467 unittest.expect(o.authFailAction, unittest.equals('foo')); |
| 1468 unittest.expect(o.login, unittest.equals('foo')); |
| 1469 unittest.expect(o.redirectHttpResponseCode, unittest.equals('foo')); |
| 1470 checkScriptHandler(o.script); |
| 1471 unittest.expect(o.securityLevel, unittest.equals('foo')); |
| 1472 checkStaticFilesHandler(o.staticFiles); |
| 1473 unittest.expect(o.urlRegex, unittest.equals('foo')); |
| 1474 } |
| 1475 buildCounterUrlMap--; |
| 1476 } |
| 1477 |
| 1478 buildUnnamed3539() { |
| 1479 var o = new core.Map<core.String, core.String>(); |
| 1480 o["x"] = "foo"; |
| 1481 o["y"] = "foo"; |
| 1482 return o; |
| 1483 } |
| 1484 |
| 1485 checkUnnamed3539(core.Map<core.String, core.String> o) { |
| 1486 unittest.expect(o, unittest.hasLength(2)); |
| 1487 unittest.expect(o["x"], unittest.equals('foo')); |
| 1488 unittest.expect(o["y"], unittest.equals('foo')); |
| 1489 } |
| 1490 |
| 1491 buildUnnamed3540() { |
| 1492 var o = new core.Map<core.String, core.String>(); |
| 1493 o["x"] = "foo"; |
| 1494 o["y"] = "foo"; |
| 1495 return o; |
| 1496 } |
| 1497 |
| 1498 checkUnnamed3540(core.Map<core.String, core.String> o) { |
| 1499 unittest.expect(o, unittest.hasLength(2)); |
| 1500 unittest.expect(o["x"], unittest.equals('foo')); |
| 1501 unittest.expect(o["y"], unittest.equals('foo')); |
| 1502 } |
| 1503 |
| 1504 buildUnnamed3541() { |
| 1505 var o = new core.List<api.ErrorHandler>(); |
| 1506 o.add(buildErrorHandler()); |
| 1507 o.add(buildErrorHandler()); |
| 1508 return o; |
| 1509 } |
| 1510 |
| 1511 checkUnnamed3541(core.List<api.ErrorHandler> o) { |
| 1512 unittest.expect(o, unittest.hasLength(2)); |
| 1513 checkErrorHandler(o[0]); |
| 1514 checkErrorHandler(o[1]); |
| 1515 } |
| 1516 |
| 1517 buildUnnamed3542() { |
| 1518 var o = new core.List<api.UrlMap>(); |
| 1519 o.add(buildUrlMap()); |
| 1520 o.add(buildUrlMap()); |
| 1521 return o; |
| 1522 } |
| 1523 |
| 1524 checkUnnamed3542(core.List<api.UrlMap> o) { |
| 1525 unittest.expect(o, unittest.hasLength(2)); |
| 1526 checkUrlMap(o[0]); |
| 1527 checkUrlMap(o[1]); |
| 1528 } |
| 1529 |
| 1530 buildUnnamed3543() { |
| 1531 var o = new core.List<core.String>(); |
| 1532 o.add("foo"); |
| 1533 o.add("foo"); |
| 1534 return o; |
| 1535 } |
| 1536 |
| 1537 checkUnnamed3543(core.List<core.String> o) { |
| 1538 unittest.expect(o, unittest.hasLength(2)); |
| 1539 unittest.expect(o[0], unittest.equals('foo')); |
| 1540 unittest.expect(o[1], unittest.equals('foo')); |
| 1541 } |
| 1542 |
| 1543 buildUnnamed3544() { |
| 1544 var o = new core.List<api.Library>(); |
| 1545 o.add(buildLibrary()); |
| 1546 o.add(buildLibrary()); |
| 1547 return o; |
| 1548 } |
| 1549 |
| 1550 checkUnnamed3544(core.List<api.Library> o) { |
| 1551 unittest.expect(o, unittest.hasLength(2)); |
| 1552 checkLibrary(o[0]); |
| 1553 checkLibrary(o[1]); |
| 1554 } |
| 1555 |
| 1556 core.int buildCounterVersion = 0; |
| 1557 buildVersion() { |
| 1558 var o = new api.Version(); |
| 1559 buildCounterVersion++; |
| 1560 if (buildCounterVersion < 3) { |
| 1561 o.apiConfig = buildApiConfigHandler(); |
| 1562 o.automaticScaling = buildAutomaticScaling(); |
| 1563 o.basicScaling = buildBasicScaling(); |
| 1564 o.betaSettings = buildUnnamed3539(); |
| 1565 o.createTime = "foo"; |
| 1566 o.createdBy = "foo"; |
| 1567 o.defaultExpiration = "foo"; |
| 1568 o.deployment = buildDeployment(); |
| 1569 o.diskUsageBytes = "foo"; |
| 1570 o.endpointsApiService = buildEndpointsApiService(); |
| 1571 o.env = "foo"; |
| 1572 o.envVariables = buildUnnamed3540(); |
| 1573 o.errorHandlers = buildUnnamed3541(); |
| 1574 o.handlers = buildUnnamed3542(); |
| 1575 o.healthCheck = buildHealthCheck(); |
| 1576 o.id = "foo"; |
| 1577 o.inboundServices = buildUnnamed3543(); |
| 1578 o.instanceClass = "foo"; |
| 1579 o.libraries = buildUnnamed3544(); |
| 1580 o.livenessCheck = buildLivenessCheck(); |
| 1581 o.manualScaling = buildManualScaling(); |
| 1582 o.name = "foo"; |
| 1583 o.network = buildNetwork(); |
| 1584 o.nobuildFilesRegex = "foo"; |
| 1585 o.readinessCheck = buildReadinessCheck(); |
| 1586 o.resources = buildResources(); |
| 1587 o.runtime = "foo"; |
| 1588 o.servingStatus = "foo"; |
| 1589 o.threadsafe = true; |
| 1590 o.versionUrl = "foo"; |
| 1591 o.vm = true; |
| 1592 } |
| 1593 buildCounterVersion--; |
| 1594 return o; |
| 1595 } |
| 1596 |
| 1597 checkVersion(api.Version o) { |
| 1598 buildCounterVersion++; |
| 1599 if (buildCounterVersion < 3) { |
| 1600 checkApiConfigHandler(o.apiConfig); |
| 1601 checkAutomaticScaling(o.automaticScaling); |
| 1602 checkBasicScaling(o.basicScaling); |
| 1603 checkUnnamed3539(o.betaSettings); |
| 1604 unittest.expect(o.createTime, unittest.equals('foo')); |
| 1605 unittest.expect(o.createdBy, unittest.equals('foo')); |
| 1606 unittest.expect(o.defaultExpiration, unittest.equals('foo')); |
| 1607 checkDeployment(o.deployment); |
| 1608 unittest.expect(o.diskUsageBytes, unittest.equals('foo')); |
| 1609 checkEndpointsApiService(o.endpointsApiService); |
| 1610 unittest.expect(o.env, unittest.equals('foo')); |
| 1611 checkUnnamed3540(o.envVariables); |
| 1612 checkUnnamed3541(o.errorHandlers); |
| 1613 checkUnnamed3542(o.handlers); |
| 1614 checkHealthCheck(o.healthCheck); |
| 1615 unittest.expect(o.id, unittest.equals('foo')); |
| 1616 checkUnnamed3543(o.inboundServices); |
| 1617 unittest.expect(o.instanceClass, unittest.equals('foo')); |
| 1618 checkUnnamed3544(o.libraries); |
| 1619 checkLivenessCheck(o.livenessCheck); |
| 1620 checkManualScaling(o.manualScaling); |
| 1621 unittest.expect(o.name, unittest.equals('foo')); |
| 1622 checkNetwork(o.network); |
| 1623 unittest.expect(o.nobuildFilesRegex, unittest.equals('foo')); |
| 1624 checkReadinessCheck(o.readinessCheck); |
| 1625 checkResources(o.resources); |
| 1626 unittest.expect(o.runtime, unittest.equals('foo')); |
| 1627 unittest.expect(o.servingStatus, unittest.equals('foo')); |
| 1628 unittest.expect(o.threadsafe, unittest.isTrue); |
| 1629 unittest.expect(o.versionUrl, unittest.equals('foo')); |
| 1630 unittest.expect(o.vm, unittest.isTrue); |
| 1631 } |
| 1632 buildCounterVersion--; |
| 1633 } |
| 1634 |
| 1635 core.int buildCounterVolume = 0; |
| 1636 buildVolume() { |
| 1637 var o = new api.Volume(); |
| 1638 buildCounterVolume++; |
| 1639 if (buildCounterVolume < 3) { |
| 1640 o.name = "foo"; |
| 1641 o.sizeGb = 42.0; |
| 1642 o.volumeType = "foo"; |
| 1643 } |
| 1644 buildCounterVolume--; |
| 1645 return o; |
| 1646 } |
| 1647 |
| 1648 checkVolume(api.Volume o) { |
| 1649 buildCounterVolume++; |
| 1650 if (buildCounterVolume < 3) { |
| 1651 unittest.expect(o.name, unittest.equals('foo')); |
| 1652 unittest.expect(o.sizeGb, unittest.equals(42.0)); |
| 1653 unittest.expect(o.volumeType, unittest.equals('foo')); |
| 1654 } |
| 1655 buildCounterVolume--; |
| 1656 } |
| 1657 |
| 1658 core.int buildCounterZipInfo = 0; |
| 1659 buildZipInfo() { |
| 1660 var o = new api.ZipInfo(); |
| 1661 buildCounterZipInfo++; |
| 1662 if (buildCounterZipInfo < 3) { |
| 1663 o.filesCount = 42; |
| 1664 o.sourceUrl = "foo"; |
| 1665 } |
| 1666 buildCounterZipInfo--; |
| 1667 return o; |
| 1668 } |
| 1669 |
| 1670 checkZipInfo(api.ZipInfo o) { |
| 1671 buildCounterZipInfo++; |
| 1672 if (buildCounterZipInfo < 3) { |
| 1673 unittest.expect(o.filesCount, unittest.equals(42)); |
| 1674 unittest.expect(o.sourceUrl, unittest.equals('foo')); |
| 1675 } |
| 1676 buildCounterZipInfo--; |
| 1677 } |
| 1678 |
| 1679 |
| 1680 main() { |
| 1681 unittest.group("obj-schema-ApiConfigHandler", () { |
| 1682 unittest.test("to-json--from-json", () { |
| 1683 var o = buildApiConfigHandler(); |
| 1684 var od = new api.ApiConfigHandler.fromJson(o.toJson()); |
| 1685 checkApiConfigHandler(od); |
| 1686 }); |
| 1687 }); |
| 1688 |
| 1689 |
| 1690 unittest.group("obj-schema-ApiEndpointHandler", () { |
| 1691 unittest.test("to-json--from-json", () { |
| 1692 var o = buildApiEndpointHandler(); |
| 1693 var od = new api.ApiEndpointHandler.fromJson(o.toJson()); |
| 1694 checkApiEndpointHandler(od); |
| 1695 }); |
| 1696 }); |
| 1697 |
| 1698 |
| 1699 unittest.group("obj-schema-Application", () { |
| 1700 unittest.test("to-json--from-json", () { |
| 1701 var o = buildApplication(); |
| 1702 var od = new api.Application.fromJson(o.toJson()); |
| 1703 checkApplication(od); |
| 1704 }); |
| 1705 }); |
| 1706 |
| 1707 |
| 1708 unittest.group("obj-schema-AutomaticScaling", () { |
| 1709 unittest.test("to-json--from-json", () { |
| 1710 var o = buildAutomaticScaling(); |
| 1711 var od = new api.AutomaticScaling.fromJson(o.toJson()); |
| 1712 checkAutomaticScaling(od); |
| 1713 }); |
| 1714 }); |
| 1715 |
| 1716 |
| 1717 unittest.group("obj-schema-BasicScaling", () { |
| 1718 unittest.test("to-json--from-json", () { |
| 1719 var o = buildBasicScaling(); |
| 1720 var od = new api.BasicScaling.fromJson(o.toJson()); |
| 1721 checkBasicScaling(od); |
| 1722 }); |
| 1723 }); |
| 1724 |
| 1725 |
| 1726 unittest.group("obj-schema-ContainerInfo", () { |
| 1727 unittest.test("to-json--from-json", () { |
| 1728 var o = buildContainerInfo(); |
| 1729 var od = new api.ContainerInfo.fromJson(o.toJson()); |
| 1730 checkContainerInfo(od); |
| 1731 }); |
| 1732 }); |
| 1733 |
| 1734 |
| 1735 unittest.group("obj-schema-CpuUtilization", () { |
| 1736 unittest.test("to-json--from-json", () { |
| 1737 var o = buildCpuUtilization(); |
| 1738 var od = new api.CpuUtilization.fromJson(o.toJson()); |
| 1739 checkCpuUtilization(od); |
| 1740 }); |
| 1741 }); |
| 1742 |
| 1743 |
| 1744 unittest.group("obj-schema-DebugInstanceRequest", () { |
| 1745 unittest.test("to-json--from-json", () { |
| 1746 var o = buildDebugInstanceRequest(); |
| 1747 var od = new api.DebugInstanceRequest.fromJson(o.toJson()); |
| 1748 checkDebugInstanceRequest(od); |
| 1749 }); |
| 1750 }); |
| 1751 |
| 1752 |
| 1753 unittest.group("obj-schema-Deployment", () { |
| 1754 unittest.test("to-json--from-json", () { |
| 1755 var o = buildDeployment(); |
| 1756 var od = new api.Deployment.fromJson(o.toJson()); |
| 1757 checkDeployment(od); |
| 1758 }); |
| 1759 }); |
| 1760 |
| 1761 |
| 1762 unittest.group("obj-schema-DiskUtilization", () { |
| 1763 unittest.test("to-json--from-json", () { |
| 1764 var o = buildDiskUtilization(); |
| 1765 var od = new api.DiskUtilization.fromJson(o.toJson()); |
| 1766 checkDiskUtilization(od); |
| 1767 }); |
| 1768 }); |
| 1769 |
| 1770 |
| 1771 unittest.group("obj-schema-EndpointsApiService", () { |
| 1772 unittest.test("to-json--from-json", () { |
| 1773 var o = buildEndpointsApiService(); |
| 1774 var od = new api.EndpointsApiService.fromJson(o.toJson()); |
| 1775 checkEndpointsApiService(od); |
| 1776 }); |
| 1777 }); |
| 1778 |
| 1779 |
| 1780 unittest.group("obj-schema-ErrorHandler", () { |
| 1781 unittest.test("to-json--from-json", () { |
| 1782 var o = buildErrorHandler(); |
| 1783 var od = new api.ErrorHandler.fromJson(o.toJson()); |
| 1784 checkErrorHandler(od); |
| 1785 }); |
| 1786 }); |
| 1787 |
| 1788 |
| 1789 unittest.group("obj-schema-FileInfo", () { |
| 1790 unittest.test("to-json--from-json", () { |
| 1791 var o = buildFileInfo(); |
| 1792 var od = new api.FileInfo.fromJson(o.toJson()); |
| 1793 checkFileInfo(od); |
| 1794 }); |
| 1795 }); |
| 1796 |
| 1797 |
| 1798 unittest.group("obj-schema-HealthCheck", () { |
| 1799 unittest.test("to-json--from-json", () { |
| 1800 var o = buildHealthCheck(); |
| 1801 var od = new api.HealthCheck.fromJson(o.toJson()); |
| 1802 checkHealthCheck(od); |
| 1803 }); |
| 1804 }); |
| 1805 |
| 1806 |
| 1807 unittest.group("obj-schema-IdentityAwareProxy", () { |
| 1808 unittest.test("to-json--from-json", () { |
| 1809 var o = buildIdentityAwareProxy(); |
| 1810 var od = new api.IdentityAwareProxy.fromJson(o.toJson()); |
| 1811 checkIdentityAwareProxy(od); |
| 1812 }); |
| 1813 }); |
| 1814 |
| 1815 |
| 1816 unittest.group("obj-schema-Instance", () { |
| 1817 unittest.test("to-json--from-json", () { |
| 1818 var o = buildInstance(); |
| 1819 var od = new api.Instance.fromJson(o.toJson()); |
| 1820 checkInstance(od); |
| 1821 }); |
| 1822 }); |
| 1823 |
| 1824 |
| 1825 unittest.group("obj-schema-Library", () { |
| 1826 unittest.test("to-json--from-json", () { |
| 1827 var o = buildLibrary(); |
| 1828 var od = new api.Library.fromJson(o.toJson()); |
| 1829 checkLibrary(od); |
| 1830 }); |
| 1831 }); |
| 1832 |
| 1833 |
| 1834 unittest.group("obj-schema-ListInstancesResponse", () { |
| 1835 unittest.test("to-json--from-json", () { |
| 1836 var o = buildListInstancesResponse(); |
| 1837 var od = new api.ListInstancesResponse.fromJson(o.toJson()); |
| 1838 checkListInstancesResponse(od); |
| 1839 }); |
| 1840 }); |
| 1841 |
| 1842 |
| 1843 unittest.group("obj-schema-ListLocationsResponse", () { |
| 1844 unittest.test("to-json--from-json", () { |
| 1845 var o = buildListLocationsResponse(); |
| 1846 var od = new api.ListLocationsResponse.fromJson(o.toJson()); |
| 1847 checkListLocationsResponse(od); |
| 1848 }); |
| 1849 }); |
| 1850 |
| 1851 |
| 1852 unittest.group("obj-schema-ListOperationsResponse", () { |
| 1853 unittest.test("to-json--from-json", () { |
| 1854 var o = buildListOperationsResponse(); |
| 1855 var od = new api.ListOperationsResponse.fromJson(o.toJson()); |
| 1856 checkListOperationsResponse(od); |
| 1857 }); |
| 1858 }); |
| 1859 |
| 1860 |
| 1861 unittest.group("obj-schema-ListServicesResponse", () { |
| 1862 unittest.test("to-json--from-json", () { |
| 1863 var o = buildListServicesResponse(); |
| 1864 var od = new api.ListServicesResponse.fromJson(o.toJson()); |
| 1865 checkListServicesResponse(od); |
| 1866 }); |
| 1867 }); |
| 1868 |
| 1869 |
| 1870 unittest.group("obj-schema-ListVersionsResponse", () { |
| 1871 unittest.test("to-json--from-json", () { |
| 1872 var o = buildListVersionsResponse(); |
| 1873 var od = new api.ListVersionsResponse.fromJson(o.toJson()); |
| 1874 checkListVersionsResponse(od); |
| 1875 }); |
| 1876 }); |
| 1877 |
| 1878 |
| 1879 unittest.group("obj-schema-LivenessCheck", () { |
| 1880 unittest.test("to-json--from-json", () { |
| 1881 var o = buildLivenessCheck(); |
| 1882 var od = new api.LivenessCheck.fromJson(o.toJson()); |
| 1883 checkLivenessCheck(od); |
| 1884 }); |
| 1885 }); |
| 1886 |
| 1887 |
| 1888 unittest.group("obj-schema-Location", () { |
| 1889 unittest.test("to-json--from-json", () { |
| 1890 var o = buildLocation(); |
| 1891 var od = new api.Location.fromJson(o.toJson()); |
| 1892 checkLocation(od); |
| 1893 }); |
| 1894 }); |
| 1895 |
| 1896 |
| 1897 unittest.group("obj-schema-LocationMetadata", () { |
| 1898 unittest.test("to-json--from-json", () { |
| 1899 var o = buildLocationMetadata(); |
| 1900 var od = new api.LocationMetadata.fromJson(o.toJson()); |
| 1901 checkLocationMetadata(od); |
| 1902 }); |
| 1903 }); |
| 1904 |
| 1905 |
| 1906 unittest.group("obj-schema-ManualScaling", () { |
| 1907 unittest.test("to-json--from-json", () { |
| 1908 var o = buildManualScaling(); |
| 1909 var od = new api.ManualScaling.fromJson(o.toJson()); |
| 1910 checkManualScaling(od); |
| 1911 }); |
| 1912 }); |
| 1913 |
| 1914 |
| 1915 unittest.group("obj-schema-Network", () { |
| 1916 unittest.test("to-json--from-json", () { |
| 1917 var o = buildNetwork(); |
| 1918 var od = new api.Network.fromJson(o.toJson()); |
| 1919 checkNetwork(od); |
| 1920 }); |
| 1921 }); |
| 1922 |
| 1923 |
| 1924 unittest.group("obj-schema-NetworkUtilization", () { |
| 1925 unittest.test("to-json--from-json", () { |
| 1926 var o = buildNetworkUtilization(); |
| 1927 var od = new api.NetworkUtilization.fromJson(o.toJson()); |
| 1928 checkNetworkUtilization(od); |
| 1929 }); |
| 1930 }); |
| 1931 |
| 1932 |
| 1933 unittest.group("obj-schema-Operation", () { |
| 1934 unittest.test("to-json--from-json", () { |
| 1935 var o = buildOperation(); |
| 1936 var od = new api.Operation.fromJson(o.toJson()); |
| 1937 checkOperation(od); |
| 1938 }); |
| 1939 }); |
| 1940 |
| 1941 |
| 1942 unittest.group("obj-schema-OperationMetadata", () { |
| 1943 unittest.test("to-json--from-json", () { |
| 1944 var o = buildOperationMetadata(); |
| 1945 var od = new api.OperationMetadata.fromJson(o.toJson()); |
| 1946 checkOperationMetadata(od); |
| 1947 }); |
| 1948 }); |
| 1949 |
| 1950 |
| 1951 unittest.group("obj-schema-OperationMetadataExperimental", () { |
| 1952 unittest.test("to-json--from-json", () { |
| 1953 var o = buildOperationMetadataExperimental(); |
| 1954 var od = new api.OperationMetadataExperimental.fromJson(o.toJson()); |
| 1955 checkOperationMetadataExperimental(od); |
| 1956 }); |
| 1957 }); |
| 1958 |
| 1959 |
| 1960 unittest.group("obj-schema-OperationMetadataV1", () { |
| 1961 unittest.test("to-json--from-json", () { |
| 1962 var o = buildOperationMetadataV1(); |
| 1963 var od = new api.OperationMetadataV1.fromJson(o.toJson()); |
| 1964 checkOperationMetadataV1(od); |
| 1965 }); |
| 1966 }); |
| 1967 |
| 1968 |
| 1969 unittest.group("obj-schema-OperationMetadataV1Alpha", () { |
| 1970 unittest.test("to-json--from-json", () { |
| 1971 var o = buildOperationMetadataV1Alpha(); |
| 1972 var od = new api.OperationMetadataV1Alpha.fromJson(o.toJson()); |
| 1973 checkOperationMetadataV1Alpha(od); |
| 1974 }); |
| 1975 }); |
| 1976 |
| 1977 |
| 1978 unittest.group("obj-schema-OperationMetadataV1Beta", () { |
| 1979 unittest.test("to-json--from-json", () { |
| 1980 var o = buildOperationMetadataV1Beta(); |
| 1981 var od = new api.OperationMetadataV1Beta.fromJson(o.toJson()); |
| 1982 checkOperationMetadataV1Beta(od); |
| 1983 }); |
| 1984 }); |
| 1985 |
| 1986 |
| 1987 unittest.group("obj-schema-OperationMetadataV1Beta5", () { |
| 1988 unittest.test("to-json--from-json", () { |
| 1989 var o = buildOperationMetadataV1Beta5(); |
| 1990 var od = new api.OperationMetadataV1Beta5.fromJson(o.toJson()); |
| 1991 checkOperationMetadataV1Beta5(od); |
| 1992 }); |
| 1993 }); |
| 1994 |
| 1995 |
| 1996 unittest.group("obj-schema-ReadinessCheck", () { |
| 1997 unittest.test("to-json--from-json", () { |
| 1998 var o = buildReadinessCheck(); |
| 1999 var od = new api.ReadinessCheck.fromJson(o.toJson()); |
| 2000 checkReadinessCheck(od); |
| 2001 }); |
| 2002 }); |
| 2003 |
| 2004 |
| 2005 unittest.group("obj-schema-RepairApplicationRequest", () { |
| 2006 unittest.test("to-json--from-json", () { |
| 2007 var o = buildRepairApplicationRequest(); |
| 2008 var od = new api.RepairApplicationRequest.fromJson(o.toJson()); |
| 2009 checkRepairApplicationRequest(od); |
| 2010 }); |
| 2011 }); |
| 2012 |
| 2013 |
| 2014 unittest.group("obj-schema-RequestUtilization", () { |
| 2015 unittest.test("to-json--from-json", () { |
| 2016 var o = buildRequestUtilization(); |
| 2017 var od = new api.RequestUtilization.fromJson(o.toJson()); |
| 2018 checkRequestUtilization(od); |
| 2019 }); |
| 2020 }); |
| 2021 |
| 2022 |
| 2023 unittest.group("obj-schema-Resources", () { |
| 2024 unittest.test("to-json--from-json", () { |
| 2025 var o = buildResources(); |
| 2026 var od = new api.Resources.fromJson(o.toJson()); |
| 2027 checkResources(od); |
| 2028 }); |
| 2029 }); |
| 2030 |
| 2031 |
| 2032 unittest.group("obj-schema-ScriptHandler", () { |
| 2033 unittest.test("to-json--from-json", () { |
| 2034 var o = buildScriptHandler(); |
| 2035 var od = new api.ScriptHandler.fromJson(o.toJson()); |
| 2036 checkScriptHandler(od); |
| 2037 }); |
| 2038 }); |
| 2039 |
| 2040 |
| 2041 unittest.group("obj-schema-Service", () { |
| 2042 unittest.test("to-json--from-json", () { |
| 2043 var o = buildService(); |
| 2044 var od = new api.Service.fromJson(o.toJson()); |
| 2045 checkService(od); |
| 2046 }); |
| 2047 }); |
| 2048 |
| 2049 |
| 2050 unittest.group("obj-schema-StaticFilesHandler", () { |
| 2051 unittest.test("to-json--from-json", () { |
| 2052 var o = buildStaticFilesHandler(); |
| 2053 var od = new api.StaticFilesHandler.fromJson(o.toJson()); |
| 2054 checkStaticFilesHandler(od); |
| 2055 }); |
| 2056 }); |
| 2057 |
| 2058 |
| 2059 unittest.group("obj-schema-Status", () { |
| 2060 unittest.test("to-json--from-json", () { |
| 2061 var o = buildStatus(); |
| 2062 var od = new api.Status.fromJson(o.toJson()); |
| 2063 checkStatus(od); |
| 2064 }); |
| 2065 }); |
| 2066 |
| 2067 |
| 2068 unittest.group("obj-schema-TrafficSplit", () { |
| 2069 unittest.test("to-json--from-json", () { |
| 2070 var o = buildTrafficSplit(); |
| 2071 var od = new api.TrafficSplit.fromJson(o.toJson()); |
| 2072 checkTrafficSplit(od); |
| 2073 }); |
| 2074 }); |
| 2075 |
| 2076 |
| 2077 unittest.group("obj-schema-UrlDispatchRule", () { |
| 2078 unittest.test("to-json--from-json", () { |
| 2079 var o = buildUrlDispatchRule(); |
| 2080 var od = new api.UrlDispatchRule.fromJson(o.toJson()); |
| 2081 checkUrlDispatchRule(od); |
| 2082 }); |
| 2083 }); |
| 2084 |
| 2085 |
| 2086 unittest.group("obj-schema-UrlMap", () { |
| 2087 unittest.test("to-json--from-json", () { |
| 2088 var o = buildUrlMap(); |
| 2089 var od = new api.UrlMap.fromJson(o.toJson()); |
| 2090 checkUrlMap(od); |
| 2091 }); |
| 2092 }); |
| 2093 |
| 2094 |
| 2095 unittest.group("obj-schema-Version", () { |
| 2096 unittest.test("to-json--from-json", () { |
| 2097 var o = buildVersion(); |
| 2098 var od = new api.Version.fromJson(o.toJson()); |
| 2099 checkVersion(od); |
| 2100 }); |
| 2101 }); |
| 2102 |
| 2103 |
| 2104 unittest.group("obj-schema-Volume", () { |
| 2105 unittest.test("to-json--from-json", () { |
| 2106 var o = buildVolume(); |
| 2107 var od = new api.Volume.fromJson(o.toJson()); |
| 2108 checkVolume(od); |
| 2109 }); |
| 2110 }); |
| 2111 |
| 2112 |
| 2113 unittest.group("obj-schema-ZipInfo", () { |
| 2114 unittest.test("to-json--from-json", () { |
| 2115 var o = buildZipInfo(); |
| 2116 var od = new api.ZipInfo.fromJson(o.toJson()); |
| 2117 checkZipInfo(od); |
| 2118 }); |
| 2119 }); |
| 2120 |
| 2121 |
| 2122 unittest.group("resource-AppsResourceApi", () { |
| 2123 unittest.test("method--create", () { |
| 2124 |
| 2125 var mock = new HttpServerMock(); |
| 2126 api.AppsResourceApi res = new api.AppengineApi(mock).apps; |
| 2127 var arg_request = buildApplication(); |
| 2128 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2129 var obj = new api.Application.fromJson(json); |
| 2130 checkApplication(obj); |
| 2131 |
| 2132 var path = (req.url).path; |
| 2133 var pathOffset = 0; |
| 2134 var index; |
| 2135 var subPart; |
| 2136 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2137 pathOffset += 1; |
| 2138 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("v1beta/apps")); |
| 2139 pathOffset += 11; |
| 2140 |
| 2141 var query = (req.url).query; |
| 2142 var queryOffset = 0; |
| 2143 var queryMap = {}; |
| 2144 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2145 parseBool(n) { |
| 2146 if (n == "true") return true; |
| 2147 if (n == "false") return false; |
| 2148 if (n == null) return null; |
| 2149 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2150 } |
| 2151 if (query.length > 0) { |
| 2152 for (var part in query.split("&")) { |
| 2153 var keyvalue = part.split("="); |
| 2154 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2155 } |
| 2156 } |
| 2157 |
| 2158 |
| 2159 var h = { |
| 2160 "content-type" : "application/json; charset=utf-8", |
| 2161 }; |
| 2162 var resp = convert.JSON.encode(buildOperation()); |
| 2163 return new async.Future.value(stringResponse(200, h, resp)); |
| 2164 }), true); |
| 2165 res.create(arg_request).then(unittest.expectAsync(((api.Operation response
) { |
| 2166 checkOperation(response); |
| 2167 }))); |
| 2168 }); |
| 2169 |
| 2170 unittest.test("method--get", () { |
| 2171 |
| 2172 var mock = new HttpServerMock(); |
| 2173 api.AppsResourceApi res = new api.AppengineApi(mock).apps; |
| 2174 var arg_appsId = "foo"; |
| 2175 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2176 var path = (req.url).path; |
| 2177 var pathOffset = 0; |
| 2178 var index; |
| 2179 var subPart; |
| 2180 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2181 pathOffset += 1; |
| 2182 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2183 pathOffset += 12; |
| 2184 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2185 pathOffset = path.length; |
| 2186 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2187 |
| 2188 var query = (req.url).query; |
| 2189 var queryOffset = 0; |
| 2190 var queryMap = {}; |
| 2191 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2192 parseBool(n) { |
| 2193 if (n == "true") return true; |
| 2194 if (n == "false") return false; |
| 2195 if (n == null) return null; |
| 2196 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2197 } |
| 2198 if (query.length > 0) { |
| 2199 for (var part in query.split("&")) { |
| 2200 var keyvalue = part.split("="); |
| 2201 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2202 } |
| 2203 } |
| 2204 |
| 2205 |
| 2206 var h = { |
| 2207 "content-type" : "application/json; charset=utf-8", |
| 2208 }; |
| 2209 var resp = convert.JSON.encode(buildApplication()); |
| 2210 return new async.Future.value(stringResponse(200, h, resp)); |
| 2211 }), true); |
| 2212 res.get(arg_appsId).then(unittest.expectAsync(((api.Application response)
{ |
| 2213 checkApplication(response); |
| 2214 }))); |
| 2215 }); |
| 2216 |
| 2217 unittest.test("method--patch", () { |
| 2218 |
| 2219 var mock = new HttpServerMock(); |
| 2220 api.AppsResourceApi res = new api.AppengineApi(mock).apps; |
| 2221 var arg_request = buildApplication(); |
| 2222 var arg_appsId = "foo"; |
| 2223 var arg_updateMask = "foo"; |
| 2224 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2225 var obj = new api.Application.fromJson(json); |
| 2226 checkApplication(obj); |
| 2227 |
| 2228 var path = (req.url).path; |
| 2229 var pathOffset = 0; |
| 2230 var index; |
| 2231 var subPart; |
| 2232 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2233 pathOffset += 1; |
| 2234 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2235 pathOffset += 12; |
| 2236 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2237 pathOffset = path.length; |
| 2238 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2239 |
| 2240 var query = (req.url).query; |
| 2241 var queryOffset = 0; |
| 2242 var queryMap = {}; |
| 2243 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2244 parseBool(n) { |
| 2245 if (n == "true") return true; |
| 2246 if (n == "false") return false; |
| 2247 if (n == null) return null; |
| 2248 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2249 } |
| 2250 if (query.length > 0) { |
| 2251 for (var part in query.split("&")) { |
| 2252 var keyvalue = part.split("="); |
| 2253 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2254 } |
| 2255 } |
| 2256 unittest.expect(queryMap["updateMask"].first, unittest.equals(arg_update
Mask)); |
| 2257 |
| 2258 |
| 2259 var h = { |
| 2260 "content-type" : "application/json; charset=utf-8", |
| 2261 }; |
| 2262 var resp = convert.JSON.encode(buildOperation()); |
| 2263 return new async.Future.value(stringResponse(200, h, resp)); |
| 2264 }), true); |
| 2265 res.patch(arg_request, arg_appsId, updateMask: arg_updateMask).then(unitte
st.expectAsync(((api.Operation response) { |
| 2266 checkOperation(response); |
| 2267 }))); |
| 2268 }); |
| 2269 |
| 2270 unittest.test("method--repair", () { |
| 2271 |
| 2272 var mock = new HttpServerMock(); |
| 2273 api.AppsResourceApi res = new api.AppengineApi(mock).apps; |
| 2274 var arg_request = buildRepairApplicationRequest(); |
| 2275 var arg_appsId = "foo"; |
| 2276 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2277 var obj = new api.RepairApplicationRequest.fromJson(json); |
| 2278 checkRepairApplicationRequest(obj); |
| 2279 |
| 2280 var path = (req.url).path; |
| 2281 var pathOffset = 0; |
| 2282 var index; |
| 2283 var subPart; |
| 2284 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2285 pathOffset += 1; |
| 2286 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2287 pathOffset += 12; |
| 2288 index = path.indexOf(":repair", pathOffset); |
| 2289 unittest.expect(index >= 0, unittest.isTrue); |
| 2290 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2291 pathOffset = index; |
| 2292 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2293 unittest.expect(path.substring(pathOffset, pathOffset + 7), unittest.equ
als(":repair")); |
| 2294 pathOffset += 7; |
| 2295 |
| 2296 var query = (req.url).query; |
| 2297 var queryOffset = 0; |
| 2298 var queryMap = {}; |
| 2299 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2300 parseBool(n) { |
| 2301 if (n == "true") return true; |
| 2302 if (n == "false") return false; |
| 2303 if (n == null) return null; |
| 2304 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2305 } |
| 2306 if (query.length > 0) { |
| 2307 for (var part in query.split("&")) { |
| 2308 var keyvalue = part.split("="); |
| 2309 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2310 } |
| 2311 } |
| 2312 |
| 2313 |
| 2314 var h = { |
| 2315 "content-type" : "application/json; charset=utf-8", |
| 2316 }; |
| 2317 var resp = convert.JSON.encode(buildOperation()); |
| 2318 return new async.Future.value(stringResponse(200, h, resp)); |
| 2319 }), true); |
| 2320 res.repair(arg_request, arg_appsId).then(unittest.expectAsync(((api.Operat
ion response) { |
| 2321 checkOperation(response); |
| 2322 }))); |
| 2323 }); |
| 2324 |
| 2325 }); |
| 2326 |
| 2327 |
| 2328 unittest.group("resource-AppsLocationsResourceApi", () { |
| 2329 unittest.test("method--get", () { |
| 2330 |
| 2331 var mock = new HttpServerMock(); |
| 2332 api.AppsLocationsResourceApi res = new api.AppengineApi(mock).apps.locatio
ns; |
| 2333 var arg_appsId = "foo"; |
| 2334 var arg_locationsId = "foo"; |
| 2335 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2336 var path = (req.url).path; |
| 2337 var pathOffset = 0; |
| 2338 var index; |
| 2339 var subPart; |
| 2340 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2341 pathOffset += 1; |
| 2342 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2343 pathOffset += 12; |
| 2344 index = path.indexOf("/locations/", pathOffset); |
| 2345 unittest.expect(index >= 0, unittest.isTrue); |
| 2346 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2347 pathOffset = index; |
| 2348 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2349 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/locations/")); |
| 2350 pathOffset += 11; |
| 2351 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2352 pathOffset = path.length; |
| 2353 unittest.expect(subPart, unittest.equals("$arg_locationsId")); |
| 2354 |
| 2355 var query = (req.url).query; |
| 2356 var queryOffset = 0; |
| 2357 var queryMap = {}; |
| 2358 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2359 parseBool(n) { |
| 2360 if (n == "true") return true; |
| 2361 if (n == "false") return false; |
| 2362 if (n == null) return null; |
| 2363 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2364 } |
| 2365 if (query.length > 0) { |
| 2366 for (var part in query.split("&")) { |
| 2367 var keyvalue = part.split("="); |
| 2368 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2369 } |
| 2370 } |
| 2371 |
| 2372 |
| 2373 var h = { |
| 2374 "content-type" : "application/json; charset=utf-8", |
| 2375 }; |
| 2376 var resp = convert.JSON.encode(buildLocation()); |
| 2377 return new async.Future.value(stringResponse(200, h, resp)); |
| 2378 }), true); |
| 2379 res.get(arg_appsId, arg_locationsId).then(unittest.expectAsync(((api.Locat
ion response) { |
| 2380 checkLocation(response); |
| 2381 }))); |
| 2382 }); |
| 2383 |
| 2384 unittest.test("method--list", () { |
| 2385 |
| 2386 var mock = new HttpServerMock(); |
| 2387 api.AppsLocationsResourceApi res = new api.AppengineApi(mock).apps.locatio
ns; |
| 2388 var arg_appsId = "foo"; |
| 2389 var arg_pageToken = "foo"; |
| 2390 var arg_pageSize = 42; |
| 2391 var arg_filter = "foo"; |
| 2392 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2393 var path = (req.url).path; |
| 2394 var pathOffset = 0; |
| 2395 var index; |
| 2396 var subPart; |
| 2397 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2398 pathOffset += 1; |
| 2399 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2400 pathOffset += 12; |
| 2401 index = path.indexOf("/locations", pathOffset); |
| 2402 unittest.expect(index >= 0, unittest.isTrue); |
| 2403 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2404 pathOffset = index; |
| 2405 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2406 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/locations")); |
| 2407 pathOffset += 10; |
| 2408 |
| 2409 var query = (req.url).query; |
| 2410 var queryOffset = 0; |
| 2411 var queryMap = {}; |
| 2412 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2413 parseBool(n) { |
| 2414 if (n == "true") return true; |
| 2415 if (n == "false") return false; |
| 2416 if (n == null) return null; |
| 2417 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2418 } |
| 2419 if (query.length > 0) { |
| 2420 for (var part in query.split("&")) { |
| 2421 var keyvalue = part.split("="); |
| 2422 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2423 } |
| 2424 } |
| 2425 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2426 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2427 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 2428 |
| 2429 |
| 2430 var h = { |
| 2431 "content-type" : "application/json; charset=utf-8", |
| 2432 }; |
| 2433 var resp = convert.JSON.encode(buildListLocationsResponse()); |
| 2434 return new async.Future.value(stringResponse(200, h, resp)); |
| 2435 }), true); |
| 2436 res.list(arg_appsId, pageToken: arg_pageToken, pageSize: arg_pageSize, fil
ter: arg_filter).then(unittest.expectAsync(((api.ListLocationsResponse response)
{ |
| 2437 checkListLocationsResponse(response); |
| 2438 }))); |
| 2439 }); |
| 2440 |
| 2441 }); |
| 2442 |
| 2443 |
| 2444 unittest.group("resource-AppsOperationsResourceApi", () { |
| 2445 unittest.test("method--get", () { |
| 2446 |
| 2447 var mock = new HttpServerMock(); |
| 2448 api.AppsOperationsResourceApi res = new api.AppengineApi(mock).apps.operat
ions; |
| 2449 var arg_appsId = "foo"; |
| 2450 var arg_operationsId = "foo"; |
| 2451 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2452 var path = (req.url).path; |
| 2453 var pathOffset = 0; |
| 2454 var index; |
| 2455 var subPart; |
| 2456 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2457 pathOffset += 1; |
| 2458 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2459 pathOffset += 12; |
| 2460 index = path.indexOf("/operations/", pathOffset); |
| 2461 unittest.expect(index >= 0, unittest.isTrue); |
| 2462 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2463 pathOffset = index; |
| 2464 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2465 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("/operations/")); |
| 2466 pathOffset += 12; |
| 2467 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2468 pathOffset = path.length; |
| 2469 unittest.expect(subPart, unittest.equals("$arg_operationsId")); |
| 2470 |
| 2471 var query = (req.url).query; |
| 2472 var queryOffset = 0; |
| 2473 var queryMap = {}; |
| 2474 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2475 parseBool(n) { |
| 2476 if (n == "true") return true; |
| 2477 if (n == "false") return false; |
| 2478 if (n == null) return null; |
| 2479 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2480 } |
| 2481 if (query.length > 0) { |
| 2482 for (var part in query.split("&")) { |
| 2483 var keyvalue = part.split("="); |
| 2484 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2485 } |
| 2486 } |
| 2487 |
| 2488 |
| 2489 var h = { |
| 2490 "content-type" : "application/json; charset=utf-8", |
| 2491 }; |
| 2492 var resp = convert.JSON.encode(buildOperation()); |
| 2493 return new async.Future.value(stringResponse(200, h, resp)); |
| 2494 }), true); |
| 2495 res.get(arg_appsId, arg_operationsId).then(unittest.expectAsync(((api.Oper
ation response) { |
| 2496 checkOperation(response); |
| 2497 }))); |
| 2498 }); |
| 2499 |
| 2500 unittest.test("method--list", () { |
| 2501 |
| 2502 var mock = new HttpServerMock(); |
| 2503 api.AppsOperationsResourceApi res = new api.AppengineApi(mock).apps.operat
ions; |
| 2504 var arg_appsId = "foo"; |
| 2505 var arg_filter = "foo"; |
| 2506 var arg_pageToken = "foo"; |
| 2507 var arg_pageSize = 42; |
| 2508 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2509 var path = (req.url).path; |
| 2510 var pathOffset = 0; |
| 2511 var index; |
| 2512 var subPart; |
| 2513 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2514 pathOffset += 1; |
| 2515 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2516 pathOffset += 12; |
| 2517 index = path.indexOf("/operations", pathOffset); |
| 2518 unittest.expect(index >= 0, unittest.isTrue); |
| 2519 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2520 pathOffset = index; |
| 2521 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2522 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/operations")); |
| 2523 pathOffset += 11; |
| 2524 |
| 2525 var query = (req.url).query; |
| 2526 var queryOffset = 0; |
| 2527 var queryMap = {}; |
| 2528 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2529 parseBool(n) { |
| 2530 if (n == "true") return true; |
| 2531 if (n == "false") return false; |
| 2532 if (n == null) return null; |
| 2533 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2534 } |
| 2535 if (query.length > 0) { |
| 2536 for (var part in query.split("&")) { |
| 2537 var keyvalue = part.split("="); |
| 2538 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2539 } |
| 2540 } |
| 2541 unittest.expect(queryMap["filter"].first, unittest.equals(arg_filter)); |
| 2542 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2543 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2544 |
| 2545 |
| 2546 var h = { |
| 2547 "content-type" : "application/json; charset=utf-8", |
| 2548 }; |
| 2549 var resp = convert.JSON.encode(buildListOperationsResponse()); |
| 2550 return new async.Future.value(stringResponse(200, h, resp)); |
| 2551 }), true); |
| 2552 res.list(arg_appsId, filter: arg_filter, pageToken: arg_pageToken, pageSiz
e: arg_pageSize).then(unittest.expectAsync(((api.ListOperationsResponse response
) { |
| 2553 checkListOperationsResponse(response); |
| 2554 }))); |
| 2555 }); |
| 2556 |
| 2557 }); |
| 2558 |
| 2559 |
| 2560 unittest.group("resource-AppsServicesResourceApi", () { |
| 2561 unittest.test("method--delete", () { |
| 2562 |
| 2563 var mock = new HttpServerMock(); |
| 2564 api.AppsServicesResourceApi res = new api.AppengineApi(mock).apps.services
; |
| 2565 var arg_appsId = "foo"; |
| 2566 var arg_servicesId = "foo"; |
| 2567 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2568 var path = (req.url).path; |
| 2569 var pathOffset = 0; |
| 2570 var index; |
| 2571 var subPart; |
| 2572 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2573 pathOffset += 1; |
| 2574 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2575 pathOffset += 12; |
| 2576 index = path.indexOf("/services/", pathOffset); |
| 2577 unittest.expect(index >= 0, unittest.isTrue); |
| 2578 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2579 pathOffset = index; |
| 2580 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2581 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/services/")); |
| 2582 pathOffset += 10; |
| 2583 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2584 pathOffset = path.length; |
| 2585 unittest.expect(subPart, unittest.equals("$arg_servicesId")); |
| 2586 |
| 2587 var query = (req.url).query; |
| 2588 var queryOffset = 0; |
| 2589 var queryMap = {}; |
| 2590 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2591 parseBool(n) { |
| 2592 if (n == "true") return true; |
| 2593 if (n == "false") return false; |
| 2594 if (n == null) return null; |
| 2595 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2596 } |
| 2597 if (query.length > 0) { |
| 2598 for (var part in query.split("&")) { |
| 2599 var keyvalue = part.split("="); |
| 2600 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2601 } |
| 2602 } |
| 2603 |
| 2604 |
| 2605 var h = { |
| 2606 "content-type" : "application/json; charset=utf-8", |
| 2607 }; |
| 2608 var resp = convert.JSON.encode(buildOperation()); |
| 2609 return new async.Future.value(stringResponse(200, h, resp)); |
| 2610 }), true); |
| 2611 res.delete(arg_appsId, arg_servicesId).then(unittest.expectAsync(((api.Ope
ration response) { |
| 2612 checkOperation(response); |
| 2613 }))); |
| 2614 }); |
| 2615 |
| 2616 unittest.test("method--get", () { |
| 2617 |
| 2618 var mock = new HttpServerMock(); |
| 2619 api.AppsServicesResourceApi res = new api.AppengineApi(mock).apps.services
; |
| 2620 var arg_appsId = "foo"; |
| 2621 var arg_servicesId = "foo"; |
| 2622 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2623 var path = (req.url).path; |
| 2624 var pathOffset = 0; |
| 2625 var index; |
| 2626 var subPart; |
| 2627 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2628 pathOffset += 1; |
| 2629 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2630 pathOffset += 12; |
| 2631 index = path.indexOf("/services/", pathOffset); |
| 2632 unittest.expect(index >= 0, unittest.isTrue); |
| 2633 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2634 pathOffset = index; |
| 2635 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2636 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/services/")); |
| 2637 pathOffset += 10; |
| 2638 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2639 pathOffset = path.length; |
| 2640 unittest.expect(subPart, unittest.equals("$arg_servicesId")); |
| 2641 |
| 2642 var query = (req.url).query; |
| 2643 var queryOffset = 0; |
| 2644 var queryMap = {}; |
| 2645 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2646 parseBool(n) { |
| 2647 if (n == "true") return true; |
| 2648 if (n == "false") return false; |
| 2649 if (n == null) return null; |
| 2650 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2651 } |
| 2652 if (query.length > 0) { |
| 2653 for (var part in query.split("&")) { |
| 2654 var keyvalue = part.split("="); |
| 2655 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2656 } |
| 2657 } |
| 2658 |
| 2659 |
| 2660 var h = { |
| 2661 "content-type" : "application/json; charset=utf-8", |
| 2662 }; |
| 2663 var resp = convert.JSON.encode(buildService()); |
| 2664 return new async.Future.value(stringResponse(200, h, resp)); |
| 2665 }), true); |
| 2666 res.get(arg_appsId, arg_servicesId).then(unittest.expectAsync(((api.Servic
e response) { |
| 2667 checkService(response); |
| 2668 }))); |
| 2669 }); |
| 2670 |
| 2671 unittest.test("method--list", () { |
| 2672 |
| 2673 var mock = new HttpServerMock(); |
| 2674 api.AppsServicesResourceApi res = new api.AppengineApi(mock).apps.services
; |
| 2675 var arg_appsId = "foo"; |
| 2676 var arg_pageToken = "foo"; |
| 2677 var arg_pageSize = 42; |
| 2678 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2679 var path = (req.url).path; |
| 2680 var pathOffset = 0; |
| 2681 var index; |
| 2682 var subPart; |
| 2683 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2684 pathOffset += 1; |
| 2685 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2686 pathOffset += 12; |
| 2687 index = path.indexOf("/services", pathOffset); |
| 2688 unittest.expect(index >= 0, unittest.isTrue); |
| 2689 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2690 pathOffset = index; |
| 2691 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2692 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/services")); |
| 2693 pathOffset += 9; |
| 2694 |
| 2695 var query = (req.url).query; |
| 2696 var queryOffset = 0; |
| 2697 var queryMap = {}; |
| 2698 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2699 parseBool(n) { |
| 2700 if (n == "true") return true; |
| 2701 if (n == "false") return false; |
| 2702 if (n == null) return null; |
| 2703 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2704 } |
| 2705 if (query.length > 0) { |
| 2706 for (var part in query.split("&")) { |
| 2707 var keyvalue = part.split("="); |
| 2708 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2709 } |
| 2710 } |
| 2711 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 2712 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 2713 |
| 2714 |
| 2715 var h = { |
| 2716 "content-type" : "application/json; charset=utf-8", |
| 2717 }; |
| 2718 var resp = convert.JSON.encode(buildListServicesResponse()); |
| 2719 return new async.Future.value(stringResponse(200, h, resp)); |
| 2720 }), true); |
| 2721 res.list(arg_appsId, pageToken: arg_pageToken, pageSize: arg_pageSize).the
n(unittest.expectAsync(((api.ListServicesResponse response) { |
| 2722 checkListServicesResponse(response); |
| 2723 }))); |
| 2724 }); |
| 2725 |
| 2726 unittest.test("method--patch", () { |
| 2727 |
| 2728 var mock = new HttpServerMock(); |
| 2729 api.AppsServicesResourceApi res = new api.AppengineApi(mock).apps.services
; |
| 2730 var arg_request = buildService(); |
| 2731 var arg_appsId = "foo"; |
| 2732 var arg_servicesId = "foo"; |
| 2733 var arg_updateMask = "foo"; |
| 2734 var arg_migrateTraffic = true; |
| 2735 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2736 var obj = new api.Service.fromJson(json); |
| 2737 checkService(obj); |
| 2738 |
| 2739 var path = (req.url).path; |
| 2740 var pathOffset = 0; |
| 2741 var index; |
| 2742 var subPart; |
| 2743 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2744 pathOffset += 1; |
| 2745 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2746 pathOffset += 12; |
| 2747 index = path.indexOf("/services/", pathOffset); |
| 2748 unittest.expect(index >= 0, unittest.isTrue); |
| 2749 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2750 pathOffset = index; |
| 2751 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2752 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/services/")); |
| 2753 pathOffset += 10; |
| 2754 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2755 pathOffset = path.length; |
| 2756 unittest.expect(subPart, unittest.equals("$arg_servicesId")); |
| 2757 |
| 2758 var query = (req.url).query; |
| 2759 var queryOffset = 0; |
| 2760 var queryMap = {}; |
| 2761 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2762 parseBool(n) { |
| 2763 if (n == "true") return true; |
| 2764 if (n == "false") return false; |
| 2765 if (n == null) return null; |
| 2766 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2767 } |
| 2768 if (query.length > 0) { |
| 2769 for (var part in query.split("&")) { |
| 2770 var keyvalue = part.split("="); |
| 2771 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2772 } |
| 2773 } |
| 2774 unittest.expect(queryMap["updateMask"].first, unittest.equals(arg_update
Mask)); |
| 2775 unittest.expect(queryMap["migrateTraffic"].first, unittest.equals("$arg_
migrateTraffic")); |
| 2776 |
| 2777 |
| 2778 var h = { |
| 2779 "content-type" : "application/json; charset=utf-8", |
| 2780 }; |
| 2781 var resp = convert.JSON.encode(buildOperation()); |
| 2782 return new async.Future.value(stringResponse(200, h, resp)); |
| 2783 }), true); |
| 2784 res.patch(arg_request, arg_appsId, arg_servicesId, updateMask: arg_updateM
ask, migrateTraffic: arg_migrateTraffic).then(unittest.expectAsync(((api.Operati
on response) { |
| 2785 checkOperation(response); |
| 2786 }))); |
| 2787 }); |
| 2788 |
| 2789 }); |
| 2790 |
| 2791 |
| 2792 unittest.group("resource-AppsServicesVersionsResourceApi", () { |
| 2793 unittest.test("method--create", () { |
| 2794 |
| 2795 var mock = new HttpServerMock(); |
| 2796 api.AppsServicesVersionsResourceApi res = new api.AppengineApi(mock).apps.
services.versions; |
| 2797 var arg_request = buildVersion(); |
| 2798 var arg_appsId = "foo"; |
| 2799 var arg_servicesId = "foo"; |
| 2800 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2801 var obj = new api.Version.fromJson(json); |
| 2802 checkVersion(obj); |
| 2803 |
| 2804 var path = (req.url).path; |
| 2805 var pathOffset = 0; |
| 2806 var index; |
| 2807 var subPart; |
| 2808 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2809 pathOffset += 1; |
| 2810 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2811 pathOffset += 12; |
| 2812 index = path.indexOf("/services/", pathOffset); |
| 2813 unittest.expect(index >= 0, unittest.isTrue); |
| 2814 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2815 pathOffset = index; |
| 2816 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2817 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/services/")); |
| 2818 pathOffset += 10; |
| 2819 index = path.indexOf("/versions", pathOffset); |
| 2820 unittest.expect(index >= 0, unittest.isTrue); |
| 2821 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2822 pathOffset = index; |
| 2823 unittest.expect(subPart, unittest.equals("$arg_servicesId")); |
| 2824 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/versions")); |
| 2825 pathOffset += 9; |
| 2826 |
| 2827 var query = (req.url).query; |
| 2828 var queryOffset = 0; |
| 2829 var queryMap = {}; |
| 2830 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2831 parseBool(n) { |
| 2832 if (n == "true") return true; |
| 2833 if (n == "false") return false; |
| 2834 if (n == null) return null; |
| 2835 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2836 } |
| 2837 if (query.length > 0) { |
| 2838 for (var part in query.split("&")) { |
| 2839 var keyvalue = part.split("="); |
| 2840 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2841 } |
| 2842 } |
| 2843 |
| 2844 |
| 2845 var h = { |
| 2846 "content-type" : "application/json; charset=utf-8", |
| 2847 }; |
| 2848 var resp = convert.JSON.encode(buildOperation()); |
| 2849 return new async.Future.value(stringResponse(200, h, resp)); |
| 2850 }), true); |
| 2851 res.create(arg_request, arg_appsId, arg_servicesId).then(unittest.expectAs
ync(((api.Operation response) { |
| 2852 checkOperation(response); |
| 2853 }))); |
| 2854 }); |
| 2855 |
| 2856 unittest.test("method--delete", () { |
| 2857 |
| 2858 var mock = new HttpServerMock(); |
| 2859 api.AppsServicesVersionsResourceApi res = new api.AppengineApi(mock).apps.
services.versions; |
| 2860 var arg_appsId = "foo"; |
| 2861 var arg_servicesId = "foo"; |
| 2862 var arg_versionsId = "foo"; |
| 2863 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2864 var path = (req.url).path; |
| 2865 var pathOffset = 0; |
| 2866 var index; |
| 2867 var subPart; |
| 2868 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2869 pathOffset += 1; |
| 2870 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2871 pathOffset += 12; |
| 2872 index = path.indexOf("/services/", pathOffset); |
| 2873 unittest.expect(index >= 0, unittest.isTrue); |
| 2874 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2875 pathOffset = index; |
| 2876 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2877 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/services/")); |
| 2878 pathOffset += 10; |
| 2879 index = path.indexOf("/versions/", pathOffset); |
| 2880 unittest.expect(index >= 0, unittest.isTrue); |
| 2881 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2882 pathOffset = index; |
| 2883 unittest.expect(subPart, unittest.equals("$arg_servicesId")); |
| 2884 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/versions/")); |
| 2885 pathOffset += 10; |
| 2886 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2887 pathOffset = path.length; |
| 2888 unittest.expect(subPart, unittest.equals("$arg_versionsId")); |
| 2889 |
| 2890 var query = (req.url).query; |
| 2891 var queryOffset = 0; |
| 2892 var queryMap = {}; |
| 2893 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2894 parseBool(n) { |
| 2895 if (n == "true") return true; |
| 2896 if (n == "false") return false; |
| 2897 if (n == null) return null; |
| 2898 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2899 } |
| 2900 if (query.length > 0) { |
| 2901 for (var part in query.split("&")) { |
| 2902 var keyvalue = part.split("="); |
| 2903 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2904 } |
| 2905 } |
| 2906 |
| 2907 |
| 2908 var h = { |
| 2909 "content-type" : "application/json; charset=utf-8", |
| 2910 }; |
| 2911 var resp = convert.JSON.encode(buildOperation()); |
| 2912 return new async.Future.value(stringResponse(200, h, resp)); |
| 2913 }), true); |
| 2914 res.delete(arg_appsId, arg_servicesId, arg_versionsId).then(unittest.expec
tAsync(((api.Operation response) { |
| 2915 checkOperation(response); |
| 2916 }))); |
| 2917 }); |
| 2918 |
| 2919 unittest.test("method--get", () { |
| 2920 |
| 2921 var mock = new HttpServerMock(); |
| 2922 api.AppsServicesVersionsResourceApi res = new api.AppengineApi(mock).apps.
services.versions; |
| 2923 var arg_appsId = "foo"; |
| 2924 var arg_servicesId = "foo"; |
| 2925 var arg_versionsId = "foo"; |
| 2926 var arg_view = "foo"; |
| 2927 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2928 var path = (req.url).path; |
| 2929 var pathOffset = 0; |
| 2930 var index; |
| 2931 var subPart; |
| 2932 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2933 pathOffset += 1; |
| 2934 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 2935 pathOffset += 12; |
| 2936 index = path.indexOf("/services/", pathOffset); |
| 2937 unittest.expect(index >= 0, unittest.isTrue); |
| 2938 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2939 pathOffset = index; |
| 2940 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 2941 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/services/")); |
| 2942 pathOffset += 10; |
| 2943 index = path.indexOf("/versions/", pathOffset); |
| 2944 unittest.expect(index >= 0, unittest.isTrue); |
| 2945 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 2946 pathOffset = index; |
| 2947 unittest.expect(subPart, unittest.equals("$arg_servicesId")); |
| 2948 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/versions/")); |
| 2949 pathOffset += 10; |
| 2950 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 2951 pathOffset = path.length; |
| 2952 unittest.expect(subPart, unittest.equals("$arg_versionsId")); |
| 2953 |
| 2954 var query = (req.url).query; |
| 2955 var queryOffset = 0; |
| 2956 var queryMap = {}; |
| 2957 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 2958 parseBool(n) { |
| 2959 if (n == "true") return true; |
| 2960 if (n == "false") return false; |
| 2961 if (n == null) return null; |
| 2962 throw new core.ArgumentError("Invalid boolean: $n"); |
| 2963 } |
| 2964 if (query.length > 0) { |
| 2965 for (var part in query.split("&")) { |
| 2966 var keyvalue = part.split("="); |
| 2967 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 2968 } |
| 2969 } |
| 2970 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
| 2971 |
| 2972 |
| 2973 var h = { |
| 2974 "content-type" : "application/json; charset=utf-8", |
| 2975 }; |
| 2976 var resp = convert.JSON.encode(buildVersion()); |
| 2977 return new async.Future.value(stringResponse(200, h, resp)); |
| 2978 }), true); |
| 2979 res.get(arg_appsId, arg_servicesId, arg_versionsId, view: arg_view).then(u
nittest.expectAsync(((api.Version response) { |
| 2980 checkVersion(response); |
| 2981 }))); |
| 2982 }); |
| 2983 |
| 2984 unittest.test("method--list", () { |
| 2985 |
| 2986 var mock = new HttpServerMock(); |
| 2987 api.AppsServicesVersionsResourceApi res = new api.AppengineApi(mock).apps.
services.versions; |
| 2988 var arg_appsId = "foo"; |
| 2989 var arg_servicesId = "foo"; |
| 2990 var arg_pageToken = "foo"; |
| 2991 var arg_pageSize = 42; |
| 2992 var arg_view = "foo"; |
| 2993 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 2994 var path = (req.url).path; |
| 2995 var pathOffset = 0; |
| 2996 var index; |
| 2997 var subPart; |
| 2998 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 2999 pathOffset += 1; |
| 3000 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 3001 pathOffset += 12; |
| 3002 index = path.indexOf("/services/", pathOffset); |
| 3003 unittest.expect(index >= 0, unittest.isTrue); |
| 3004 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3005 pathOffset = index; |
| 3006 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 3007 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/services/")); |
| 3008 pathOffset += 10; |
| 3009 index = path.indexOf("/versions", pathOffset); |
| 3010 unittest.expect(index >= 0, unittest.isTrue); |
| 3011 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3012 pathOffset = index; |
| 3013 unittest.expect(subPart, unittest.equals("$arg_servicesId")); |
| 3014 unittest.expect(path.substring(pathOffset, pathOffset + 9), unittest.equ
als("/versions")); |
| 3015 pathOffset += 9; |
| 3016 |
| 3017 var query = (req.url).query; |
| 3018 var queryOffset = 0; |
| 3019 var queryMap = {}; |
| 3020 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3021 parseBool(n) { |
| 3022 if (n == "true") return true; |
| 3023 if (n == "false") return false; |
| 3024 if (n == null) return null; |
| 3025 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3026 } |
| 3027 if (query.length > 0) { |
| 3028 for (var part in query.split("&")) { |
| 3029 var keyvalue = part.split("="); |
| 3030 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 3031 } |
| 3032 } |
| 3033 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 3034 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 3035 unittest.expect(queryMap["view"].first, unittest.equals(arg_view)); |
| 3036 |
| 3037 |
| 3038 var h = { |
| 3039 "content-type" : "application/json; charset=utf-8", |
| 3040 }; |
| 3041 var resp = convert.JSON.encode(buildListVersionsResponse()); |
| 3042 return new async.Future.value(stringResponse(200, h, resp)); |
| 3043 }), true); |
| 3044 res.list(arg_appsId, arg_servicesId, pageToken: arg_pageToken, pageSize: a
rg_pageSize, view: arg_view).then(unittest.expectAsync(((api.ListVersionsRespons
e response) { |
| 3045 checkListVersionsResponse(response); |
| 3046 }))); |
| 3047 }); |
| 3048 |
| 3049 unittest.test("method--patch", () { |
| 3050 |
| 3051 var mock = new HttpServerMock(); |
| 3052 api.AppsServicesVersionsResourceApi res = new api.AppengineApi(mock).apps.
services.versions; |
| 3053 var arg_request = buildVersion(); |
| 3054 var arg_appsId = "foo"; |
| 3055 var arg_servicesId = "foo"; |
| 3056 var arg_versionsId = "foo"; |
| 3057 var arg_updateMask = "foo"; |
| 3058 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 3059 var obj = new api.Version.fromJson(json); |
| 3060 checkVersion(obj); |
| 3061 |
| 3062 var path = (req.url).path; |
| 3063 var pathOffset = 0; |
| 3064 var index; |
| 3065 var subPart; |
| 3066 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 3067 pathOffset += 1; |
| 3068 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 3069 pathOffset += 12; |
| 3070 index = path.indexOf("/services/", pathOffset); |
| 3071 unittest.expect(index >= 0, unittest.isTrue); |
| 3072 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3073 pathOffset = index; |
| 3074 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 3075 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/services/")); |
| 3076 pathOffset += 10; |
| 3077 index = path.indexOf("/versions/", pathOffset); |
| 3078 unittest.expect(index >= 0, unittest.isTrue); |
| 3079 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3080 pathOffset = index; |
| 3081 unittest.expect(subPart, unittest.equals("$arg_servicesId")); |
| 3082 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/versions/")); |
| 3083 pathOffset += 10; |
| 3084 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 3085 pathOffset = path.length; |
| 3086 unittest.expect(subPart, unittest.equals("$arg_versionsId")); |
| 3087 |
| 3088 var query = (req.url).query; |
| 3089 var queryOffset = 0; |
| 3090 var queryMap = {}; |
| 3091 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3092 parseBool(n) { |
| 3093 if (n == "true") return true; |
| 3094 if (n == "false") return false; |
| 3095 if (n == null) return null; |
| 3096 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3097 } |
| 3098 if (query.length > 0) { |
| 3099 for (var part in query.split("&")) { |
| 3100 var keyvalue = part.split("="); |
| 3101 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 3102 } |
| 3103 } |
| 3104 unittest.expect(queryMap["updateMask"].first, unittest.equals(arg_update
Mask)); |
| 3105 |
| 3106 |
| 3107 var h = { |
| 3108 "content-type" : "application/json; charset=utf-8", |
| 3109 }; |
| 3110 var resp = convert.JSON.encode(buildOperation()); |
| 3111 return new async.Future.value(stringResponse(200, h, resp)); |
| 3112 }), true); |
| 3113 res.patch(arg_request, arg_appsId, arg_servicesId, arg_versionsId, updateM
ask: arg_updateMask).then(unittest.expectAsync(((api.Operation response) { |
| 3114 checkOperation(response); |
| 3115 }))); |
| 3116 }); |
| 3117 |
| 3118 }); |
| 3119 |
| 3120 |
| 3121 unittest.group("resource-AppsServicesVersionsInstancesResourceApi", () { |
| 3122 unittest.test("method--debug", () { |
| 3123 |
| 3124 var mock = new HttpServerMock(); |
| 3125 api.AppsServicesVersionsInstancesResourceApi res = new api.AppengineApi(mo
ck).apps.services.versions.instances; |
| 3126 var arg_request = buildDebugInstanceRequest(); |
| 3127 var arg_appsId = "foo"; |
| 3128 var arg_servicesId = "foo"; |
| 3129 var arg_versionsId = "foo"; |
| 3130 var arg_instancesId = "foo"; |
| 3131 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 3132 var obj = new api.DebugInstanceRequest.fromJson(json); |
| 3133 checkDebugInstanceRequest(obj); |
| 3134 |
| 3135 var path = (req.url).path; |
| 3136 var pathOffset = 0; |
| 3137 var index; |
| 3138 var subPart; |
| 3139 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 3140 pathOffset += 1; |
| 3141 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 3142 pathOffset += 12; |
| 3143 index = path.indexOf("/services/", pathOffset); |
| 3144 unittest.expect(index >= 0, unittest.isTrue); |
| 3145 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3146 pathOffset = index; |
| 3147 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 3148 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/services/")); |
| 3149 pathOffset += 10; |
| 3150 index = path.indexOf("/versions/", pathOffset); |
| 3151 unittest.expect(index >= 0, unittest.isTrue); |
| 3152 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3153 pathOffset = index; |
| 3154 unittest.expect(subPart, unittest.equals("$arg_servicesId")); |
| 3155 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/versions/")); |
| 3156 pathOffset += 10; |
| 3157 index = path.indexOf("/instances/", pathOffset); |
| 3158 unittest.expect(index >= 0, unittest.isTrue); |
| 3159 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3160 pathOffset = index; |
| 3161 unittest.expect(subPart, unittest.equals("$arg_versionsId")); |
| 3162 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); |
| 3163 pathOffset += 11; |
| 3164 index = path.indexOf(":debug", pathOffset); |
| 3165 unittest.expect(index >= 0, unittest.isTrue); |
| 3166 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3167 pathOffset = index; |
| 3168 unittest.expect(subPart, unittest.equals("$arg_instancesId")); |
| 3169 unittest.expect(path.substring(pathOffset, pathOffset + 6), unittest.equ
als(":debug")); |
| 3170 pathOffset += 6; |
| 3171 |
| 3172 var query = (req.url).query; |
| 3173 var queryOffset = 0; |
| 3174 var queryMap = {}; |
| 3175 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3176 parseBool(n) { |
| 3177 if (n == "true") return true; |
| 3178 if (n == "false") return false; |
| 3179 if (n == null) return null; |
| 3180 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3181 } |
| 3182 if (query.length > 0) { |
| 3183 for (var part in query.split("&")) { |
| 3184 var keyvalue = part.split("="); |
| 3185 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 3186 } |
| 3187 } |
| 3188 |
| 3189 |
| 3190 var h = { |
| 3191 "content-type" : "application/json; charset=utf-8", |
| 3192 }; |
| 3193 var resp = convert.JSON.encode(buildOperation()); |
| 3194 return new async.Future.value(stringResponse(200, h, resp)); |
| 3195 }), true); |
| 3196 res.debug(arg_request, arg_appsId, arg_servicesId, arg_versionsId, arg_ins
tancesId).then(unittest.expectAsync(((api.Operation response) { |
| 3197 checkOperation(response); |
| 3198 }))); |
| 3199 }); |
| 3200 |
| 3201 unittest.test("method--delete", () { |
| 3202 |
| 3203 var mock = new HttpServerMock(); |
| 3204 api.AppsServicesVersionsInstancesResourceApi res = new api.AppengineApi(mo
ck).apps.services.versions.instances; |
| 3205 var arg_appsId = "foo"; |
| 3206 var arg_servicesId = "foo"; |
| 3207 var arg_versionsId = "foo"; |
| 3208 var arg_instancesId = "foo"; |
| 3209 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 3210 var path = (req.url).path; |
| 3211 var pathOffset = 0; |
| 3212 var index; |
| 3213 var subPart; |
| 3214 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 3215 pathOffset += 1; |
| 3216 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 3217 pathOffset += 12; |
| 3218 index = path.indexOf("/services/", pathOffset); |
| 3219 unittest.expect(index >= 0, unittest.isTrue); |
| 3220 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3221 pathOffset = index; |
| 3222 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 3223 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/services/")); |
| 3224 pathOffset += 10; |
| 3225 index = path.indexOf("/versions/", pathOffset); |
| 3226 unittest.expect(index >= 0, unittest.isTrue); |
| 3227 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3228 pathOffset = index; |
| 3229 unittest.expect(subPart, unittest.equals("$arg_servicesId")); |
| 3230 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/versions/")); |
| 3231 pathOffset += 10; |
| 3232 index = path.indexOf("/instances/", pathOffset); |
| 3233 unittest.expect(index >= 0, unittest.isTrue); |
| 3234 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3235 pathOffset = index; |
| 3236 unittest.expect(subPart, unittest.equals("$arg_versionsId")); |
| 3237 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); |
| 3238 pathOffset += 11; |
| 3239 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 3240 pathOffset = path.length; |
| 3241 unittest.expect(subPart, unittest.equals("$arg_instancesId")); |
| 3242 |
| 3243 var query = (req.url).query; |
| 3244 var queryOffset = 0; |
| 3245 var queryMap = {}; |
| 3246 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3247 parseBool(n) { |
| 3248 if (n == "true") return true; |
| 3249 if (n == "false") return false; |
| 3250 if (n == null) return null; |
| 3251 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3252 } |
| 3253 if (query.length > 0) { |
| 3254 for (var part in query.split("&")) { |
| 3255 var keyvalue = part.split("="); |
| 3256 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 3257 } |
| 3258 } |
| 3259 |
| 3260 |
| 3261 var h = { |
| 3262 "content-type" : "application/json; charset=utf-8", |
| 3263 }; |
| 3264 var resp = convert.JSON.encode(buildOperation()); |
| 3265 return new async.Future.value(stringResponse(200, h, resp)); |
| 3266 }), true); |
| 3267 res.delete(arg_appsId, arg_servicesId, arg_versionsId, arg_instancesId).th
en(unittest.expectAsync(((api.Operation response) { |
| 3268 checkOperation(response); |
| 3269 }))); |
| 3270 }); |
| 3271 |
| 3272 unittest.test("method--get", () { |
| 3273 |
| 3274 var mock = new HttpServerMock(); |
| 3275 api.AppsServicesVersionsInstancesResourceApi res = new api.AppengineApi(mo
ck).apps.services.versions.instances; |
| 3276 var arg_appsId = "foo"; |
| 3277 var arg_servicesId = "foo"; |
| 3278 var arg_versionsId = "foo"; |
| 3279 var arg_instancesId = "foo"; |
| 3280 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 3281 var path = (req.url).path; |
| 3282 var pathOffset = 0; |
| 3283 var index; |
| 3284 var subPart; |
| 3285 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 3286 pathOffset += 1; |
| 3287 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 3288 pathOffset += 12; |
| 3289 index = path.indexOf("/services/", pathOffset); |
| 3290 unittest.expect(index >= 0, unittest.isTrue); |
| 3291 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3292 pathOffset = index; |
| 3293 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 3294 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/services/")); |
| 3295 pathOffset += 10; |
| 3296 index = path.indexOf("/versions/", pathOffset); |
| 3297 unittest.expect(index >= 0, unittest.isTrue); |
| 3298 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3299 pathOffset = index; |
| 3300 unittest.expect(subPart, unittest.equals("$arg_servicesId")); |
| 3301 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/versions/")); |
| 3302 pathOffset += 10; |
| 3303 index = path.indexOf("/instances/", pathOffset); |
| 3304 unittest.expect(index >= 0, unittest.isTrue); |
| 3305 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3306 pathOffset = index; |
| 3307 unittest.expect(subPart, unittest.equals("$arg_versionsId")); |
| 3308 unittest.expect(path.substring(pathOffset, pathOffset + 11), unittest.eq
uals("/instances/")); |
| 3309 pathOffset += 11; |
| 3310 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset)); |
| 3311 pathOffset = path.length; |
| 3312 unittest.expect(subPart, unittest.equals("$arg_instancesId")); |
| 3313 |
| 3314 var query = (req.url).query; |
| 3315 var queryOffset = 0; |
| 3316 var queryMap = {}; |
| 3317 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3318 parseBool(n) { |
| 3319 if (n == "true") return true; |
| 3320 if (n == "false") return false; |
| 3321 if (n == null) return null; |
| 3322 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3323 } |
| 3324 if (query.length > 0) { |
| 3325 for (var part in query.split("&")) { |
| 3326 var keyvalue = part.split("="); |
| 3327 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 3328 } |
| 3329 } |
| 3330 |
| 3331 |
| 3332 var h = { |
| 3333 "content-type" : "application/json; charset=utf-8", |
| 3334 }; |
| 3335 var resp = convert.JSON.encode(buildInstance()); |
| 3336 return new async.Future.value(stringResponse(200, h, resp)); |
| 3337 }), true); |
| 3338 res.get(arg_appsId, arg_servicesId, arg_versionsId, arg_instancesId).then(
unittest.expectAsync(((api.Instance response) { |
| 3339 checkInstance(response); |
| 3340 }))); |
| 3341 }); |
| 3342 |
| 3343 unittest.test("method--list", () { |
| 3344 |
| 3345 var mock = new HttpServerMock(); |
| 3346 api.AppsServicesVersionsInstancesResourceApi res = new api.AppengineApi(mo
ck).apps.services.versions.instances; |
| 3347 var arg_appsId = "foo"; |
| 3348 var arg_servicesId = "foo"; |
| 3349 var arg_versionsId = "foo"; |
| 3350 var arg_pageToken = "foo"; |
| 3351 var arg_pageSize = 42; |
| 3352 mock.register(unittest.expectAsync((http.BaseRequest req, json) { |
| 3353 var path = (req.url).path; |
| 3354 var pathOffset = 0; |
| 3355 var index; |
| 3356 var subPart; |
| 3357 unittest.expect(path.substring(pathOffset, pathOffset + 1), unittest.equ
als("/")); |
| 3358 pathOffset += 1; |
| 3359 unittest.expect(path.substring(pathOffset, pathOffset + 12), unittest.eq
uals("v1beta/apps/")); |
| 3360 pathOffset += 12; |
| 3361 index = path.indexOf("/services/", pathOffset); |
| 3362 unittest.expect(index >= 0, unittest.isTrue); |
| 3363 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3364 pathOffset = index; |
| 3365 unittest.expect(subPart, unittest.equals("$arg_appsId")); |
| 3366 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/services/")); |
| 3367 pathOffset += 10; |
| 3368 index = path.indexOf("/versions/", pathOffset); |
| 3369 unittest.expect(index >= 0, unittest.isTrue); |
| 3370 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3371 pathOffset = index; |
| 3372 unittest.expect(subPart, unittest.equals("$arg_servicesId")); |
| 3373 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/versions/")); |
| 3374 pathOffset += 10; |
| 3375 index = path.indexOf("/instances", pathOffset); |
| 3376 unittest.expect(index >= 0, unittest.isTrue); |
| 3377 subPart = core.Uri.decodeQueryComponent(path.substring(pathOffset, index
)); |
| 3378 pathOffset = index; |
| 3379 unittest.expect(subPart, unittest.equals("$arg_versionsId")); |
| 3380 unittest.expect(path.substring(pathOffset, pathOffset + 10), unittest.eq
uals("/instances")); |
| 3381 pathOffset += 10; |
| 3382 |
| 3383 var query = (req.url).query; |
| 3384 var queryOffset = 0; |
| 3385 var queryMap = {}; |
| 3386 addQueryParam(n, v) => queryMap.putIfAbsent(n, () => []).add(v); |
| 3387 parseBool(n) { |
| 3388 if (n == "true") return true; |
| 3389 if (n == "false") return false; |
| 3390 if (n == null) return null; |
| 3391 throw new core.ArgumentError("Invalid boolean: $n"); |
| 3392 } |
| 3393 if (query.length > 0) { |
| 3394 for (var part in query.split("&")) { |
| 3395 var keyvalue = part.split("="); |
| 3396 addQueryParam(core.Uri.decodeQueryComponent(keyvalue[0]), core.Uri.d
ecodeQueryComponent(keyvalue[1])); |
| 3397 } |
| 3398 } |
| 3399 unittest.expect(queryMap["pageToken"].first, unittest.equals(arg_pageTok
en)); |
| 3400 unittest.expect(core.int.parse(queryMap["pageSize"].first), unittest.equ
als(arg_pageSize)); |
| 3401 |
| 3402 |
| 3403 var h = { |
| 3404 "content-type" : "application/json; charset=utf-8", |
| 3405 }; |
| 3406 var resp = convert.JSON.encode(buildListInstancesResponse()); |
| 3407 return new async.Future.value(stringResponse(200, h, resp)); |
| 3408 }), true); |
| 3409 res.list(arg_appsId, arg_servicesId, arg_versionsId, pageToken: arg_pageTo
ken, pageSize: arg_pageSize).then(unittest.expectAsync(((api.ListInstancesRespon
se response) { |
| 3410 checkListInstancesResponse(response); |
| 3411 }))); |
| 3412 }); |
| 3413 |
| 3414 }); |
| 3415 |
| 3416 |
| 3417 } |
| 3418 |
OLD | NEW |